Merge
Brings parallel branches back together. Merge is a flow-control step: it waits until every incoming branch has finished (or been skipped) before it runs, then combines two inputs in one of four ways.
Parameters
| Name | Required | Default | Description |
|---|---|---|---|
Mode (mode) | Yes | Append | How to combine the inputs — see Modes. |
Input 1 (input1) | Yes | — | First input, usually an expression such as {{ $nodes['Branch A'].items }}. |
Input 2 (input2) | Yes | — | Second input, e.g. {{ $nodes['Branch B'].items }}. |
Field in input 1 (key1) | Combine by matching field | — | Field (path) to match on in input 1, e.g. id or customer.id. |
Field in input 2 (defaults to the same) (key2) | No | Same as key1 | Field to match on in input 2. |
Keep (joinType) | No | Only matches (inner) | Combine by matching field only. inner: only matched pairs. left: every item of input 1, matched or not. outer: everything from both inputs. |
Include unpaired items (includeUnpaired) | No | false | Combine by position only. When on, the longer input's extra items are kept on their own. |
Modes
| Mode | Value | Result |
|---|---|---|
| Append (input 1 then input 2) | append | All items of input 1 followed by all items of input 2. |
| Combine by matching field | combineByKey | Joins items whose key fields are equal (like a SQL join). Several matches in input 2 produce one row each. |
| Combine by position | combineByPosition | Pairs item 1 with item 1, item 2 with item 2, … Stops at the shorter input unless Include unpaired items is on. |
| Wait for all, output both inputs | waitForAll | Doesn't combine anything; outputs both inputs unchanged as input1 and input2. |
When two items are combined, their fields are merged into one object; if both have the same field, input 2 wins. A value that isn't an object is placed under input1 or input2 instead.
Ports
| Port | Description |
|---|---|
main (input) | Connect every branch that should finish before Merge runs. |
output | { items, count }, or { input1, input2 } in Wait for all mode. |
Output
Combine by matching field, key1 = id, key2 = userId, Keep = inner:
{
"items": [
{ "id": 7, "name": "Ada", "userId": 7, "plan": "pro" }
],
"count": 1
}
Wait for all:
{
"input1": { "status": 200 },
"input2": [ { "id": 1 } ]
}
Example
Fetch users from your app and subscriptions from your billing system in two parallel branches, then attach each user's plan:
- Mode: Combine by matching field
- Input 1:
{{ $nodes['Get Users'].items }} - Input 2:
{{ $nodes['Get Subscriptions'].items }} - Field in input 1:
id - Field in input 2:
userId - Keep: All of input 1 (left) — users without a subscription are kept too.
Notes
- Except in Wait for all mode, both inputs must resolve to arrays (a single value counts as a one-item list; an empty value as an empty list). Stored files must be parsed first.
- Items whose key field is missing are never matched. Input 1 items without a key are still output with left or outer; input 2 items without a key are dropped.
- Keys compare by value and type: the number
7and the text"7"do not match. - If you only need to wait for parallel branches without combining data, Join is simpler.