Can you select a worker tag for a job that is different than the default tag for an app when queueing a job using the Gallery API?
For example:
My permissions are set appropriately
I have an app published to my Gallery called "api_tester" and I have configured the workflow settings to assign a specific worker "primary"
When I run the workflow from the Gallery, I can choose which worker to assign the job even though the default is set as "primary". This is expected.
And it shouldn't surprise anyone that I can run the same app with two separate jobs on different worker tags
Ok now let's jump over to the Gallery API
Here is the app in question. You can see near the bottom that its default worker tag is "primary" because that is what has been chosen in the workflow settings on Gallery
[ { "id": "abcdef", "subscriptionId": "123456", "public": true, "runDisabled": false, "packageType": 0, "uploadDate": "2018-01-08T15:56:16.397Z", "fileName": "API Tester.yxwz", "metaInfo": { "name": "API Tester", "description": "", "author": "", "copyright": "", "url": "", "urlText": "", "outputMessage": "", "noOutputFilesMessage": "" }, "isChained": false, "version": 1, "runCount": 2, "workerTag": "primary" } ]
Ok so let's queue a job for this app. We'll use this endpoint:
/v1/workflows/{appId}/jobs/
Which becomes /v1/workflows/abcdef/jobs/
But wait... That endpoint only needs to pieces of information. The (1) application id and the (2) request body which includes the answers to the app question and the job priority as seen below
{ "questions": [ { "name": "runtime", "value": "1" } ], "priority": "0" }
I don't have the option anywhere to pass a new worker tag when I queue a job so it will always run as the default that is set for the given application identifier. Even though, if I am using the Gallery web interface, I can choose a worker tag prior to a run regardless of the default settings in the workflow.
Am I missing something here or are we not able to choose a worker tag at runtime for a job using the Gallery API?
Edit: Adding a quick note - below response is applicable to Alteryx Server version 2018.4.3 and below.
Great question! I decided to dig into this one a little bit because I was also curious.
Initially, I took a look at our Gallery API documentation and found that there was no mention of the "workerTag" value except in the response data from Alteryx Server. I decided to take matters into my own hands and try to make the request work anyways, just to see if it was something that happened to be missed in a documentation update.
POST data:
{ "questions": { "name": "", "value": "" }, "workerTag": "test", "priority": "0" }
However, it appears that this particular value does not get read by the API, as the response has a distinct lack of value, even when run with a valid tag.
Response to above POST:
{ "id": "5bfc6e53e2758f118c00508e", "appId": null, "createDate": "2018-11-26T22:06:11.6597153Z", "status": "Queued", "disposition": "None", "outputs": [], "messages": [], "priority": 0, "workerTag": "" }
I also confirmed that the workflow did not run on the back-end with the specified tag either, so the API response is correct.
With the above being true, it appears that this feature is not currently supported in the Gallery API which is supported by the documentation, though I think it would make a fantastic addition to our Server Ideas page if you would like to see this feature in the Gallery API in the future! You can find this below:
https://community.alteryx.com/t5/Alteryx-Server-Ideas/idb-p/server-ideas
Let me know if you have any questions on this!
Currently, the Gallery API endpoint POST /v1/workflows/{appId}/jobs/ does not recognize or honor either workerTag or jobName parameters and values. Due to this, these functions are only available through the UI.
While our development team is currently evaluating various improvements to the Gallery API, among those considerations is expanding this endpoint to allow these parameters, there is no current ETA on if or when this particular feature will be added. If you would like to see this particular functionality, I would recommend posting this as an idea on our Server Idea Board! This helps bring the idea and interest directly to our product team's attention.
Hi KylieF
is it supported by latest version of 2020.03?
@michael_treadwell @mgrajkumar @frog
This appears to have been proposed as an Idea here and secondarily here. But it doesn't look as though there's been sufficient interest in it to justify the development of this feature. I strongly encourage you to Like the post and add your use case in the comments.
@lepome , Has this been implemented in the latest version?. Anything you could share on this or any workarounds to achieve this functionality?.
@mgrajkumar
As far as I know, it has not. All I can say at the moment is that I agree it would be a nice feature.