Flows passing through multiple conditional nodes fail to stream their final output. #15925

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

Originally created by @lee-cancel on GitHub (Aug 5, 2025).

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

1.7.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

In a chatflow application, chaining two conditional nodes prevents the final answer from being streamed. To reproduce:

  1. Place Conditional Node A and create a few branches.
  2. Route every branch from A to Conditional Node B.
  3. After each branch of B, attach an independent LLM node followed by a direct-output node.
  4. Test with different condition combinations.
    Only when both nodes take their ELSE branch is the final answer streamed token-by-token. All other paths wait for the LLM to finish and then return the entire response at once.
    The attached DSL file reproduces the issue.

✔️ Expected Behavior

Regardless of the route taken through Conditional Node A and Conditional Node B, every path that ends with an LLM + direct-output node should stream the LLM’s response token-by-token, exactly as it does when both nodes fall through their ELSE branches.

Actual Behavior

bug_test.txt

Originally created by @lee-cancel on GitHub (Aug 5, 2025). ### 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 1.7.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce In a chatflow application, chaining two conditional nodes prevents the final answer from being streamed. To reproduce: 1. Place Conditional Node A and create a few branches. 2. Route every branch from A to Conditional Node B. 3. After each branch of B, attach an independent LLM node followed by a direct-output node. 4. Test with different condition combinations. Only when both nodes take their ELSE branch is the final answer streamed token-by-token. All other paths wait for the LLM to finish and then return the entire response at once. The attached DSL file reproduces the issue. ### ✔️ Expected Behavior Regardless of the route taken through Conditional Node A and Conditional Node B, every path that ends with an LLM + direct-output node should stream the LLM’s response token-by-token, exactly as it does when both nodes fall through their ELSE branches. ### ❌ Actual Behavior [bug_test.txt](https://github.com/user-attachments/files/21609230/bug_test.txt)
yindo added the 🌊 feat:workflow label 2026-02-21 19:23:59 -05:00
yindo closed this issue 2026-02-21 19:23:59 -05:00
Author
Owner

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

Hi @lee-cancel! I'm Dosu and I’m helping the dify team.

This is a known and recurring bug in Dify: when multiple conditional nodes (IF/ELSE) are chained and their branches merge before reaching an LLM + direct-output node, streaming output is blocked. The workflow engine conservatively waits for all possible dependencies of the answer node to finish—even if only one branch is actually active—so streaming is held back at these join points. That's why streaming only works when both conditionals take their ELSE branch, which avoids the merge and leaves no unresolved dependencies. In all other cases, the output is returned all at once after the LLM finishes, not token-by-token as expected. This limitation is documented in several issues and code comments, and is not fully fixed as of 1.7.0 or the latest releases (example).

There’s no simple config workaround. Some users have had success restructuring the workflow to avoid join points, or by wrapping the problematic nodes inside a Loop node that runs once, which can sometimes restore streaming (example). The Dify team is aware of the architectural limitation and there are ongoing efforts to address it, but a robust solution for streaming through conditional joins is still in progress. If you want to track progress or see related discussions, check issues like #22686 and #17085. Let me know if you want more details on workflow design or possible workarounds.

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 (Aug 5, 2025): <!-- Greeting --> Hi @lee-cancel! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This is a known and recurring bug in Dify: when multiple conditional nodes (IF/ELSE) are chained and their branches merge before reaching an LLM + direct-output node, streaming output is blocked. The workflow engine conservatively waits for all possible dependencies of the answer node to finish—even if only one branch is actually active—so streaming is held back at these join points. That's why streaming only works when both conditionals take their ELSE branch, which avoids the merge and leaves no unresolved dependencies. In all other cases, the output is returned all at once after the LLM finishes, not token-by-token as expected. This limitation is documented in several issues and code comments, and is not fully fixed as of 1.7.0 or the latest releases ([example](https://github.com/langgenius/dify/issues/22686)). There’s no simple config workaround. Some users have had success restructuring the workflow to avoid join points, or by wrapping the problematic nodes inside a Loop node that runs once, which can sometimes restore streaming ([example](https://github.com/langgenius/dify/issues/17085)). The Dify team is aware of the architectural limitation and there are ongoing efforts to address it, but a robust solution for streaming through conditional joins is still in progress. If you want to track progress or see related discussions, check issues like [#22686](https://github.com/langgenius/dify/issues/22686) and [#17085](https://github.com/langgenius/dify/issues/17085). Let me know if you want more details on workflow design or possible workarounds. <!-- 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/91d9e3c6-28be-4701-bcbb-a689367957a3?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/91d9e3c6-28be-4701-bcbb-a689367957a3?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/91d9e3c6-28be-4701-bcbb-a689367957a3?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/91d9e3c6-28be-4701-bcbb-a689367957a3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/91d9e3c6-28be-4701-bcbb-a689367957a3?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/91d9e3c6-28be-4701-bcbb-a689367957a3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/91d9e3c6-28be-4701-bcbb-a689367957a3?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/23469)
Author
Owner

@lee-cancel commented on GitHub (Aug 5, 2025):

Thank you for your reply. Looking forward to a more robust fix!

@lee-cancel commented on GitHub (Aug 5, 2025): Thank you for your reply. Looking forward to a more robust fix!
Author
Owner

@lithStudy commented on GitHub (Aug 14, 2025):

https://github.com/langgenius/dify/pull/12105

This issue previously occurred and has now resurfaced.

@lithStudy commented on GitHub (Aug 14, 2025): https://github.com/langgenius/dify/pull/12105 This issue previously occurred and has now resurfaced.
Author
Owner

@dosubot[bot] commented on GitHub (Sep 15, 2025):

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

Issue Summary:

  • You reported a bug in Dify v1.7.0 (self-hosted Docker) where chatflows with multiple conditional nodes do not stream LLM output token-by-token unless both conditionals take their ELSE branches.
  • The root cause is a known architectural limitation: the workflow engine waits for all dependencies at conditional joins, which blocks streaming.
  • Workarounds suggested include restructuring workflows or using a Loop node to avoid blocking.
  • The issue remains unresolved and is related to ongoing discussions in issues #22686 and #17085.
  • Another user, lithStudy, confirmed the problem has recurred and linked a related PR #12105.

Next Steps:

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

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Sep 15, 2025): Hi, @lee-cancel. 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 a bug in Dify v1.7.0 (self-hosted Docker) where chatflows with multiple conditional nodes do not stream LLM output token-by-token unless both conditionals take their ELSE branches. - The root cause is a known architectural limitation: the workflow engine waits for all dependencies at conditional joins, which blocks streaming. - Workarounds suggested include restructuring workflows or using a Loop node to avoid blocking. - The issue remains unresolved and is related to ongoing discussions in issues #22686 and #17085. - Another user, lithStudy, confirmed the problem has recurred and linked a related PR #12105. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of Dify by commenting here to keep the discussion open. - Otherwise, I will automatically close this issue 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#15925