Data & Databases

Prevent concurrent workflow execution using Redis locks

43 nodes 138 89 Automatic trigger
Download

Workflow Description

Automation that blocks multiple simultaneous workflow runs using Redis as a distributed lock mechanism. Checks execution status before starting and halts duplicate attempts, ensuring safe sequential processing for critical operations and data synchronization tasks.

How it works

  1. 1.Check Redis lock status before workflow initiation
  2. 2.Halt new execution attempts if workflow is already running
  3. 3.Set execution flag in Redis upon workflow start
  4. 4.Wait for primary operations to complete
  5. 5.Clear execution flag from Redis upon completion

Use cases

  • Monitor X/Twitter feeds without processing duplicate data
  • Database synchronization operations that cannot run concurrently
  • Scheduled jobs with overlapping execution windows

Requirements

  • Active Redis server connection
  • Twitter/X app credentials configured
  • Understanding of distributed locking patterns

Service Value

Ready-made workflow template for automation delivery and service execution.

Apps Used

Twitter/X Redis

Details

Trigger Automatic trigger
Nodes 43
Apps 2
Views 138
Downloads 89

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (43)

/

When Executed by Another Workflow

Execute Workflow Trigger

#1

Switch

Switch

#2

When clicking ‘Test workflow’

Manual Trigger

#3

If2

If

#4

Sticky Note

Sticky Note

#5

Sticky Note1

Sticky Note

#6

Is Workflow Active

Execute Workflow

#7

Set Workflow Active

Execute Workflow

#8

Sticky Note2

Sticky Note

#9

Set Workflow Finished

Execute Workflow

#10

Sticky Note3

Sticky Note

#11

Get Key

Redis

#12

Set Key

Redis

#13

UnSet Key

Redis

#14

Set Timeout

Set

#15

set continue

Set

#16

If

If

#17

Is Workflow Active1

Execute Workflow

#18

Stop and Error

Stop And Error

#19

No Operation, do nothing

No Op

#20

Set Workflow Active1

Execute Workflow

#21

Set Workflow Finished1

Execute Workflow

#22

Sticky Note4

Sticky Note

#23

Wait

Wait

#24

Sticky Note5

Sticky Note

#25

If1

If

#26

Is Workflow Active2

Execute Workflow

#27

Stop and Error1

Stop And Error

#28

Set Workflow Finished2

Execute Workflow

#29

Sticky Note6

Sticky Note

#30

Wait1

Wait

#31

Sticky Note7

Sticky Note

#32

Wait2

Wait

#33

Wait3

Wait

#34

Set Workflow "started"

Execute Workflow

#35

Sticky Note8

Sticky Note

#36

Sticky Note9

Sticky Note

#37

Set Workflow "finishing"

Execute Workflow

#38

Set Workflow "loading"

Execute Workflow

#39

Is Workflow Active3

Execute Workflow

#40

Switch1

Switch

#41

Sticky Note10

Sticky Note

#42

Sticky Note11

Sticky Note

#43