Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.
SOLVED

Build an Alteryx workflow (running on an Alteryx Server) and serve RESTful API?

hamdylie
7 - Meteor

Dear All,

 

Is it possible to setup an Alteryx workflow (running on an Alteryx Server) to provide RESTful API communication with a client to retrieve and update data? Below is rough flow:

rest api - alteryx.png

1. A Client App (CA) calls the Alteryx workflow (AW) to retrieve some data from a database.

2. WA retrieves the data and passes back to CA

3. CA updates the data, e.g. calculate and generate additional data/fields

4. CA calls WA to update the database (with the additional data)

 

Or maybe some of you have better system design?

 

Thanks.

 

1 REPLY 1
jdunkerley79
ACE Emeritus
ACE Emeritus

 Yes, if I am reading your post correctly it is possible.

 

The Alteryx Server has a REST API but it may need to be switched on to use it. If it is switched on you should be able to get an API Key and Secret from the Keys section of the Account page.

 

You can then use the API to get a workflow, get the questions then run it and finally poll its status and then fetch its output.

 

The sequence would be something like:

1. GET a list of all the workflows from /v1/workflows/subscription/

2. For the specific workflow get the id the call GET /v1/workflows/{appId}/questions/. This will give you a JSON structure of questions

3. Build a set of answers to the questions in JSON and POST to /v1/workflows/{appId}/jobs/. This will queue the job and return a job id

4. Poll the job status by calling /v1/jobs/{jobId}/ and wait for completion of failure

5. You can then finally call /v1/jobs/{jobId}/output/{outputId}/ to retrieve the output

 

Documentation and sample C# and JS applications are on https://gallery.alteryx.com/api-docs/

 

Hope it is enough to get you started