Reliability issue

Potential merge deadlock in n8n

Why Merge nodes can wait forever for data that never arrives

What is this issue?

A merge deadlock occurs when a Merge node is configured to wait for data from multiple branches, but one or more branches don't execute due to conditional logic (IF, Switch, filters). The Merge node waits indefinitely for input that will never come.

Deadlock scenarios:

  • IF node sends data to branch A, Merge waits for A and B
  • Switch routes to 1 of 3 paths, Merge expects all 3
  • Filter removes all items, downstream Merge never receives input
  • Error branch not taken, but Merge waits for error path

Why is this dangerous?

Workflow hangs forever

Without a timeout, the workflow will wait indefinitely, never completing.

Resource exhaustion

Stuck workflows consume worker slots, potentially blocking other executions.

Data consistency issues

Partial completion means some data is processed while other data isn't.

Hard to diagnose

The workflow appears 'running' with no errors, making the issue hard to spot.

How to fix it

  1. 1

    Use 'Choose Branch' mode

    Configure Merge to proceed when ANY input arrives, not wait for all.

  2. 2

    Ensure all branches execute

    If using 'Wait for All', make sure every input branch always sends data (even empty arrays).

  3. 3

    Add No Op nodes

    In branches that might not execute, add a No Op or Set node that always runs to signal completion.

  4. 4

    Add workflow timeout

    Configure a workflow timeout to prevent infinite waits.

Scan your workflow now

Upload your n8n workflow JSON and detect Merge nodes with potential deadlock conditions.

Scan for reliability issues

Related resources

Related reliability issues