Solved

how to loop with http caller?

  • 3 October 2019
  • 8 replies
  • 85 views

Badge

Hi everyone,

 

So basically, my workflow has a httpcaller to make an API call and let's say the call returns a text "yes" or "no" but it takes a while for the call to be completed to return "yes".

That's why I wanna do a for loop to make the request every 5 mins until "yes" is returned.

Please let me know how I can do this or feel free to suggest a better way if possible. Thanks so much!

icon

Best answer by erik_jan 3 October 2019, 20:11

View original

8 replies

Userlevel 2
Badge +12

Yo can create a custom transformer with the HTTPCaller in it.

Then use a Tester to see if the answer is Yes.

If not, add a loop to go back to the HTTPCaller, else go to the output of the Custom transformer.

Hope this helps.

Badge

Yo can create a custom transformer with the HTTPCaller in it.

Then use a Tester to see if the answer is Yes.

If not, add a loop to go back to the HTTPCaller, else go to the output of the Custom transformer.

Hope this helps.

Would having a 5min decelerator before the loop transformer work if i wanna make the request every 5 mins?

Userlevel 2
Badge +12

Would having a 5min decelerator before the loop transformer work if i wanna make the request every 5 mins?

Yes, that would slow down the workspace to test after 5 minutes.

Userlevel 2
Badge +12

Yo can create a custom transformer with the HTTPCaller in it.

Then use a Tester to see if the answer is Yes.

If not, add a loop to go back to the HTTPCaller, else go to the output of the Custom transformer.

Hope this helps.

Would look like this:

Badge

Another thing is that HTTPCALLER is an blocking transformer, you would need to extract your customized transformer as "EMBEDDED" to make it available for looping.

Userlevel 4
Badge +26

Another thing is that HTTPCALLER is an blocking transformer, you would need to extract your customized transformer as "EMBEDDED" to make it available for looping.

Just for anyone finding this later. This comment is no longer true. You just need to set the looping optoins

Badge +2

Just for anyone finding this later. This comment is no longer true. You just need to set the looping optoins

HI @virtualcitymatt​ ,

 

Can you provide a little more detail please?

Userlevel 4
Badge +26

Just for anyone finding this later. This comment is no longer true. You just need to set the looping optoins

ahh sorry for the delay and very poor choice of words -

 

Here's what I meant - If you set this to 1 then it will just make one request at a time. Default is 25 which will wait send requests in parallel - this doesn't work for looping where you want one request per loop.

 

image

Reply