HTTP request, wait until processing complete then continue

I’m making a request to an AI end point, and I have to trigger the processing of an audio file.

I then have to wait until the processing is complete.

I need to check every 5 seconds (using a get request), to see if the processing is complete.

The get request response will change from “status”: “processing” to “status”: “complete”, once complete.

I can’t figure out how to do this.

I thought a repeater with sleep, but then I don’t know how to stop the repeater. Or maybe a repeater with a router, and some how stop the repeater when “status” changes to "complete.

Any help would be great.

Hi @ali_bean

Please use Break error handler module with required time delay.

MSquare Support
Visit us here
Youtube Channel

1 Like

Thanks @Msquare_Automation

Please could you explain how I would use this?

Since I do not get an error, I get “status”:“processing” when the HTTP request is not ready

Thank you

Hi @ali_bean

To make all other status error, please go to http advance setting and enable Evaluate all states as errors (except for 2xx and 3xx )

Then use break error handler

Further implementation , please connect with us.

MSquare Support
Visit us here
Youtube Channel

1 Like

@Msquare_Automation is not going to work because the HTTP call returns a 2XX not an error. The HTTP call get the file but the status is “processing”.

The repeater is the way to go @ali_bean, you just need to have a “get variable” module before your HTTP module that get the variable “status” and then have a “set variable” module after the HTTP call where you set the status of your file.

This is the basic sequence:

1 Like

Thanks @loic.wiseflow for pointing it. Our bad - I missed it.

@ali_bean You can follow below post to implement it:

2 Likes

Thank you @loic.wiseflow and @Msquare_Automation

This is very helpful!

It’s working but I don’t understand how or why it breaks the repeater.

So it repeats everything after "status is not “completed”, even when status != completed, but that just breaks the loop when status == completed?

Hi @ali_bean,

I am not sure I understand the question, sorry.