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 Server Discussions

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

Alteryx Workflow called via Server API with Runner Tool Not Working

chrisecoyne
6 - Meteoroid

Hello everyone!

 

I have been playing around with the Alteryx Gallery API recently trying to get a workflow running. The general idea behind the workflow is that the program calling the workflow via server API passes through a key/subject, web url to a file, and filename. I use the url and filename with the download tool to automatically save the file to my local system. However, I have a sub-process that I want to run that actually uses this saved file. For this, I use a reference data file that links a key/subject and the path to a specific workflow. Then, I join this ref data to the key/url passed in via api to find the workflow I want. I modified the crew runner tool to take in an input, so I pass the workflow path to the runner tool and it runs....and it works perfectly fine when I run the analytic app locally. When I try to test this on the server via api, the file gets saved, but the runner tool does not seem to work..Any suggestions?? Thank you!

4 REPLIES 4
ScottG
Alteryx Alumni (Retired)

The CReW Runner macros are supported in Alteryx Designer but not on Alteryx Server.

 

The workflows that you want to run on Server should be published (saved) to the Server itself.   After that you can call those workflows using the Server REST API.

 

It's not clear to me how the "key/subject" is being used, however, if this is needed by the workflow itself, then convert the workflow to an Analytic App and pass the key/subject as an App value using the API values parameter using the /v1/workflows/{appId}/jobs/ endpoint.

Scott Gurney
Strategic Sales Engineer
Alteryx, Inc.
chrisecoyne
6 - Meteoroid

Thanks for the response. The main workflow is being triggered using the server gallery REST API. This is an analytic app with 3 questions (subject, filename, attachmentURL. The workflow then runs and using the filename and attachment URL the download saves the file to my computer. I want to run a workflow off the back of this using the newly saved file. Depending on the subject passed in, the workflow I want to run after varies. I input a reference data file that chooses the correct workflow based on the subject and then tried passing this into the runner tool (which isn't working on server). 

 

Can I utilize the REST API within a workflow to trigger another workflow that takes in dynamic parameters (i.e pass it the correct App ID rather than passing the runner the workflow path?

 

Also, realized the download tool works locally and on the server as an analytical app; however, when I trigger the same app via the Rest API, it returns an error:

{ "status": 3, "text": "Error Opening file: \\\\samplepath\\xxx\\xxx\\xxx\\xxx\\xxx\\XXX\\Output Folder\\Sub Folder\\\n: The filename, directory name, or volume label syntax is incorrect. (123)", "toolId": 64 }

Somehow the path is getting messed up only when triggered by the API?

 

ScottG
Alteryx Alumni (Retired)

Yes.  You can have a workflow, that you are calling via the API, that in turn using the Download Tool calls another (dynamically-chosen) workflow via the API.  The AppID will be part of the URL you use in the Download Tool.

 

Regarding the path error, that is not something I have seen before (that only happens via the API).  I suggest opening a ticket with Alteryx Support.

 

 

Scott Gurney
Strategic Sales Engineer
Alteryx, Inc.
chrisecoyne
6 - Meteoroid

Thanks a lot for the help!