Skip to main content
Solved

how to loop with http caller?

  • October 3, 2019
  • 8 replies
  • 784 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • 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

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+22
  • Contributor
  • October 3, 2019

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+22
  • Contributor
  • 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.

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+47

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
Supporter
Forum|alt.badge.img+16
  • Supporter
  • September 13, 2023

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+47

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