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 Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Waiting until API is finished

chrisha
11 - Bolide

In my workflow I'd like to send the datastream to a server with a REST API to process and further analyze the data. Since the processing can take quite a while, the API does not directly send back the results, but only a job ID. Manually, I would check a different endpoint where I receive the current status until the status is "finished" and then go to a third endpoint where I get the final results of the analysis. So, I have three different API endpoints I use to send the data, check the status and receive the results.

 

My first setup would include two workflows: The first one prepares and aggregates the data and sends it to the server. The second is started when I know that the analysis has finished and only fetches the results back from the server.

 

However, I'd rather have only one workflow which I start, which sends the data to the server, and waits until the results are finished and further processes the results. Unfortunately, Alteryx does not support any kind of loop as far as I know. Is there any macro or workaround I could use? I'd like to go without Python as the workflow is run on a different machine that will not have Python installed.

8 REPLIES 8
mborriero
11 - Bolide

How about to create an iterative macro for the the first workflow, then insert your macro at the beginning of the second process?

 

https://help.alteryx.com/9.5/IterativeMacro.htm

chrisha
11 - Bolide

I'm not entirely sure if understand your suggestion correctly. An iterative macro is a macro that is run for each row of the data stream, no? As I need the complete data-set on the server, I cannot send it row-by-row. So in the end, I'm not sure how this helps me to proceed only if the server has finished its work. Maybe I'm getting it wrong, so could you elaborate?

mborriero
11 - Bolide

I see your point now. What is the input of the second workflow? Can you use a BLOCK UNTIL DONE tool like the picture below?

The tool will process the first part of the workflow until finished, then continue with the rest of the workflow.

Capture.JPG

 

 

 

 

KaneG
Alteryx Alumni (Retired)

Why not send the data with a download tool, then use an iterative macro (will keep going until nothing on the iteration output or hits max runs) to test whether it's complete (with a throttle of course), then another Download tool to get the results.

 

Screenshot below. Not attached as it's not a real module.

 

Check_for_results.png

chrisha
11 - Bolide

Thank you, Kane. I didn't realize that I can use the Iterative Macro to keep going until a condition is met (here: data on the Iterative output). Was a lot easier and less hack-ish than I thought.

Jayordan
7 - Meteor

How did you pass the payload for the download tool into the iterative macro?

chrisha
11 - Bolide

Simply through the input of the iterative macro. You can pass all relevant data to the iterative macro you need. Just make sure that everything that belongs to one call is in the same row.

Jayordan
7 - Meteor

So when I add the "wait a sec" macro, it doesn't pass anything from the input past it -- it's not available to the download.

How did you get around this?

Labels