Loop a workflow block

  • Goal: For example if a resource query api call does not have the desired status, lets say the api returned a "still working status" I'd want to re-run the block after N seconds. How can I easily do this?

  • Steps: I've tried re-triggering the block using code but it seems thats not supported

  • Details: n/a

  • Screenshots: n/a

Hello! Welcome to the forums!

If you make your API call a function, you can loop through your requests (with a JS Code setup triggering the function instead) and process the results with filter nodes.

The filter would check for still working status in the response and then re-call the function again or trigger the same workflow recursively. In either case, you could delay sending the filtered items for reprocessing with a sleep() timer or other mechanism to throttle the speed.

1 Like