logo
開発者ドキュメント
検索
Variable Merger

Variable Merger

If multiple branches are designed within a workflow, it is often necessary to use a node to consolidate the output results from all branches as the final output of the entire workflow. If any branch has not been executed, the consolidation node will read an empty value from that branch, which may cause the workflow to report an error during execution. In such scenarios, you can use a Variable Aggregation Node to collect output variables from multiple branches. The variable aggregation node will read the first non-empty value from any of the branches and make it available for downstream nodes to use and process — eliminating the need to handle outputs from unexecuted branches and simplifying data flow management.

Node Configuration

In variable aggregation, multiple different variables are aggregated into a new variable in the form of groups, and then output.

Variables within the same group must be of the same type.

An Example

The above image shows a simple example of article writing. In this workflow, the user inputs an article topic, and based on the topic, the workflow enters different branch paths, executes different nodes, generates the article, and translates it into Spanish for output.

In this case, the workflow does not know in advance what topic the user will input or which branch/path will be taken. Since the final article needs translation, the outputs from all branches must be aggregated so that the translation node can access them.

Without a variable aggregation node, the translation node would receive an empty value from any unexecuted branch, causing the workflow to fail.