GenAI Unplugged

How to Use Merge Node in n8n | Combine Data Like a Pro

How the n8n Merge node works: combine by position and append modes explained, so you can join data from several branches into one clean output.

The Merge node in n8n combines data from two or more workflow branches into one stream. Append stacks all items from both inputs, Combine joins them by matching field, position, or all combinations like a SQL join, and Choose Branch passes one input through.

Table of contents

Overview

This lesson is part of the n8n AI Automation - Zero to Hero course, Section: 3. Deep Dive Concepts.

Watch the video above for the full tutorial, or read the written guide below.

What Is the Merge Node in n8n?

The Merge node combines data from two or more separate branches of a workflow into one stream. It is how you bring back together results that were split earlier or fetched in parallel, so a single later node can work on the combined data.

How to Use the Merge Node in n8n

Connect two branches into the Merge node, then choose a mode. Append stacks all items from both inputs one after another. Combine joins them by matching field, by position, or by all possible combinations, which works like a SQL join on a shared key. Choose Branch passes through just one input. Use Combine "by matching fields" when you need to enrich one dataset with values from another using a common ID.

Key Takeaways

  • n8n runs a workflow from left to right and top to bottom. So when one branch must run first, like orders before order details, place it at the top of the canvas.
  • Append puts the items of each input one after the other. 100 order headers and 291 order lines came out as one long list, which suits branches that return the same kind of data.
  • Combine by All Possible Combinations is a cross join: every order is paired with every order line, so 100 orders and 291 lines multiply into 29,100 items.
  • Combine by Matching Fields on order ID joins each line to its order. Keep Matches works like an SQL inner join and returned the 291 matched lines, while Keep Non-Matches returns only the items with no partner.
  • Keep Everything works like an outer join, Enrich Input 1 like a left join and Enrich Input 2 like a right join. With 4 orders that had no lines and 5 lines with no order, the lesson got 300, 295 and 296 items.
  • If the two inputs name the key differently, for example order ID in one and ID in the other, switch on the option for different field names and enter the name from each input.

Next Steps

Continue your n8n journey with the full n8n AI Automation - Zero to Hero course.

Frequently asked questions

What will I learn in this lesson?

The Merge node combines data from two or more workflow branches into one stream. You will learn its Append, Combine, and Choose Branch modes, including how to join two datasets on a matching field like a SQL join.

Do I need to watch the previous lessons first?

This lesson builds on earlier concepts. If you are new to n8n, start with Lesson 1 for the best learning experience.

Can I get help if I get stuck?

Join the GenAI Unplugged community on Substack where Dheeraj answers questions and shares additional tips.

Dheeraj Sharma

AI Systems Builder
I teach founders, creators and tech teams to build production-grade AI systems, without an enterprise budget. 20 years of enterprise engineering, now in plain English.

Get the n8n Mastery Bundle

All workflows, cheat sheets, and premium resources from the entire course in one package.

Get Premium Resources