Skip to main content
Solved

how to loop with http caller?


dataninja
Forum|alt.badge.img

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!

Best answer by erik_jan

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.

View original
Did this help you find an answer to your question?

8 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • Best Answer
  • October 3, 2019

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.


dataninja
Forum|alt.badge.img
  • Author
  • October 3, 2019
erik_jan wrote:

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?


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • October 3, 2019
dataninja wrote:

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.


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • October 3, 2019
erik_jan wrote:

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:


Forum|alt.badge.img
  • October 4, 2019

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.


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
mileslee wrote:

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


mgg_beca
Contributor
Forum|alt.badge.img+11
  • Contributor
  • September 13, 2023
virtualcitymatt wrote:

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?


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
virtualcitymatt wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings