Variable Aggregator
Last updated
Last updated
The variable aggregation node is an important part of the workflow. It combines the results from different branches into one single variable. This means that no matter which branch of the workflow is executed, the results can all be accessed through this unified variable.
This is especially helpful when your workflow has multiple branches or paths. Instead of defining the same type of variable multiple times in different part of your workflow, the variable aggregator node gathers them all into one. This simplifies process and makes it easier to use these results in later steps of the workflow.
Through variable aggregation, you can aggregate multiple outputs, such as from or conditional branching, into a single output for use and manipulation by downstream nodes, simplifying data flow management.
Multi-Branch Aggregation after Issue Classification
Without variable aggregation, the branches of Classification 1 and Classification 2, after different knowledge base retrievals, would require repeated definitions for downstream LLM and direct response nodes.
By adding variable aggregation, the outputs of the two knowledge retrieval nodes can be aggregated into a single variable.
Multi-Branch Aggregator after IF/Else Conditional Branching
The variable aggregator supports aggregating various data types, including strings (String
), numbers (Number
), objects (Object
), and arrays (Array
).
The variable aggregator can only aggregate variables of the same data type. If the first variable added to the variable aggregation node is of the String
data type, subsequent connections will automatically filter and allow only String
type variables to be added.
Aggregation Grouping
When aggregation grouping is enabled, the variable aggregator can aggregate multiple groups of variables, with each group requiring the same data type for aggregation.