# Prevent concurrent workflow runs with Redis: n8n workflow

> Started by an event in a connected app, and works across Redis. 31 steps, 5 branches, 4 loops or waits: large, and worth reading before you trust it with...

Source: https://millionrounds.com/workflow/prevent-concurrent-workflow-runs-with-redis (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Integrations](https://millionrounds.com/workflows?category=Integrations#library)

# Prevent concurrent workflow runs with Redis

Started by an event in a connected app, and works across Redis. 31 steps, 5 branches, 4 loops or waits: large, and worth reading before you trust it with anything live.

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fprevent-concurrent-workflow-runs-with-redis)

**31 steps** Large: read it before trusting it with anything live

**5** Branches: places the flow splits

**4** Loops or waits

**1** Service it connects to

## The flow

Starts it 2 Logic 26 Service 3

The steps in the order they run, from what starts it.

- 1 **When Executed by Another Workflow** Execute Workflow trigger *Starts it*
- 2 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 3 **Is Workflow Active** Execute Workflow *Logic*
- 4 **Set Workflow Active** Execute Workflow *Logic*
- 5 **Set Workflow Finished** Execute Workflow *Logic*
- 6 **Is Workflow Active1** Execute Workflow *Logic*
- 7 **Is Workflow Active2** Execute Workflow *Logic*
- 8 **Is Workflow Active3** Execute Workflow *Logic*
- 9 **Set Timeout** Set *Logic*
- 10 **If2** If *Logic*
- 11 **If** If *Logic*
- 12 **If1** If *Logic*
- 13 **Switch1** Switch *Logic*
- 14 **Switch** Switch *Logic*
- 15 **Set Workflow Active1** Execute Workflow *Logic*
- 16 **Stop and Error** Stop And Error *Logic*
- 17 **Set Workflow "started"** Execute Workflow *Logic*
- 18 **Stop and Error1** Stop And Error *Logic*
- 19 **Get Key** Redis *Service*
- 20 **Set Key** Redis *Service*
- 21 **UnSet Key** Redis *Service*
- 22 **No Operation, do nothing** No Op *Logic*
- 23 **Wait1** Wait *Logic*
- 24 **set continue** Set *Logic*
- 25 **Wait** Wait *Logic*
- 26 **Set Workflow "loading"** Execute Workflow *Logic*
- 27 **Set Workflow Finished1** Execute Workflow *Logic*
- 28 **Wait2** Wait *Logic*
- 29 **Set Workflow "finishing"** Execute Workflow *Logic*
- 30 **Wait3** Wait *Logic*
- 31 **Set Workflow Finished2** Execute Workflow *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 31, with 5 branches, 4 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Redis
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own Redis account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 31 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 31 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fprevent-concurrent-workflow-runs-with-redis)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Redis](https://millionrounds.com/workflows?service=Redis#library)

## Workflows like it

Also integrations, with the same services where possible, closest in size first.

- [**Message buffer system with Redis** 27 steps · Redis](https://millionrounds.com/workflow/message-buffer-system-with-redis)
- [**Create a self-contained CRUD app with Redis and HTML** 19 steps · Redis](https://millionrounds.com/workflow/create-a-self-contained-crud-app-with-redis-and-html)
- [**Route API traffic with Stripe RBAC and Redis** 17 steps · Redis](https://millionrounds.com/workflow/route-api-traffic-with-stripe-rbac-and-redis)
- [**Batch process data with Redis** 15 steps · Redis](https://millionrounds.com/workflow/batch-process-data-with-redis)
- [**Redis locking for concurrent task handling** 14 steps · Redis](https://millionrounds.com/workflow/redis-locking-for-concurrent-task-handling)
- [**Building a consistent storytelling AI on autopilot with Redis** 11 steps · Redis](https://millionrounds.com/workflow/building-a-consistent-storytelling-ai-on-autopilot-with-redi)
