Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Automatically Migrate Workflow to a Shared Collections through Github/GitLab

zzy98y
7 - Meteor

Hi, 

 

I am trying to develop something that can automatically migrate workflow to a shared collection on the Alteryx Server every time we made change. 

 

There are two types of workflows involved. 

 

1. Standard Workflow  

2. Workflow that contain customized marcos. bascially a workflow that connects all the batch macro we created. 

 

 

My question is 

 

Is it possible to have Alteryx API to pull from version control software like Github and Gitlab?  Because I know the backend for Alteryx workflow is just XML, it can be stored on a remote git repository like Github and GitLab. However, the thing is I need to be able to pull the latest code I pushed to the remote repository into Alteryx Server and overwrite the existing workflow in a shared collection. Is it possible to achieve that?  Same for the workflow that involves batch macros. 

 

My end goal here is, I have a collections that share all workflows, every time I made change locally, it will automatically push into Remote Repository ( I assume standard workflow is just plain XML, but for workflow that involves batch macros, I am not sure how that will work). And then Alteryx Server will identify in the shared collections which workflow that has a newer version on the repository, remove this version/ replace this version with the new version the repository so people who are in this shared collection will always run most up to date workflow we have. 

 

Can someone share some ideas/thoughts on how to approach this? 

 

Thank you very much for the help in advance! 

 

2 REPLIES 2
fmvizcaino
17 - Castor
17 - Castor

Hey @zzy98y ,

 

I`m not very familiar with Github and Gitlab so not sure how to check for new versions. Perhaps you could use GitHub trigger APIs, if any, to send the files using the Alteryx gallery APIs.

 

That said, if we were to do everything in Alteryx, this is what I would do:

  1. Have a list with all workflows and versions available on the Server to doublecheck with GitHub what is current and what should be updated or what`s new
  2. Publish the workflows with the Gallery APis
    1. For context, we have this workflow for migration between environments, but you can use parts of it for your purpose: https://community.alteryx.com/t5/Community-Gallery/Alteryx-Gallery-Workflow-Migration/ta-p/1031739
    2. New workflows or version updates are both being considered.fmvizcaino_0-1687448748775.png

       

    3. When publishing a workflow through APIs or manually, Alteryx uses the packaged version yxzp, not the yxmd so for single workflows or with macros in it, you would need to packaged them into yxzp.
    4. If you need to build the yxzp by yourself, fortunately, yxzps are very similar to zip files, so it is only a matter of using python or 7z command line and rename the extension right after
      1. Additional requirement for zip files: https://community.alteryx.com/t5/Dev-Space/Invalid-package-file-when-posting-workflow-to-Gallery/td-...
  3. Things to consider
    1. You can schedule this for the server to run this workflow on a periodic basis but it would be better if GitHub had a trigger every time files are updated
    2. Better to have an intermediate process before updating the file on GitHub. If not, you could be publishing unwanted or workflows that are not working
    3. If I`m not mistaken, this is not validating the workflow prior to publishing it. The validation process only happens when publishing from designer so you will be losing this step with the automation.

Best regards,

Fernando Vizcaino

fmvizcaino
17 - Castor
17 - Castor

As soon as I finish the post, Alteryx release on their product update call that they will release GitHub macros. They didn`t say anything about the features and also not sure if you will be able to use in previous versions, but perhaps that will solve some of your challenges.

 

Best,

Fernando Vizcaino