Sunday, June 29, 2025

Tip #3: Retry/delay more than 5 seconds/5 tries

Usually you can add retry/delay for any node in n8n workflow. It can be done in node Settings tab:

Using standard retry/delay approach in n8n

But 5000 ms or 5 s is the maximum value for delay and max tries value is limited to 5. And you sometimes need more. For example, some APIs has throttling and you want to wait 1 minutes before next try. In this case you need some another approach.

Let's start with Set node and define our initial parameters for retry/delay:

Setting initial retry/delay parameters in n8n

After that we add some target node which we want to apply retry/delay approach to - in this example it's HTTP Request node:

Adding target node for custom retry/delay approach in n8n

It should be configured to continue on error using error output:

Configuring target node to continue on error using error output in n8n

Then add another Set node to error output, it will decrement tries number:

Adding another Set node to decrement tries number in n8n

After that we just need to add If node to check if we still have tries remaining:

Checking if we still have tries remaining in retry/delay custom approach in n8n

And finally add Wait node to False output of If node and connect to input of target node:

Adding Wait node to False output of If node and connecting to input of target node in n8n

Don't forget to change Wait Amount to our value from Set node:

Setting Wait Amount to custom value in n8n

True output of If node is active when error still happens after all tries. So it can be connected with some fallback or Stop And Error node. And Success output of target node is active when one of the tries is successful and we get the data.

We can also increment delay for the next try by some fixed amount or exponentially.

Let's check this approach by executing our example workflow:

Testing retry/delay custom approach in n8n

You can see that target node was called exactly 6 times as we specified in the first Set node.

You can find the template for the described approach here.

No comments:

Post a Comment