# merge

Canonical URL: https://developers.iagenify.com/sdk/workflows/steps/merge/
Language: en

`type: "merge"`

Brings branches back together. At least two inputs, at most one output — and it computes nothing.

Status: free · 2 inputs at least · 1 output at most

```javascript
edges: [
  { from: "fetch_a", to: "join" },
  { from: "fetch_b", to: "join" },
  { from: "join", to: "write" },
]
```

## The two rules {#rules}

| Rule | Why |
| --- | --- |
| At least two incoming edges | Merging one thing is not merging. |
| At most one `next` out | A merge is a junction, not another fan-out. |

## Its output is a marker {#output}

```javascript
{{steps.join.output.merged}}   // true
```

> **Read the branches, not the merge**
>
> It does not gather anything. Steps after it read the upstream steps directly — {{steps.fetch_a.output.…}} — which is why it carries nothing but a marker.

## It is how a fan-out ends {#parallel}

Several edges from one step on the same branch run in parallel; a merge is where they come back to one path. Without it each branch would end on its own.

## After a condition, mind what exists {#branches}

A branch not taken leaves its steps unrun, so a template reading one of them reads nothing. For a value available either way, compute it before the split or after the merge from a step both paths passed through.

- [Edges and branches](/sdk/workflows/edges): The graph rules.
- [condition](/sdk/workflows/steps/condition): Where a split starts.
- [Workflow steps](/sdk/workflows/steps): The 23 types.

```python
edges = [
    {"from": "fetch_a", "to": "join"},
    {"from": "fetch_b", "to": "join"},
    {"from": "join", "to": "write"},
]
```

```python
"{{steps.join.output.merged}}"   # True
```
