Alteryx Server Discussions

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

ServerRipper - Using the Alteryx Gallery API to download workflows en masse

mtornga
6 - Meteoroid

As server admins, we sometimes get in a bind where we have just done a rollback on the server or a cutover and then a user comes out of the woodwork to request a workflow that got lost in the shuffle. We then face restoring the old backup to a lower environment to grab the workflow. This happened to my team recently and it made me want to take a more frequent backup of all of the workflows (we already back up our MongoDB daily), just in case. That is why this utility ServerRipper was created.

 

This utility builds on the excellent work of @patrick_digan about the Alteryx API and @jdunkerley79 on dynamic directory creation using the Run Command tool. 

 

End Result


After running the workflow, a hierarchy of folders is created. Within the top-level folder - I have called mine ServerWorkflowBackup - a folder is created for each Studio/Subscription e.g. Finance, Accounting, Admins. 

 

mtornga_0-1588002385230.png

Within each Subscription folder, a folder is created for each User. 

 

mtornga_1-1588002527521.png

 

Finally, within each user folder is a .yxzp package of every workflow and app that the user owns on the gallery.

 

mtornga_2-1588002658737.png


Install and Run

Download and open the file ServerRipper_community.yxzp attached. This was developed in Designer 2020.1. 

 

When prompted to import packages, say yes. Ignore errors and warnings on the Import Workflow Package and Workflow Dependencies popups. 

 

Close Designer and go back to your download location. At this location '\ServerRipper_community\yxi installer' find and install 'Alteryx API Runner.yxi'. Reopen the workflow.

Follow the rest of the instructions in the workflow.

mtornga_3-1588004094169.png

If you find that you have errors, ensure that the Cleanse tool is set up correctly, and ensure that you are a Curator in your Gallery. 

I hope that you find this simple to use and that it saves you from a headache someday. Enjoy!

 

26 REPLIES 26
hroderick-thr
11 - Bolide

I'm definitely going to use this. 

Beyond backups I want to search the xml find connections, sql, etc.

Thanks SO much for sharing

mtornga
6 - Meteoroid

@hroderick-thr wrote:

Beyond backups I want to search the xml find connections, sql, etc.


Same! Let me know what you discover. 

adrianp112
7 - Meteor

@mtornga 

 

Thank you so much for you work flow , we have it working in our environment now 🙂

 

One thing though, in the formula tool before the batch file creation , just added a couple quotes to encase the folder path..... we have some exotic active directory names with more than one period eg: value1.value2.lastname

 

thanks again!

 

Adrianp112_1-1617930839960.png

 

shareef2
7 - Meteor

Hi, Thanks for the solution. When i ran the job i see all YXZP files created. May i know how can i download (yxmd/yxmc/yxwz files). Because i want to open all workflows as text(XML) in designer and search for TEXT. (to see how may workflows using one table)

 

With YXZP i would need to extract each package one by one to read (yxmd/yxmc/yxwz files). Please help.

 

Thanks.

adrianp112
7 - Meteor

Hi Shareef

 

As far as I can see in the API docs you can only download assets as a package .yxzp .... you will need another component to unpack and search for your text in the underlying XML.

 

Cheers

Adrian

shareef2
7 - Meteor

I have got 300+ packages now. any ripper to unzip all of them in a sigle go. Please help. 

 

TIA - Sha

lcrosby
7 - Meteor

If anyone is still looking at this - workflow packages (yxzp files) are actually just zip files, so if you output them from the api with a file extension of zip, then you can open them like a normal archive file with an input tool and then grab the actual workflow file within.

hroderick-thr
11 - Bolide

It has served me well.  I built an app that people run to get a workflow into production. The ripper downloads it from a collection, does an xml inspection and xml changes. Returns an email to requestor with inspection report and a code they provide to a second app if they want to proceed to production. It does a lot of stuff specific to our operations, but being able to manage the transition from dev to prod will be common to most of us.

Thableaus
17 - Castor
17 - Castor

Cool!