Concatenate Node
The Concatenate node joins strings or arrays from multiple workflow variables into a single output with deduplication, formatting, and cleaning options. It supports both string and array output formats, handling mixed input types including strings, arrays, and objects. This is particularly useful for merging results from parallel workflow branches or combining data from different sources.
How It Works
When the node executes, it collects data from the specified input fields and combines them into a single output variable. The node gathers all values whether they're strings, arrays, or other data types, automatically flattening arrays into individual items.
The collected items pass through optional cleaning operations: trimming whitespace, removing empty values, and eliminating duplicates. These operations run in sequence, normalizing data from different sources before combining. The node then produces either a string output (joining items with a separator) or an array output (keeping items as a list).
The node supports two output operations: replace and append. Replace mode overwrites any existing value in the output field, while append mode adds new items to existing content. Append mode is useful in loop scenarios where results accumulate across multiple iterations.
Configuration Parameters
Input fields
Input Fields (Array, Required): Workflow variables to concatenate.
The node supports both string and array inputs, automatically flattening arrays into individual items. For parallel workflows, select outputs from each branch. All input fields must exist in workflow state at execution time.
Output field
Output Field (Text, Required): Workflow variable where combined data is stored.
The output is either a concatenated string or an array of items, depending on Output Data Type. For string output, items are joined with the specified separator. For array output, items are kept as a list preserving original types.
Common naming patterns: combined_results, merged_data, concatenated_text.
Output data type
Output Data Type (Dropdown, Default: String): Output format.
| Type | Output format | Best for |
|---|---|---|
| String | Items joined with separator | Creating formatted text, generating reports, building prompts for LLMs |
| Array | Items kept as list | Preserving structured data, passing to nodes expecting arrays, maintaining data types |
String output converts all items to strings; array output preserves original data types.
Output operation
Output Operation (Dropdown, Default: Replace Existing): How to handle existing output field value.
| Operation | Behavior | Use when |
|---|---|---|
| Replace Existing | Overwrites existing value | Standard concatenation, single-pass operations |
| Append to Existing | Adds to existing value | Accumulating results in loops, building datasets incrementally |
For string output, append mode concatenates with the separator. For array output, it extends the existing array.
Remove duplicates
Remove Duplicates (Toggle, Default: false): Keep only unique items using exact matching.
Only works for simple values (strings, numbers, booleans). Objects and arrays are not deduplicated. Applied after trimming whitespace.
Trim whitespace
Trim Whitespace (Toggle, Default: false): Remove leading/trailing whitespace from string items.
Normalizes data from different sources with inconsistent formatting. Applied before deduplication.
Skip empty items
Skip Empty Items (Toggle, Default: false): Exclude null, undefined, or empty string items.
Prevents unwanted separators in string output when working with sparse data or optional fields.
Join separator
Join Separator (Text, Conditional): String used to join items for String output.
Required when Output Data Type is String. Use \n for newlines, \t for tabs. Common separators: \n (newline), , (comma-space), | (pipe). Maximum 100 characters. Variable interpolation with ${separator} is supported. Use \n\n (double newline) to create paragraph breaks when combining text chunks for LLM processing.
Common parameters
This node supports common parameters shared across workflow nodes, including Stream Output Response, Streaming Messages, Logging Mode, and Wait For All Edges. For detailed information, see Common Parameters.
Best practices
- Use after parallel branches to merge results, configuring Wait For All Edges to ensure all branches complete before combining
- Enable Trim Whitespace and Skip Empty Items when combining text for LLM processing to clean up formatting inconsistencies
- Only simple values (strings, numbers, booleans) are deduplicated; complex objects and arrays always appear even if duplicates exist
- Use Append mode in loop scenarios to accumulate results across iterations
- Choose output type based on downstream usage: String for formatted text or prompts, Array for structured data expected by other nodes
- Select separators that preserve readability: newlines for line-by-line content, comma-space for lists, double newlines for paragraph breaks
Limitations
- Deduplication scope: Remove Duplicates only works for hashable types (strings, numbers, booleans). Objects, arrays, and complex data structures are not deduplicated.
- Input field requirement: All specified input fields must exist in workflow state at execution time. Missing fields cause failure unless Continue On Fail is enabled.
- Separator length: Join Separator is limited to 100 characters. Longer separators are truncated.
- Type conversion: For String output, all items are converted to strings using standard representation. Complex objects may not format as expected.
- Memory usage: Concatenating large arrays or many input fields can consume significant memory, especially with Remove Duplicates enabled.