Merge
Combines multiple input streams into a single output.
Overview
The Merge node connects to multiple upstream nodes and combines their outputs. Use it to:
- Join data from different sources
- Combine parallel workflow branches
- Append datasets together
- Run SQL queries across multiple inputs
Parameters
| Parameter | Description | Required |
|---|---|---|
| Number of Inputs | How many input streams to accept | Yes |
| Mode | How to combine the inputs | Yes |
Mode Options
| Mode | Description |
|---|---|
| Passthrough | Output items from one selected input only |
| Append | Output all items from all inputs |
| Join | SQL-style join on two inputs |
| SQL | Custom SQL query across all inputs |
Mode: Passthrough
Outputs items from a single selected input, ignoring others.
| Parameter | Description |
|---|---|
| Output Input | Which input to pass through (1-based index) |
Use case: Select between workflow branches based on configuration.
Mode: Append
Outputs all items from all inputs in sequence.
No additional parameters required.
Use case: Combine data from parallel processing paths.
Mode: Join
Performs SQL-style joins on exactly two inputs.
| Parameter | Description |
|---|---|
| Left Field | Field from input 1 to match |
| Right Field | Field from input 2 to match |
| Join Type | Type of join operation |
| Conflict Resolution | How to handle duplicate field names |
Join Types
| Type | Description |
|---|---|
| Inner | Only matching items from both inputs |
| Left | All from input 1, matches from input 2 |
| Right | All from input 2, matches from input 1 |
| Full | All items from both inputs |
| Cross | Cartesian product (all combinations) |
Conflict Resolution
When both inputs have fields with the same name:
| Option | Behavior |
|---|---|
| Keep left | Use value from input 1 |
| Keep right | Use value from input 2 |
| Keep both | Prefix with input name |
| Nested | Nest each input's data |
Mode: SQL
Execute a custom SQL query against all inputs using PGlite.
| Parameter | Description |
|---|---|
| Query | SQL query string |
| Output Mode | How to format results (Rows, Array, Single) |
| Data Mapping | How to map data (Flatten or JSONB) |
SQL Query
Each input is available as a table named input1, input2, etc.:
SELECT * FROM input1
JOIN input2 ON input1.id = input2.orderId
WHERE input1.status = 'active'
Output Mode
| Mode | Description |
|---|---|
| Rows | Each row as separate item |
| Array | All rows in single array |
| Single | First row only |
Output
Depends on the mode:
- Passthrough: Items from selected input
- Append: All items from all inputs
- Join: Merged items based on join logic
- SQL: Query result rows
Examples
Combine Two Data Sources
Append customers from two tables:
- Set Number of Inputs:
2 - Set Mode:
Append - Connect both Get Table nodes
Join Orders with Customers
[Get Table: Customers] ──┐
├── [Merge: Join] → [Output]
[Get Table: Orders] ─────┘
- Set Number of Inputs:
2 - Set Mode:
Join - Left Field:
id(from Customers) - Right Field:
customerId(from Orders) - Join Type:
Inner
SQL Query Across Inputs
Calculate order totals per customer:
- Set Mode:
SQL - Query:
SELECT
input1.name,
SUM(input2.amount) as totalSpent
FROM input1
JOIN input2 ON input1.id = input2.customerId
GROUP BY input1.id, input1.name
Select Active Branch
Pass through only one input based on index:
- Set Mode:
Passthrough - Set Output Input:
1(or2)
Tips
- Inputs are numbered starting from 1 in the UI
- All inputs must have data before merge executes
- Use Append for simple combining without matching
- Use Join for related data with common keys
- Use SQL for complex transformations and aggregations
- Join mode requires exactly 2 inputs