N8n workflow stopping repeatly

Hi everyone,

I’m running into an issue with workflows getting stopped, mostly because the Google Sheets node throws a “Too many requests” error. When that happens, the workflow just fails and doesn’t continue.

My idea is to build something that regularly checks whether a workflow is still running or has failed, and if it failed, automatically restart it.

I already thought about using a Schedule Trigger (e.g. every 8 hours), but the problem is:
sometimes the workflow is still running, and then it starts a second time, which I want to avoid.

So my questions are:

  • Is there a good pattern in n8n to detect whether a workflow is currently running?

  • How do you handle auto-retries or auto-restarts without creating duplicates?

  • Is there any other recommended way?

Any best practices or example setups would be really appreciated :folded_hands:
Thanks in advance!

Hey @Luca2 !

I would rather use “Retry on fail” with the nodes in Settings, … or set batching and interval time(since I think 1 request per second for Sheets)… or use RabbitMQ for your internal “queueing”…

There are so many ways to handle this, instead overkill with “watching “ a workflow…

Here anyway a similar post that is exact your issue:

Cheers!

1 Like

Hi,

  1. Did you check if you are hitting Google API rate limit? Is your workflow using loops to send API requests.
  2. If Yes, then you can use: “Continue On Fail” feature and add a wait node to retry after some time.

Thanks,

Vishal

Hi @Luca2,

on top of @Parintele_Damaskin recommended suggestion of using the retry setting on the failing node which is the best option in most cases, you can also create an error workflow and point your workflows to it in the settings. Then on workflow error, you can build some logic to see whether the error was transient (temporary due to network drop or system unavailability) or not and then decide to restart the workflow or report the error via email so you can further dissect the problem.

In the error workflow use this node:

A few caveats of this approach is that this will likely not work for everything and a bit of a spit and paste solution for special cases. You’ll also need to add a “When Executed by Another Workflow” trigger to the workflow you need to restart as there is no other way to reboot a workflow as far as I know.

1 Like

Thank you for your replies!
Is there a way to increase the number of retries in n8n settings? I can only set it to 5 retries and 5000ms between retries. Can I adjust this number and increase it?

Not from what I can see in the config documentation. Perhaps you can build a combination of the suggestions above. First try attempt the retries, if that is not enough, then make use of the error workflow to determine the issue and retry the workflow again