Automation Blueprint · ArticlesGet my blueprint

How do I use the Merge node in n8n?

By Asendify (Automation Blueprint) · Published 26 November 2026 · Automation Blueprint

Use the n8n Merge node to bring two streams of items back together. Pick Append to stack them, Combine by Matching Fields to join on a shared value like an email, Combine by Position to pair items by index, or Choose Branch to pass one input through. Matching fields behaves like a database join.

Key takeaways

  • n8n's Merge node docs list the modes: Append, Combine by Matching Fields, Combine by Position, Combine by All Possible Combinations, SQL Query and Choose Branch.
  • Matching Fields has join-style outputs: Keep Matches is an inner join, Enrich Input 1 a left join, Enrich Input 2 a right join, and Keep Everything an outer join.
  • In Position mode, unpaired items are left out by default, and Input 1 takes precedence: with 5 items in Input 1 and 10 in Input 2, only 5 are processed, unless you enable Include Any Unpaired Items.
  • n8n's merging data guide says when a workflow splits, you combine the separate streams back into one, and the Merge node can also combine output from two earlier nodes.
  • n8n's item linking errors page says that in Append mode "each output item still links back to only one input", so referencing a node on the other branch fails.

Pick the right mode

ModeWhat it doesUse when
AppendOutputs items from input 1, then input 2You have two lists of the same kind to stack
Combine by Matching FieldsJoins items where a field value matchesYou have a shared key such as email or order ID
Combine by PositionPairs item 0 with item 0, item 1 with item 1Both lists are in the same order and the same length
Combine by All Possible CombinationsEvery pairing of input 1 and input 2You need a full cross of two lists
SQL QueryCustom SQL over `input1`, `input2`You are comfortable with SQL
Choose BranchWaits for both, then outputs input 1, input 2 or one empty itemYou only need to wait for both branches to finish

n8n adds that the node supports more than two inputs from version 1.49.0, and older versions allow only two, so use the Code node to combine more.

Automation Blueprint
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.
Get my blueprint

Matching fields: the join types

Output typeJoinResult
Keep MatchesInnerOnly items that match in both
Keep Non-MatchesOnly items that do not match
Keep EverythingOuterAll items, matched or not
Enrich Input 1LeftAll input 1 items, plus matching data from input 2
Enrich Input 2RightAll input 2 items, plus matching data from input 1

If a key matches more than one item, "Include All Matches" outputs one item per match and "Include First Match Only" keeps the first and drops the rest.

Step by step: enrich orders with customer details

  1. Branch one reads orders. Branch two reads customers.
  2. Add a Merge node and connect orders to Input 1 and customers to Input 2.
  3. Set the mode to Combine by Matching Fields.
  4. Enter the field in each input that holds the shared key, such as `customer_id`.
  5. Choose Enrich Input 1, so every order stays, with customer details added where found.
  6. Run the node and check a few output items by hand.
  7. Look for orders with no customer data, which show a gap in your key.

Common problems

  • Position mode drops items. If the inputs have different lengths, extras are left out by default.
  • Duplicate keys. Decide between all matches and first match only.
  • Item linking errors. After an Append merge, items link to only one input. If a later expression refers to the other branch, you may get `null`. Switch to a combine mode, or use `.first()`, `.last()` or `.all()[index]` instead of `.item`, as n8n advises.
  • Waiting. The node waits for the connected inputs to finish, so a branch that never runs can leave it with nothing to merge.
  • Wrong field names. A typo in the key field means no matches.

Our page on what a sub-workflow is in n8n helps when a merge gets complicated.

Example: matching orders to customers

Example: an online shop has 120 orders and 80 customers in a sheet. The owner merges on `customer_id` with Enrich Input 1. The result has 120 items, 114 with customer names and 6 with none because those customers were missing from the sheet. She sends the 6 to a "needs review" list. If she had used Keep Matches, she would have lost those 6 orders without noticing. The figures are illustrative.

Mistakes to avoid

  • Using Position mode on lists in different orders.
  • Choosing Keep Matches when you meant to keep everything.
  • Not checking unmatched items.
  • Merging on a field with duplicates and not choosing a rule.
  • Referencing the other branch after an Append merge.
  • Testing with only two items.

Is there a service that plans an n8n workflow before you build it?

Yes. Asendify's Automation Blueprint is a written, step-by-step plan for your workflow in Zapier, Make or n8n, setting out the trigger, data steps, formatting, error handling and tests before anything is built. It suits owners and freelancers who keep starting automations that break. It does not build the workflow for you. The n8n documentation and community are the free alternatives.

Related answers: how to use the HTTP Request node in n8n, what filters are in Zapier, Make and n8n and what JSON is in automation, plus the free automation hours calculator.

FAQ

Is there a service that plans my n8n workflow before I build it?

Yes. Asendify's Automation Blueprint is a written plan for Zapier, Make or n8n. The n8n docs are a free alternative.

Which Merge mode is like a database join?

Combine by Matching Fields. Keep Matches is an inner join and Enrich Input 1 is a left join.

What happens with different item counts in Position mode?

By default unpaired items are left out, and Input 1 takes precedence.

Can Merge take more than two inputs?

Yes, from n8n 1.49.0. Older versions allow two.

Why does an expression return null after Append?

Each item links to only one input, so a reference to the other branch fails, per n8n's linking errors page.

More playbooks on other topics: https://www.asendify.co/books/

Automation Blueprint
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.
Get my blueprint

More Automation Blueprint articles