-
Notifications
You must be signed in to change notification settings - Fork 385
docs: rewrite variable aggregator node page #745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8192d82
docs: rewrite the variable aggregator node page
RiskeyL 061d52a
translate: update variable aggregator page for zh and ja
RiskeyL 7720788
fix: address review feedback on variable aggregator page
RiskeyL e3a352d
docs: require translation disclaimer on all zh/ja pages
RiskeyL 81ab0aa
docs: clarify variable aggregator usage in trigger pages
RiskeyL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,67 +1,38 @@ | ||
| --- | ||
| title: "Variable Aggregator" | ||
| description: "Combine variables from different workflow branches into unified outputs" | ||
| description: "Converge exclusive workflow branches into a single output" | ||
| --- | ||
|
|
||
| The Variable Aggregator node combines variables from different execution paths into a single unified output. When multiple branches produce similar outputs, this node eliminates the need for duplicate downstream processing by creating one consistent variable reference. | ||
| Use the Variable Aggregator node to converge **exclusive** workflow branches into a single output, so you only need to define downstream processing once. | ||
|
|
||
| ## The Branching Problem | ||
| Nodes like If/Else and Question Classifier create exclusive branches—only one path executes per run. When these branches produce the same type of output, you would normally duplicate downstream nodes on every branch. | ||
|
|
||
| Conditional workflows create parallel execution paths where only one branch runs at a time. Without aggregation, you'd need duplicate downstream nodes for each possible branch outcome, creating complex and maintenance-heavy workflows. | ||
| The Variable Aggregator eliminates this duplication. It provides a single output variable for downstream nodes to reference, regardless of which branch ran. | ||
|
|
||
| The Variable Aggregator acts as a merge point, collecting branch outputs into a single variable that downstream nodes can reference consistently, regardless of which branch actually executed. | ||
|
|
||
| ## Classification Workflow Example | ||
|
|
||
| When user input is classified and each category requires different knowledge retrieval, the Variable Aggregator combines the results: | ||
|
|
||
| **Without Aggregation** - Complex workflow requiring duplicate LLM nodes: | ||
|
|
||
| <Frame caption="Complex workflow without variable aggregation"> | ||
| <img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/7a7c91663c3799ce9d056b013d5df29c.png" alt="Issue Classification without Variable Aggregation" /> | ||
| <Frame caption="Without Variable Aggregator"> | ||
|  | ||
| </Frame> | ||
|
|
||
| **With Aggregation** - Simplified workflow with single downstream processing: | ||
|
|
||
| <Frame caption="Simplified workflow using variable aggregation"> | ||
| <img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/2b1694936fdab4843f5edc3f2fd1e79a.png" alt="Multi-Branch Aggregation after Issue Classification" /> | ||
| <Frame caption="With Variable Aggregator"> | ||
|  | ||
| </Frame> | ||
|
|
||
| The aggregated workflow uses one LLM node instead of duplicating it for each classification branch, significantly reducing complexity while maintaining the same functionality. | ||
|
|
||
| ## Conditional Processing Example | ||
|
|
||
| Similar benefits apply to If-Else branches that produce comparable outputs: | ||
|
|
||
| <Frame caption="Variable aggregation after conditional branching"> | ||
| <img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/ff0e5774a3eccc8a04c310ab9bae25e7.png" alt="Multi-Branch Aggregation after Conditional Branching" /> | ||
| </Frame> | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### Variable Selection | ||
|
|
||
| Connect variables from different workflow branches that you want to combine. Each connected variable becomes a potential input to the aggregated output. | ||
|
|
||
| ### Type Constraints | ||
| <Note> | ||
| The Variable Aggregator is designed for exclusive branches where **only one path runs at a time**. It does not combine outputs from multiple branches that execute in parallel. | ||
|
|
||
| **Same Type Rule** - All aggregated variables must be the same data type. Once you connect the first variable (e.g., String), the node only accepts variables of the same type from other branches. | ||
| To merge results from parallel branches, use a [Code](/en/use-dify/nodes/code) or [Template](/en/use-dify/nodes/template) node. | ||
|
RiskeyL marked this conversation as resolved.
|
||
| </Note> | ||
|
|
||
| **Supported Types:** | ||
| - **String** - Text outputs from different processing branches | ||
| - **Number** - Numeric calculations, scores, or measurements | ||
| - **Object** - Structured data objects with similar schemas | ||
| - **Boolean** - True/false values | ||
| - **Array** - Lists, collections, or multiple results | ||
| ## Select the Variables to Converge | ||
|
|
||
| ### Output Behavior | ||
| From each branch, add variables that need the same downstream processing. All variables must share the same data type. | ||
|
|
||
| The Variable Aggregator outputs the value from whichever branch actually executed. Since only one branch runs in conditional workflows, only one input variable will have a value during execution. | ||
| Supported types: `string`, `number`, `object`, `boolean`, `array`, `file`. | ||
|
|
||
| ## Advanced Features | ||
| The node outputs whichever variable has a value at runtime. Since only one branch executes, only one variable will have a value, and that value becomes the node's output. | ||
|
|
||
| ### Multiple Aggregation Groups | ||
| ## Converge Multiple Sets of Variables | ||
|
|
||
| Advanced workflows (v0.6.10+) can aggregate multiple groups of variables simultaneously. Each group maintains its own type constraint, allowing you to aggregate different data types in parallel within the same node. | ||
| When you have multiple sets of variables that each need to be converged separately, enable **Aggregation Group** to create groups within a single Variable Aggregator. | ||
|
|
||
| This is useful when branches produce multiple related outputs that need to be combined separately - for example, aggregating both text summaries and numeric scores from different processing paths. | ||
| Each group converges its own set of variables and produces a separate output. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,69 +1,40 @@ | ||
| --- | ||
| title: "変数アグリゲーター" | ||
| description: "異なるワークフローブランチからの変数を統一された出力に結合" | ||
| title: "変数集約器" | ||
| description: "排他的なワークフローブランチを単一の出力に集約" | ||
|
RiskeyL marked this conversation as resolved.
|
||
| --- | ||
|
|
||
|
RiskeyL marked this conversation as resolved.
|
||
| <Note> ⚠️ このドキュメントは AI によって自動翻訳されています。不正確な部分がある場合は、[英語版](/en/use-dify/nodes/variable-aggregator)を参照してください。</Note> | ||
|
|
||
| 変数アグリゲーターノードは、異なる実行パスからの変数を単一の統一された出力に結合します。複数のブランチが類似の出力を生成する場合、このノードは一つの一貫した変数参照を作成することで、下流での重複処理の必要性を排除します。 | ||
| 変数集約器ノードを使用すると、**排他的な** ワークフローブランチを単一の出力に集約し、下流の処理を一度だけ定義すれば済むようになります。 | ||
|
|
||
| ## 分岐の問題 | ||
| IF/ELSE や質問分類器などのノードは排他的なブランチを作成し、実行ごとに 1 つのパスのみが実行されます。これらのブランチが同じ型の出力を生成する場合、通常はすべてのブランチに下流ノードを重複して配置する必要があります。 | ||
|
|
||
| 条件付きワークフローでは、並列実行パスが作成され、一度に一つのブランチのみが実行されます。集約なしでは、各可能なブランチ結果に対して重複した下流ノードが必要となり、複雑でメンテナンスが困難なワークフローが生成されます。 | ||
| 変数集約器はこの重複を解消します。実際にどのブランチが実行されたかに関係なく、下流ノードが参照できる単一の出力変数を提供します。 | ||
|
|
||
| 変数アグリゲーターはマージポイントとして機能し、ブランチ出力を単一の変数に収集することで、実際にどのブランチが実行されたかに関係なく、下流ノードが一貫して参照できるようにします。 | ||
|
|
||
| ## 分類ワークフローの例 | ||
|
|
||
| ユーザー入力が分類され、各カテゴリが異なる知識検索を必要とする場合、変数アグリゲーターが結果を結合します: | ||
|
|
||
| **集約なし** - 重複したLLMノードを必要とする複雑なワークフロー: | ||
|
|
||
| <Frame caption="変数集約なしの複雑なワークフロー"> | ||
| <img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/7a7c91663c3799ce9d056b013d5df29c.png" alt="変数集約なしの問題分類" /> | ||
| <Frame caption="変数集約器なし"> | ||
|  | ||
| </Frame> | ||
|
|
||
| **集約あり** - 単一の下流処理による簡素化されたワークフロー: | ||
|
|
||
| <Frame caption="変数集約を使用した簡素化されたワークフロー"> | ||
| <img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/2b1694936fdab4843f5edc3f2fd1e79a.png" alt="問題分類後のマルチブランチ集約" /> | ||
| <Frame caption="変数集約器あり"> | ||
|  | ||
| </Frame> | ||
|
|
||
| 集約されたワークフローでは、各分類ブランチに対してLLMノードを複製する代わりに一つのLLMノードを使用し、同じ機能を維持しながら複雑さを大幅に削減します。 | ||
|
|
||
| ## 条件処理の例 | ||
|
|
||
| 同様の利点は、類似の出力を生成するIf-Elseブランチにも適用されます: | ||
|
|
||
| <Frame caption="条件分岐後の変数集約"> | ||
| <img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/ff0e5774a3eccc8a04c310ab9bae25e7.png" alt="条件分岐後のマルチブランチ集約" /> | ||
| </Frame> | ||
|
|
||
| ## 設定 | ||
|
|
||
| ### 変数選択 | ||
|
|
||
| 結合したい異なるワークフローブランチからの変数を接続します。接続された各変数は、集約された出力への潜在的な入力となります。 | ||
|
|
||
| ### 型制約 | ||
| <Note> | ||
| 変数集約器は、**一度に 1 つのパスのみが実行される** 排他的なブランチ向けに設計されています。複数のブランチが同時に実行される並列ブランチの出力を結合することはできません。 | ||
|
|
||
| **同一型ルール** - すべての集約された変数は同じデータ型である必要があります。最初の変数(例:文字列)を接続すると、ノードは他のブランチから同じ型の変数のみを受け入れます。 | ||
| 並列ブランチの結果をマージするには、[コード実行](/ja/use-dify/nodes/code) または [テンプレート](/ja/use-dify/nodes/template) ノードを使用してください。 | ||
| </Note> | ||
|
|
||
| **サポートされる型:** | ||
| - **文字列** - 異なる処理ブランチからのテキスト出力 | ||
| - **数値** - 数値計算、スコア、または測定値 | ||
| - **オブジェクト** - 類似のスキーマを持つ構造化データオブジェクト | ||
| - **ブール値** - True/false値 | ||
| - **配列** - リスト、コレクション、または複数の結果 | ||
| ## 集約する変数の選択 | ||
|
|
||
| ### 出力動作 | ||
| 各ブランチから、同じ下流処理が必要な変数を追加します。すべての変数は同じデータ型である必要があります。 | ||
|
|
||
| 変数アグリゲーターは、実際に実行されたブランチからの値を出力します。条件付きワークフローでは一つのブランチのみが実行されるため、実行中は一つの入力変数のみが値を持ちます。 | ||
| サポートされる型:`string`、`number`、`object`、`boolean`、`array`、`file`。 | ||
|
|
||
| ## 高度な機能 | ||
| ノードは実行時に値を持つ変数を出力します。排他的なブランチでは 1 つのブランチのみが実行されるため、値を持つ変数は 1 つだけであり、その値がノードの出力になります。 | ||
|
|
||
| ### 複数集約グループ | ||
| ## 複数の変数セットの集約 | ||
|
|
||
| 高度なワークフロー(v0.6.10+)では、複数の変数グループを同時に集約できます。各グループは独自の型制約を維持し、同一ノード内で異なるデータ型を並行して集約することができます。 | ||
| 複数の変数セットをそれぞれ個別に集約する必要がある場合は、**グループ** を有効にして、単一の変数集約器内にグループを作成します。 | ||
|
|
||
| これは、ブランチが複数の関連する出力を生成し、それらを個別に結合する必要がある場合に便利です - たとえば、異なる処理パスからのテキスト要約と数値スコアの両方を集約する場合です。 | ||
| 各グループはそれぞれの変数セットを独立して集約し、個別の出力を生成します。 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.