Variable Aggregator only accepts first connected input when multiple branches are merged #15626

Closed
opened 2026-02-21 19:22:36 -05:00 by yindo · 4 comments
Owner

Originally created by @JaySu-ecovis on GitHub (Jul 24, 2025).

Originally assigned to: @crazywoola on GitHub.

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

cloud, deployment docker, browser chrome 138.0.7204.168

Cloud or Self Hosted

Cloud

Steps to reproduce

In a workflow where multiple knowledge retrieval nodes (e.g., IITLAW, ACCLAW, CITLAW, etc.) are conditionally executed in parallel and all connected to a single Variable Aggregator node, only the first connected node’s output reaches the aggregator.

Even though each knowledge node independently returns a result (validated via logs), the aggregator only receives the result from the first one (e.g., IITLAW), and ignores the rest.

Steps to reproduce:

1.Create a structured output with flags like has_IIT, has_ACC, etc.
2.Add check nodes for each flag, conditionally calling knowledge retrieval nodes.
3.Connect all knowledge retrieval nodes to a single Variable Aggregator.
4.Observe the aggregator’s input — only one of them is received.

✔️ Expected Behavior

The Variable Aggregator should collect all inputs from active upstream nodes.

Image Image Image

Actual Behavior

Only the first connected node’s output is included. I copied the yml code attached, it seems fine but the behavior is not expected

inpuy.txt

Taxadvisor_yml.txt

Originally created by @JaySu-ecovis on GitHub (Jul 24, 2025). Originally assigned to: @crazywoola on GitHub. ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version cloud, deployment docker, browser chrome 138.0.7204.168 ### Cloud or Self Hosted Cloud ### Steps to reproduce In a workflow where multiple knowledge retrieval nodes (e.g., IITLAW, ACCLAW, CITLAW, etc.) are conditionally executed in parallel and all connected to a single Variable Aggregator node, only the first connected node’s output reaches the aggregator. Even though each knowledge node independently returns a result (validated via logs), the aggregator only receives the result from the first one (e.g., IITLAW), and ignores the rest. Steps to reproduce: 1.Create a structured output with flags like has_IIT, has_ACC, etc. 2.Add check nodes for each flag, conditionally calling knowledge retrieval nodes. 3.Connect all knowledge retrieval nodes to a single Variable Aggregator. 4.Observe the aggregator’s input — only one of them is received. ### ✔️ Expected Behavior The Variable Aggregator should collect all inputs from active upstream nodes. <img width="1852" height="813" alt="Image" src="https://github.com/user-attachments/assets/85a82af2-e55e-41d2-b9d9-a71d09709c7b" /> <img width="1920" height="869" alt="Image" src="https://github.com/user-attachments/assets/7872de70-280d-47e7-8d23-f26364834f70" /> <img width="1920" height="869" alt="Image" src="https://github.com/user-attachments/assets/36a4c21e-1a32-4236-abd5-7efd2d660c57" /> ### ❌ Actual Behavior Only the first connected node’s output is included. I copied the yml code attached, it seems fine but the behavior is not expected [inpuy.txt](https://github.com/user-attachments/files/21400988/inpuy.txt) [Taxadvisor_yml.txt](https://github.com/user-attachments/files/21400993/Taxadvisor_yml.txt)
yindo added the 🐞 bug label 2026-02-21 19:22:36 -05:00
yindo closed this issue 2026-02-21 19:22:36 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 24, 2025):

Hi @JaySu-ecovis! I'm Dosu and I’m helping the dify team.

The Variable Aggregator node currently only collects the first available input from upstream branches—this is by design, not a bug. However, a new option called aggregate_all has been introduced that allows the aggregator to collect all inputs from connected branches and output them as a list. This feature adds an "Aggregate All" switch in the node's configuration panel to enable this behavior. You can find technical details and implementation notes in the related pull request: Allow Variable Aggregator to aggregate all.

If you do not see the "Aggregate All" switch in your cloud deployment, the feature may not be live yet. In that case, you may need to wait for the next platform update or monitor the changelogs for its release.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 24, 2025): <!-- Greeting --> Hi @JaySu-ecovis! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The Variable Aggregator node currently only collects the first available input from upstream branches—this is by design, not a bug. However, a new option called `aggregate_all` has been introduced that allows the aggregator to collect all inputs from connected branches and output them as a list. This feature adds an "Aggregate All" switch in the node's configuration panel to enable this behavior. You can find technical details and implementation notes in the related pull request: [Allow Variable Aggregator to aggregate all](https://github.com/langgenius/dify/pull/22200). If you do not see the "Aggregate All" switch in your cloud deployment, the feature may not be live yet. In that case, you may need to wait for the next platform update or monitor the changelogs for its release. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/22b20a02-b870-4712-a558-34a66d0de85a?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/22b20a02-b870-4712-a558-34a66d0de85a?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/22b20a02-b870-4712-a558-34a66d0de85a?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/22b20a02-b870-4712-a558-34a66d0de85a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/22b20a02-b870-4712-a558-34a66d0de85a?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/22b20a02-b870-4712-a558-34a66d0de85a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/22b20a02-b870-4712-a558-34a66d0de85a?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22887)
Author
Owner

@DavideDelbianco commented on GitHub (Jul 25, 2025):

That's how it works, "Aggregator" is an unfortunate name they have chosen because it makes most users think the node will "merge" multiple inputs in a single output.

What it does is to return the first result from the inputs.
There was a PR #22200 to make this node act as a merge node, but was rejected to avoid generating even more confusion about the node.

Maybe the team could implement a copy of this node using the rejected modifications of the PR and call the new node "Merge"

If you need to "merge" multiple KB outputs, you may try to merge them using a code node, since the outputs are array of objects and feed them as context to the LLM node.
@crazywoola already confirmed in another Issue that the team is working on a feature to allow to bind multiple KB inputs as context to LLM nodes removing the need to merge the outputs

@DavideDelbianco commented on GitHub (Jul 25, 2025): That's how it works, "Aggregator" is an unfortunate name they have chosen because it makes most users think the node will "merge" multiple inputs in a single output. What it does is to return the first result from the inputs. There was a PR #22200 to make this node act as a merge node, but was rejected to avoid generating even more confusion about the node. Maybe the team could implement a copy of this node using the rejected modifications of the PR and call the new node "Merge" If you need to "merge" multiple KB outputs, you may try to merge them using a code node, since the outputs are array of objects and feed them as context to the LLM node. @crazywoola already confirmed in another Issue that the team is working on a feature to allow to bind multiple KB inputs as context to LLM nodes removing the need to merge the outputs
Author
Owner

@crazywoola commented on GitHub (Jul 25, 2025):

That's how it works, "Aggregator" is an unfortunate name they have chosen because it makes most users think the node will "merge" multiple inputs in a single output.

Can't agree more. :)

@crazywoola commented on GitHub (Jul 25, 2025): > That's how it works, "Aggregator" is an unfortunate name they have chosen because it makes most users think the node will "merge" multiple inputs in a single output. Can't agree more. :)
Author
Owner

@dosubot[bot] commented on GitHub (Aug 30, 2025):

Hi, @JaySu-ecovis. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that the Variable Aggregator node only accepts the first input from multiple parallel knowledge retrieval nodes, ignoring others.
  • It was clarified that this behavior is by design, but a new aggregate_all option was introduced to collect all inputs as a list.
  • There was feedback that the "Aggregator" name is misleading since it only returns the first input, with suggestions for a separate "Merge" node to handle multiple inputs better.
  • The team is working on features to bind multiple knowledge base inputs directly to LLM nodes, reducing the need for manual merging.

Next Steps:

  • Please let me know if this issue is still relevant to the latest version of Dify by commenting here to keep the discussion open.
  • Otherwise, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 30, 2025): Hi, @JaySu-ecovis. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that the Variable Aggregator node only accepts the first input from multiple parallel knowledge retrieval nodes, ignoring others. - It was clarified that this behavior is by design, but a new `aggregate_all` option was introduced to collect all inputs as a list. - There was feedback that the "Aggregator" name is misleading since it only returns the first input, with suggestions for a separate "Merge" node to handle multiple inputs better. - The team is working on features to bind multiple knowledge base inputs directly to LLM nodes, reducing the need for manual merging. **Next Steps:** - Please let me know if this issue is still relevant to the latest version of Dify by commenting here to keep the discussion open. - Otherwise, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15626