Parallel Workflow

Hi Team
I have a simple workflow where i am trying to avoid parallel run of my workflow.
eg. If my workflow executes every 5 mins and my execute command node takes 10 mins to complete, i don’t want the next execution to start unless my previous one gets completed.
Is there a possibility like this in N8N?

Regards
Siddu

Hey @Siddu,

For now the best option I can think of would be to set an “isRunning” option either in a database or as a local file and check to see if it exists at the start of a workflow and create it if it doesn’t and remove it at the end.

There’s actually a way.
Here’s how I do it.

It consists of two workflows:
One workflow that Activate / Desactivate another workflow like this

Make sure to replace the domain “yourdomain.com” by your actual instance domain on the url in the nodes named “Get n8n JWT”, “Get workflow”, “Deactivate” and “Activate”.

and the second workflow where you would have to replace the Set node named “Your workflow here” by your whole workflow.

Then all you gotta do is:

  • replace the 777 by the workflowID of your workflow in the nodes named “Desactivate workflow” and “Activate workflow”
  • replace the 220 by the workflowID of the workflow that Activate/Desactivate other workflows in the nodes named “Execute Workflow” and “Execute Workflow1”

Hope it helps.
I’m not sure I can be more specific ahah.

1 Like

@TheFSilver that is pretty cool and a good solution for a scheduled workflow, Nice work.

Thanks @Jon
I used that thread and built it on top of it.

1 Like