Can I Retry entire workflow on failure of a particular component

I have a workflow that calls an endpoint, the endpoint may throw an error such as "increase batch variables and retry". I have a series of component that increase the batch variables I stored in a google sheet On Failure of the api block

Now after increasing the batch variable, how do I retrigger the entire workflow?
I tried calling startTrigger.trigger() after the increaseBatchVariable block component but this did not work

Hi @Chilaka,

You should be able to achieve this by adding a Workflow block and then passing in your original startTrigger.data as the data.

image

Just choose the workflow you're already in from the Select workflow dropdown.

1 Like

I will try this, thanks
Just curious, if the error keeps throwing "increase batch variables and retry", will cause a loop of retrying

Hi @Chilaka,

It definitely could, so you might want to pass a retry counter along with your workflow parameters, and then check if it has exceeded a certain number, if it has, maybe send an email letting you know it's failed N times so you can investigate further.

2 Likes

It did cause an endless loop when I tested that theory. :grinning: