# Merge

> Merge node for synchronizing parallel branches and combining their output variables.

Waits for all incoming parallel branches to complete before passing execution to the next node.

## When to use Merge

Use Merge when you have split execution into genuinely parallel branches (by drawing multiple connections from a single node's output port) and need to continue only after *all* branches finish.

You do not need Merge after a Decision or Switch node — those branches are mutually exclusive, not parallel. They converge naturally without a Merge node.

## Configuration

The Merge node has no configuration fields. It automatically infers the number of incoming branches from the connections on the canvas.

## How it works

As branches complete, the Merge node collects their output variables. When the last branch finishes, Merge activates its single output port. All output variables from all branches are available to downstream nodes.

## Examples

**Parallel API calls that are then combined:**

```
Trigger → [HTTP Request A] → Merge → Script (combine A and B results)
        → [HTTP Request B] ↗
```

The Script node after Merge can reference both `httpRequestA.body` and `httpRequestB.body`.

**Run three enrichment steps in parallel:**

```
Trigger → [Enrich from CRM]     ↘
        → [Enrich from billing]  → Merge → Data Transform (combine all three)
        → [Enrich from support] ↗
```

## Common issues

| Issue | Resolution |
|---|---|
| Two branches produce a variable with the same name | The last branch to complete wins. Rename one of the conflicting output variables to avoid the collision. |
| One branch fails and the Merge never completes | If any incoming branch raises an unhandled error, Merge raises an error and stops waiting for remaining branches. Connect the error handle on failure-prone nodes in each branch so the failure is handled before it reaches the Merge. |
| Using Merge after a Decision node | Branches from a Decision node are mutually exclusive — only one fires. A Merge node after them waits forever for the second branch that never runs. Remove the Merge; the branches re-join implicitly. |

## Notes

- There is no timeout on Merge. If a branch hangs (for example, a Human Task waiting for a response), the Merge waits indefinitely unless you add a timeout to the hanging node.
