Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Retrieving workflow xml from Gallery

obridgeman
7 - Meteor

We were wondering if it was possible to retrieve the workflows that are saved on the Gallery.

 

The reason for this is that there is a handy xml parser tool that allows you to parse the xml of an Alteryx workflow to give you tool details such as:

 

Input tool - [database where the data is coming from]

Formula tool - [what formulas are used]

Output tool - [database where the data is going]

 

The workflows that are saved on the Gallery however are stored in the MongoDB, but I assume that to download or run a workflow from the Gallery that there is a method of retrieving the workflow from the Mongo and converting it to its original form.

 

Does someone know the tool or method that is used to do this so that we might replicate it to pull off all of our workflows on the gallery and then analyse them using the above mentioned xml parser?

 

Many Thanks in advance.

 

Oli

24 REPLIES 24
danilang
19 - Altair
19 - Altair

Hi @obridgeman 

 

Check out @patrick_digan's great solution here

 

Dan 

obridgeman
7 - Meteor

Hi Dan,

 

Thanks for the link I had a look into it but maybe I am just terrible at reading the instructions given but I can't get the macro to work!

 

I replace the URL and Endpoint in the Macro and provide my admin key and secret but I get a 401 authorisation error.

 

Does the username have to be included in the URL?

 

In the meantime (as I haven't really used API before) I have set about making a Log Parser for Alteryx Engine Logs which we will use to read the logs and spit out the SQL tables involved and if they were read from or written to. 

 

Useful for us as it will let us know where data is coming from and going to through Alteryx.

 

I'd like to use the xmls though!!

 

Thanks,

 

Oli

danilang
19 - Altair
19 - Altair

Hi @obridgeman 

 

Do you have the Admin API enabled?  The key and secret you need to provide are these 2

 

API.png

 

Dan

obridgeman
7 - Meteor

Hi Dan,

 

I do have the admin key enabled.

 

It could be that I am using the macro incorrectly and leaving the 'User%' in the string?

 

Or it could be that our Alteryx instance is behind a single sign on Windows Auth?

 

Thanks,

 

Oli

danilang
19 - Altair
19 - Altair

Endpoint URL string in the input box should be %User.GalleryBaseURL%%User.EndPoint1%.  These variables correspond to 2 workflow constants defined in your main workflow.  

 

API.png

 

If you're completely building your URL from scratch, make sure it looks like this

 

 

https://servername/gallery/api/admin/v1/workflows/

 

 

where servername is exactly the url you use to access the gallery.

 

Edit:  did you download the sample that goes along with the macro.  I found it was easier to work within the structure defined there.  It also contains a list of valid endpoints

 

Dan

 

BenMoss
ACE Emeritus
ACE Emeritus

Hi!

 

Just to add something her; we have developed a workflow that pulls down and saves all assets to a share drive, the workflow is attached and uses the API that @danilang is outlining.

 

Something to note is that assets may download as .yxzp files because when published the user checked the option to include assets, therefor you will need to create a script which unpackages each of these (well at least we do).

 

We then use the conditional runner tool (part of the CReW macro pack) to then run a workflow which pulls all files out of the direcory and scans the XML for comment boxes.

 

I've also attached the script (I've had to change the extension to .txt rather than .bat because I could not attach that) that we trigger once the workflow is ran to unzip the files using the events tab.

 

clipboard_image_0.png

obridgeman
7 - Meteor

Thanks for that Ben,

 

what version of Alteryx is that created in as the latest version I have access to is 2018.4 and I can't open it.

 

Thanks,

 

Oli

danilang
19 - Altair
19 - Altair

Hi @obridgeman 

 

Edit the .yxmd file and any included macros directly in a text editor and change the second lines to <AlteryxDocument yxmdVer="2018.4"> and you should be good to go

 

Dan

obridgeman
7 - Meteor

Thanks for all your help dan, is the percent encoder macro a CREW Macro? That's the error I am stuck with at the moment as can't find 'Percent_Encoder.yxmc'.

 

Thanks,

 

Oli

Labels