Workflow steps

merge

type: "merge"

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

free2 inputs at least1 output at most
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

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

The two rules

RuleWhy
At least two incoming edgesMerging one thing is not merging.
At most one next outA merge is a junction, not another fan-out.

Its output is a marker

{{steps.join.output.merged}}   // true
"{{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

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

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.