Skip to main content

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

ParameterDescriptionRequired
Number of InputsHow many input streams to acceptYes
ModeHow to combine the inputsYes

Mode Options

ModeDescription
PassthroughOutput items from one selected input only
AppendOutput all items from all inputs
JoinSQL-style join on two inputs
SQLCustom SQL query across all inputs

Mode: Passthrough

Outputs items from a single selected input, ignoring others.

ParameterDescription
Output InputWhich 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.

ParameterDescription
Left FieldField from input 1 to match
Right FieldField from input 2 to match
Join TypeType of join operation
Conflict ResolutionHow to handle duplicate field names

Join Types

TypeDescription
InnerOnly matching items from both inputs
LeftAll from input 1, matches from input 2
RightAll from input 2, matches from input 1
FullAll items from both inputs
CrossCartesian product (all combinations)

Conflict Resolution

When both inputs have fields with the same name:

OptionBehavior
Keep leftUse value from input 1
Keep rightUse value from input 2
Keep bothPrefix with input name
NestedNest each input's data

Mode: SQL

Execute a custom SQL query against all inputs using PGlite.

ParameterDescription
QuerySQL query string
Output ModeHow to format results (Rows, Array, Single)
Data MappingHow 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

ModeDescription
RowsEach row as separate item
ArrayAll rows in single array
SingleFirst 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:

  1. Set Number of Inputs: 2
  2. Set Mode: Append
  3. Connect both Get Table nodes

Join Orders with Customers

[Get Table: Customers] ──┐
├── [Merge: Join] → [Output]
[Get Table: Orders] ─────┘
  1. Set Number of Inputs: 2
  2. Set Mode: Join
  3. Left Field: id (from Customers)
  4. Right Field: customerId (from Orders)
  5. Join Type: Inner

SQL Query Across Inputs

Calculate order totals per customer:

  1. Set Mode: SQL
  2. 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:

  1. Set Mode: Passthrough
  2. Set Output Input: 1 (or 2)

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