Merge Node
Last updated
Last updated
The merge node allows you to combine different execution paths from your pipeline into a single flow. Use a merge node when you want to consolidate multiple branches (typically coming from a condition node) back into a unified pipeline flow.
Function: The strategy for merging multiple inputs
Type: Dropdown
Options:
Pick First: Takes the first (by time) valid input from connected paths
Join All: Combines all inputs into a list
Paths: The different input paths to be merged.
Type: List of the selected type
Each field represents a potential incoming path
You can dynamically add or remove input paths using the "Add Path" button
Type: The data type for inputs and outputs
Type: Dropdown
Available options correspond to standard data types (Text, Number, etc.)
Output: The merged result
Type: Depends on function selection
Pick First: Single value of selected type
Join All: List of values of selected type
Example usage: {{merge_0.output}}
The merge node is typically used in conjunction with the condition node to combine different execution paths
When using "Pick First", the output will be a single value of the selected type as it’ll pick the first available incoming value.
When using "Join All", the output will be a list of values of the selected type as it’ll join all incoming values.
All input paths must match the selected type in the Type dropdown
Empty or skipped paths are handled gracefully by the node
The below example shows a pipeline that processes customer data differently based on their status using a condition node, then merges the results:
Condition node checks customer status:
Path 0: VIP customer processing
Path 1: New customer processing
Path else: Regular customer processing
Merge node combines the processing results:
Type: Text
Function: Join All
Fields:
Path 1: {{vip_processing.output}}
Path 2: {{new_customer_processing.output}}
Path 3: {{regular_processing.output}}
The merge node collects all processing results into a single list that can be used by downstream nodes.
In the below example, we have a condition node with two paths.
If text_0 = hello, then path 0 will execute (which is false; text_0 = orange)
If text_1 = apple, then path 1 will execute (which is true)
Path 1 executes, and we merge both paths together before displaying the output. Path 1 is a text node that prints out text_1 (“apple”). Hence, the output is apple.