KEEP LEARNING
Build the bigger picture.
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
Tips > Building Workflows
The Merge node combines data from two branches by matching on a shared key.
The Merge node joins data from two branches on a shared key, the n8n equivalent of a SQL JOIN. Fetch base records in one branch and enrichment data in a parallel branch, then merge them by a common field such as email. The mode you choose, Inner Join, Left Join, or Append, decides which items survive and how unmatched rows are handled.
The Merge node combines data from two branches by matching on a shared key. This is the n8n equivalent of a SQL JOIN and is the standard way to enrich records from one system with data from another. Fetch the base records in one branch, fetch the enrichment data in a parallel branch, and merge them by a common identifier.
Real-world example: You have a list of orders from Shopify and need to enrich each order with customer lifetime value (CLV) data from your analytics database.
Trigger
|
+-> Branch 1: Shopify - Get Recent Orders
| (returns: order_id, customer_email, total, created_at)
|
+-> Branch 2: PostgreSQL - Get Customer CLV
| (returns: email, lifetime_value, order_count, first_order_date)
|
Merge Node
Mode: Combine
Join: Inner Join (or Left Join to keep unmatched orders)
Match By: Field
Field 1: customer_email (from Shopify branch)
Field 2: email (from PostgreSQL branch)The enrichment branch aggregates customer lifetime value with a query like this:
SELECT
email,
SUM(total_amount) as lifetime_value,
COUNT(*) as order_count,
MIN(created_at) as first_order_date
FROM orders
GROUP BY email;Each order is then merged with its matching customer record, producing an enriched item:
{
"order_id": "ORD-5678",
"customer_email": "jane@example.com",
"total": 89.99,
"created_at": "2025-01-15T10:30:00Z",
"lifetime_value": 1247.50,
"order_count": 14,
"first_order_date": "2023-03-22T08:15:00Z"
}Tip: Merge Mode Reference.
The enriched data can now be used downstream: high-CLV customers get priority processing, first-time buyers get a welcome email, repeat customers get a loyalty discount.
Related: Use Path Parameters in Webhook URLs for Dynamic Routing · Use Edit Fields in "Map Each" Mode for Simple Renames
KEEP LEARNING
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
APPLY IT TO YOUR SYSTEM
Bring the process, the tools involved and an example of where the current workflow gets stuck.