Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Server Discussions

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

Is it possible to enforce mandatory parameter (interface tool) passing for API calls?

Spawn66689
5 - Atom

I have been using Alteryx Designer/Server for sometime with clients manually logging into to the server front end to run workflows. 

 

We now have a new client who wants to leverage the Gallery API to programmatically execute workflows / retrieve result sets. The workflow in question takes a number of parameters (interface tools) to request things like the Project IDs, last run times etc and which the client can happily incorporate into their API calls. This is all setup and working when running the report manually via the Server front end.

 

Their recent request is for us to throw an error should they submit a call WITHOUT providing one of the parameters (e,g. not passing ProjectiD). In my workflow I check for the number of project IDs (using a formula tool to parse comma separated lists) and then, should it be empty / 0, use an error tool to output a related error.

 

This is all well and good from the front end however when using the API this requires the client to make a call to https://{MyURL}/api/v1/workflows/{appID}/jobs to first start the job running and then to place a call to the actual jobid (e.g. https://{MyURL}/api/v1/workflows/{JobID} in order to understand as to whether there was an error or not.


Tl;dr - Is it possible in the initial call to https://{MyURL}/api/v1/workflows/{appID}/jobs to enforce / check for "mandatory" parameters (interface tool) and respond accordingly WITHOUT having to place a follow up call to the actual JobID

 

It is important to note that currently we are using Alteryx 2018 but are looking to upgrade to a later version asap, if this is a newer feature it could be further justification for the upgrade.

 

Thank you for your time,

Kieron

2 REPLIES 2
apathetichell
18 - Pollux

I don't know if anyone has a better way then this - but my take would be to turn the original workflow into a macro - and then do the check for parameters in the outerworkflow. Macro would only launch if the parameters are present - and otherwise would throw an error message.

Spawn66689
5 - Atom

Thank you for the prompt response.

 

Whilst I will definitely consider such an approach in the future for general development, If I have understood your suggested implementation correctly, unfortunately I'm not sure that this would solve the issue I'm trying to address here as i believe the order of action would still be:

 

1) User places a call to the gallery to schedule the outer workflow : /v1/workflows/{appId}/jobs/)

2) User places a call to the gallery to check the run / error status of the job (i.e the fact the macro errored) : /v1/jobs/{jobId}/

 

When what i am trying to solution would instead look something like

 

1) User places a call to the gallery to schedule the outer workflow (with parameters) : /v1/workflows/{appId}/jobs/). Parameter list in incomplete and so instead of a 200 response the response to this first call would be an error response indicating that the parameter list was incomplete

 

i appreciate that required workflow parameters may not be visible to alteryx server at the point the job is scheduled (its only when its "run" that parameters are checked/become visible) and this would therefore constitute a new feature request. I just wondered if later versions (i couldnt see anything obvious in documentation) supported this OR if anyone had faced similar issues and had developed some "hacks" to achieve the same behaviour