I need to re-run the block one more time in 30 seconds if it returns "file": null.
I can use such behavior using error handler, but I don't get an error in response in my case.
So I can see two available options:
- Re-run the block in 30 seconds even if it doesn't return an error
- Set up a delay between two blocks executions like setTimeout() function.
Do you have any ideas how to do that?
What about defining the rest query in a function then calling it within js block? In the js block you can evaluate the response and throw an Error. Then you can setup your retry settings on the js block.
Great idea, matth! Thank you!
Could you drop a line of code how to catch an Error with function? Sorry for maybe a newbie question.
I'm kinda a js newbie but I tried something like this
and logs look good to me. I just had another workflow as my callAPI and that was randomly returning 1 or 2
Great! Thank you! Looks like it is a solution!
Thank you one more time!