Module 7: Workflows with Logic
Merge Node (Combine Paths)
Capsule overview
After branching with IF or Switch, sometimes you need to join the branches back together. For example: you separated leads by priority (high/medium/low), processed each branch differently, and now you want a single final report with all the processed leads. Or you took 2 different sources (a customer Sheet + an orders API), and you want to combine the information by a common ID.
The Merge node does that: it joins data streams from multiple inputs into one. But it has several modes (Append, Combine, Multiplex, Wait) and choosing the right one is what separates a useful Merge from a confusing one. It's one of the most versatile nodes in n8n, and also one of the most confusing at first.
In this capsule you'll learn the 4 Merge modes, when to use each one with concrete examples, and the most common confusion (why do items get duplicated / disappear / mix up strangely?).
What you'll learn
By the end of this capsule you'll be able to:
- ✅ Distinguish the 4 modes of Merge: Append, Combine, Multiplex, Wait
- ✅ Know when to use each mode with real examples
- ✅ Configure Merge in Combine mode (the most useful, similar to a SQL JOIN)
- ✅ Connect multiple inputs to the Merge
- ✅ Avoid the "duplicated/lost items" confusion that happens with a badly configured Merge
Mental model: the confluence of rivers
Merge is the point where 2 rivers join. Before, water was running along two separate paths; afterward there's a single river. What changes is how the data is combined at that point. Do they add up one after the other (Append)? Do they mix by a common field (Combine)? Do they multiply with each other (Multiplex)? Do you wait for both to arrive before continuing (Wait)?
Each Merge mode answers a different question. Here are the 4.
Mode 1: Append (concatenate)
What it does
It places the items from Input 1 followed by those from Input 2. Simple concatenation.
If Input 1 has [A, B, C] and Input 2 has [D, E]:
- Output:
[A, B, C, D, E]
When to use it
- You want to join lists that aren't related to each other
- You combine results from 2 different searches (e.g. leads from the Sheet + leads from the CRM, without needing to match IDs)
- You want a combined report from different sources
Example
[Sheet with leads] ──┐
├─→ [Merge: Append] → [Slack: send to #leads]
[CRM with leads] ──┘
Result: all the leads (from both sources) reach the Slack.
What it does NOT do
- It doesn't deduplicate. If a lead appears in both sources, it goes twice.
- It doesn't join fields. If an item in Input 1 has the fields
name, emailand another in Input 2 hasname, phone, the output keeps each item with its original fields — it doesn't join them.
Mode 2: Combine (the most useful — SQL JOIN)
What it does
It joins items from Input 1 and Input 2 that share a common field. Equivalent to SQL's JOIN.
If Input 1 is:
[{ id: 1, name: "Mike" }, { id: 2, name: "Ana" }]
And Input 2 is:
[{ id: 1, phone: "555-1234" }, { id: 3, phone: "555-5678" }]
Combining by id:
[{ id: 1, name: "Mike", phone: "555-1234" }, ...]
Sub-modes of Combine
n8n has several Combine variants that correspond to the JOIN types:
Sub-mode: Merge by Matching Fields (Inner Join)
It only keeps the items that match in both inputs.
Result of the example: only id: 1 (Mike + his phone). id: 2 (Ana without a phone) and id: 3 (a phone without a name) are discarded.
When: you only want the complete data.
Sub-mode: Keep Matches Only
Equivalent to the previous one.
Sub-mode: Keep Non-Matches Only
Only those that do NOT match in the other input. Useful for finding differences (e.g.: "leads in the CRM that aren't in the Sheet").
Sub-mode: Enrich (Left Join)
It keeps all the items from Input 1, adds data from Input 2 if there's a match. If there's no match, the Input 2 fields come as undefined.
Result of the example: Mike with a phone, Ana without a phone (Input 2 fields empty).
When: you want to keep all the data from the main flow even if auxiliary data is missing.
How to configure Combine
- Mode:
Combine - Combination Mode:
Merge By Fields(or the sub-mode you want) - Fields to Match:
- Input 1 Field:
id - Input 2 Field:
id(They can be different names if the IDs come aslead_idin one andidin the other.)
- Input 1 Field:
Mode 3: Multiplex (Cartesian product — use with care)
What it does
It combines each item of Input 1 with each item of Input 2. If Input 1 has 3 items and Input 2 has 4, the output has 12 items.
When to use it
- Generate combinations (e.g. send email × each template)
- Very specific cases where you need to iterate over combinations
When NOT to use it
- Almost never do you need it in typical workflows
- If you activate it by accident, the items multiply and the workflow takes a long time
Mode 4: Wait (wait for both inputs)
What it does
It waits for both inputs to arrive before continuing. It doesn't combine data — it only synchronizes.
When to use it
- You have 2 parallel branches: one calls API A, the other API B
- You need both to finish before proceeding
- The data stays separate (it isn't merged), but the flow waits
[Trigger] ─┬─→ [API A] ─┐
│ ├─→ [Merge: Wait] → [Process (with both available)]
└─→ [API B] ─┘
Common confusions
Confusion 1: "I expected 10 items and saw 50"
Cause: you're in Multiplex mode without meaning to. The items multiplied between the 2 inputs.
Fix: switch to Combine or Append.
Confusion 2: "The items got duplicated"
Cause: you're in Append mode and the data came in both inputs.
Fix: use Combine with a unique field to deduplicate.
Confusion 3: "Items are missing"
Cause: you're in Combine mode, Inner Join sub-mode, and the items that don't match in the other input are discarded.
Fix: switch to the Enrich sub-mode (keeps all from Input 1).
Confusion 4: "The fields didn't join"
Cause: you're in Append mode. Append concatenates items, it doesn't merge fields.
Fix: use Combine with Merge By Fields.
When NOT to use Merge (alternatives)
Sometimes what you think needs a Merge is better solved with another node:
If you only want to concatenate 2 lists, you already had 1 path
Sometimes you can avoid Merge if you redesign the workflow to have a single input. For example: if your Sheet has a column that identifies the origin, you don't need 2 merged reading nodes — use 1 node with a filter.
If you want to "join info" but the data doesn't share a common field
Maybe it's not Merge — maybe it's an HTTP Request calling another API with the ID you already have.
If you want to "wait for something to finish"
Wait mode exists, but you can also use a sequential structure if no real parallelism is needed.
Realistic example: enrich leads with CRM info
The problem
You have:
- A Sheet with leads (id, name, email)
- A CRM API that has extra data (id, source, score)
You want a Slack with all the leads + their CRM data, where there's a match.
The workflow
┌─→ [Sheets: leads] ──────┐
[Manual Trigger]│ ├─→ [Merge: Combine by id, sub-mode Enrich] → [Slack]
└─→ [HTTP Request: CRM] ──┘
Merge configuration
- Mode:
Combine - Combination Mode:
Merge By Fields - Sub-mode:
Enrich Input 1(keep all the leads from the Sheet, add CRM data if there's a match) - Input 1 Field:
id - Input 2 Field:
id
Output
For each lead:
{
"id": 1,
"name": "Mike",
"email": "mike@nieva.team",
"source": "LinkedIn",
"score": 87
}
If the CRM didn't have data for the lead, source and score come as undefined.
Traps and common mistakes
Trap 1: Assuming input order
What happens: You configure Merge expecting Input 1 to be the Sheets one and Input 2 to be the API one. But you connected them backwards. The "Enrich Input 1" sub-mode keeps the wrong data.
How to avoid it:
- In the Merge editor, Input 1 and Input 2 are labeled visually
- Verify which node is connected to each input
- If needed, swap the connections
Trap 2: Comparing fields with different names
What happens: Sheets has id, the API has userId. Your Combine looks for a match by id in both — it finds nothing, everything is discarded.
How to avoid it: Combine in n8n lets you map different fields:
- Input 1 Field:
id - Input 2 Field:
userId
Trap 3: Different types in the match field
What happens: Sheets returns id: "1" (string), the API returns id: 1 (number). It doesn't match.
How to avoid it: Before the Merge, use a Set node to standardize the types:
{{ Number($json.id) }}or{{ String($json.id) }}
Trap 4: Merge before having output in both inputs
What happens: You're testing with Execute step on Merge but only ran one of the previous nodes. The other input is empty. Merge has nothing to combine.
How to avoid it: Execute previous nodes first so both inputs have data.
Exercise: enrich leads with auxiliary data
Goal: practice Combine in a typical case.
Your task
- In your
Leads n8nSheet, add a new sheetScoringwith columnsEmailandScore(assign scores 1-100 to a few emails from the first sheet) - In your workflow:
- Manual Trigger
- Node 1: Google Sheets → read sheet
Sheet1(leads) - Node 2 (parallel): Google Sheets → read sheet
Scoring - Merge node:
- Mode: Combine
- Sub-mode: Enrich Input 1
- Match by: Input 1 =
Email, Input 2 =Email
- Slack: send a message with the name, email, and score (if it has one)
- Run it
Verify
- Leads that are in both sheets receive a message with a score
- Leads that are only in
Sheet1receive a message with an undefined score (manageable with an expression fallback)
Variant
Change the sub-mode to "Inner Join" (Keep Matches Only) — only leads that have an assigned score should arrive.
Summary and next step
- Merge node: combines items from multiple inputs
- 4 modes:
- Append: concatenates (list after list)
- Combine: joins by a common field (like SQL JOIN) — several sub-modes (Inner, Enrich, Keep Non-Matches)
- Multiplex: Cartesian product (rare, use with care)
- Wait: waits for both inputs before continuing (without combining data)
- Combine is the most useful — 80% of cases
- Typical confusions: duplicated items (duplicate Append), missing ones (Inner Join discarding), fields not joining (Append instead of Combine)
- Before Merge, verify that the fields to match have the same type (string vs number)
Before moving on you should be able to:
- Distinguish the 4 modes and know when to use each
- Configure Combine with Match Fields
- Diagnose "duplicated/lost items" after a Merge
What's next (capsule 05):
You've seen IF, Switch, and Merge. All 3 move data. Capsule 05 teaches you Set — the node for transforming and creating data at any point in the workflow. Although it's not strictly "logic", it's essential: many IF/Switch decisions depend on derived fields that you first have to create with Set.
Additional resources
- Merge Node Documentation - Official reference.
- SQL JOIN Visual Reference - If you want to go deeper into INNER/LEFT/RIGHT.
- n8n Merge Patterns - Common use cases.
Created: May 11, 2026 Version: 1.0