Branch Aggregator
Node Overview
Node name: Branch Aggregator
Supported scenarios: Chatflow Agent (supported), Workflow Agent (supported)
Feature Description
The Branch Aggregator node aggregates variables output by multiple input sources or nodes into a single variable (such as array[string]) for downstream nodes to use. It integrates data from different branches, achieving data convergence and unified processing.
Node Display Content
![Branch Aggregator: the outputs of two parallel branches aggregated into one array[string] variable](/assets/08-1-%E8%8A%82%E7%82%B9%E5%B1%95%E7%A4%BA.Bs32cpH3.png)
1. Basic Information Display
- Icon: node-specific icon
- Name: node name
- Input variables: displays node logo + variable name
- Note: explanatory text added by the user
2. Action Buttons
- More button: click to display the context menu content
Node Edit Panel
![Branch Aggregator edit panel: variable assignment (type ARRAY[STRING]), the aggregation grouping switch, and next step](/assets/08-2-%E8%8A%82%E7%82%B9%E9%85%8D%E7%BD%AE.BaltQvX5.png)
1. Module States
The Branch Aggregator node has two major states (switched by the Aggregation Grouping toggle in the edit panel):
a. Ungrouped State
- Variable type: the first variable selected determines the variable type (the type badge, such as ARRAY[STRING], is shown at the top right of the Variable Assignment section)
- Add variable button:
- When no variable has been selected, all variables are shown
- When a variable has been selected, variables are filtered by that variable's type before being added
- Delete variable: click to delete a variable
- Variable list: displays node name/variable name
b. Grouped State

- How to enable: turn on the Aggregation Grouping switch and the variable assignment area switches to grouped form
- Group management: each group (e.g., Group 1) adds its own variables to assign
- Group configuration: click + Add Group to create multiple groups
- Group variables: each group can contain multiple variables
- Output variables: each group produces its own output variable
Group N.output(of type any), which downstream nodes can reference individually
2. Next Step Configuration
- Adding a next node is supported
Execution Logic
The execution logic of the Branch Aggregator node is implemented by the backend to ensure branches are aggregated correctly.
Context Menu Actions
The context menu contains the following options:
- Change node: change the node type
- Copy: copy the node
- Duplicate: duplicate the node content
- Delete: delete the node
- Help link: jump to the help documentation
- Run node: test-run the current node
Test Run
- Support status: test run not supported
- Change node: changing the node type is supported
- Copy features: copy, cut, and delete operations are supported
Use Cases
1. Data Convergence
- Multi-source data: converge information from multiple data sources
- Branch results: integrate processing results from different branches
- Parallel processing: merge data processed in parallel
- Flow integration: integrate the outputs of multiple flows
2. Data Merging
- List merging: aggregate same-type outputs of multiple branches into a single list
- Same-type variable aggregation: converge same-type variables from multiple branches into a single variable reference
3. Result Integration
- Report generation: integrate multiple analysis results
- Data summarization: summarize statistical data
- Result comparison: compare results from different branches
- Decision support: integrate the data needed for decisions
4. Flow Control
- Conditional branches: process the results of conditional branches
- Loop results: integrate the results of loop processing
- Exception handling: integrate the results of exception handling
- State management: manage flow state
Configuration Modes
1. Ungrouped Mode
Suitable for simple data aggregation scenarios:
Configuration Steps
- Choose the variable type: select the first variable to determine the overall variable type
- Add variables: filter and add variables based on the variable type
- Manage variables: delete unneeded variables
- View the list: view node names and variable names
2. Grouped Mode
Suitable for complex data aggregation scenarios:
Configuration Steps
- Create groups: create multiple groups
- Configure groups: add variables to each group individually
- Manage groups: manage the variables within groups
- Integrate groups: integrate the data across groups
Best Practices
1. Variable Selection
- Consistent types: select variables of the same type for aggregation
- Data quality: ensure the quality of input data
- Naming conventions: use clear variable names
- Count control: keep the number of variables reasonable
2. Group Design
- Clear logic: group according to business logic
- Sensible structure: design a sensible group structure
- Maintainability: keep the group structure easy to maintain
- Extensibility: consider future expansion needs
3. Data Integration
- Uniform formats: keep data formats uniform
- Type conversion: perform type conversion when necessary
- Error handling: add appropriate error handling
- Performance optimization: consider aggregation performance
4. Result Output
- Clear structure: keep the output structure clear
- Complete information: make sure the output information is complete
- Standard formats: use standard output formats
- Ease of use: make sure the output is easy for downstream use
Configuration Steps
1. Basic Configuration
- Choose the aggregation mode (grouped or ungrouped)
- Configure input variables
- Set the variable type
2. Variable Management
- Add the required variables
- Configure variable attributes
- Manage the variable list
3. Group Configuration (Grouped Mode)
- Create groups
- Add variables to groups
- Configure group attributes
4. Testing and Validation
- Check the configuration correctness
- Verify the aggregation result
- Adjust configuration parameters
FAQ
Q: How do I choose the aggregation mode?
A: Choose based on data complexity and business needs: ungrouped mode for simple scenarios, grouped mode for complex ones.
Q: How is the variable type determined?
A: The variable type is determined by the first variable selected; subsequently added variables must match the first variable's type.
Q: How many variables can I add?
A: There is no explicit limit, but keeping the number reasonable for your actual needs is recommended.
Q: How do I manage groups?
A: You can create multiple groups; each group manages its variables independently and everything is aggregated at the end.
Q: How is the aggregation result output?
A: The aggregation result is output in the configured format for downstream nodes to use.
Considerations
- Type consistency: make sure the aggregated variables have consistent types
- Data quality: ensure the quality and completeness of input data
- Performance considerations: consider the performance impact of aggregating large amounts of data
- Error handling: add appropriate error handling mechanisms
- Result verification: verify the correctness of the aggregation result