Alteryx Server Discussions

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

How to add to "output" in POST /v1/workflows/{appId}/jobs endpoint

mnaqvi
6 - Meteoroid

The POST /v1/workflows/{appId}/jobs  endpoint returns a "output" in the response body. Can we output something here from a workflow, or can we only get output from a job in the GET /v1/jobs/{id}/output/{outputId} endpoint?  

9 REPLIES 9
TimN
13 - Pulsar

The POST /v1/workflows/{appId}/jobs will queue the Alteryx Workflow on the Server.  The {appId} is the ID of the workflow you want to run.  so a simple one would be to run a workflow that outputs a file to a server location.  To get the app ID of the WF, you can go into Private Studio (I'm on Alteryx server 2021.3) and open the Workflow.  The app ID id in the URL.  If you want to work with the output using the other api endpoints you can do that too.

 

 

TimN_1-1668114533072.png

 

mnaqvi
6 - Meteoroid

Thanks @TimeN, but i'm asking about the "output" field in the POST request. How can I return something in that field as the job gets queued? I'm starting to think no matter how fast the response is from the workflow, we'd need to get the ouput from the GET /v1/jobs/{id}/output/{outputId} endpoint. 

TimN
13 - Pulsar

The Post returns the job ID.  Use the job ID in  /v1/jobs/{jobId}/ endpoint.

 

Post Return:

TimN_0-1668115445703.png

 

mnaqvi
6 - Meteoroid

Thanks - I understand that. What I'm referring to is the "outputs": field in your screenshot. Can I output something there instead, instead of making the 2nd and 3rd call to the jobID endpoints

TimN
13 - Pulsar

Jobs returns

TimN_0-1668115740107.png

 

From there you can look at the output endpoint

TimN
13 - Pulsar

my example, I can write the output to a directory and forgo messing with the output endpoint.  Here's more details if you need them.

 

https://documenter.getpostman.com/view/14766220/TzeUmTWD

mnaqvi
6 - Meteoroid

Yup - thats one way to go about it. Wondering if someone can chime in on the actual ' "outputs": [], ' field in the POST response 

TimN
13 - Pulsar

just looked at your screen shot.  You have no outputs because of how the called Alteryx workflow is set up.  When you implement the workflow to the server include the outputs (under Manage Workflow assests)

 

TimN_0-1668117790141.png

 

TimN_1-1668117956163.png

 

 

mnaqvi
6 - Meteoroid

Hey Tim, i get output on the final call to the jobs endpoint, not the original POST though.

mnaqvi_0-1668122082465.png