Prevent concurrent workflow runs using Redis
Ready for 3.0What this workflow does
This workflow has 31 nodes and runs when another workflow calls it (plus 1 other trigger). Along the way it connects Redis.
How it runs
Trigger: When another workflow calls it (plus 1 other trigger).
- Set Timeout (Edit Fields (Set)): sets 1 field: timeout
- Switch: routes items into 3 branches
- Get Key (Redis): get
- Set Key (Redis): set
- UnSet Key (Redis): delete
- set continue (Edit Fields (Set)): sets 1 field: ok
- Is Workflow Active (Execute Sub-workflow): calls another n8n workflow
- If: checks a condition and branches into true / false
- Set Workflow "started" (Execute Sub-workflow): calls another n8n workflow
- Stop and Error: stops the run with an error
…plus 18 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (10)
- Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Switch
n8n-nodes-base.switch - Manual Trigger
n8n-nodes-base.manualTrigger - If
n8n-nodes-base.if - Execute Sub-workflow
n8n-nodes-base.executeWorkflow - Redis
n8n-nodes-base.redis - Edit Fields (Set)
n8n-nodes-base.set - Stop and Error
n8n-nodes-base.stopAndError - No Operation, do nothing
n8n-nodes-base.noOp - Wait
n8n-nodes-base.wait
From the author
What does this template do? This workflow sets a small "lock" value in Redis so that only one copy of a long job can run at the same time. If another trigger fires while the job is still busy, the workflow sees the lock, stops early, and throws a clear error.…