Conditional Branch Logic Leads to Unexpected Reply and Blocks Response Streaming #17615

Closed
opened 2026-02-21 19:37:31 -05:00 by yindo · 0 comments
Owner

Originally created by @xwxsee2014 on GitHub (Sep 17, 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.8.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Here is my testing DSL file to reproduce this issue: test2.yml
Create a Chatflow containing two "Conditional Branch" nodes. The if condition of the first "Conditional Branch" node should directly connect to the second "Conditional Branch" node, while the else branch connects to any other type of node, such as a "Variable Assignment" node as shown in the DSL I uploaded. Then, the if condition of the second "Conditional Branch" node should connect to a "Direct Reply" node configured with a constant string (e.g., "I cannot answer this question"), and the else branch should connect to an "LLM" node. The "LLM" node should then connect to a "Direct Reply" node and output the LLM's text.

Start a new session and provide input such that the first "Conditional Branch" node follows the else branch and the second "Conditional Branch" node also follows the else branch.

In the same session, provide another input such that the first "Conditional Branch" node follows the if branch, but the second "Conditional Branch" node still follows the else branch.

At this point, the response to the second input will display the content from the "Direct Reply" node connected to the if condition of the second "Conditional Branch" node, such as "I cannot answer this question." Additionally, the LLM's response will not be streamed but will be displayed in full on the interface after complete output.
Just Like:

Image

✔️ Expected Behavior

The response to the second input should not contain the "I cannot answer this question" text, and the output should be in streaming mode.

Actual Behavior

The response to the second input will display the content from the "Direct Reply" node connected to the if condition of the second "Conditional Branch" node, such as "I cannot answer this question." Additionally, the LLM's response will not be streamed but will be displayed in full on the interface after complete output.
Just Like:

Image
Originally created by @xwxsee2014 on GitHub (Sep 17, 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.8.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Here is my testing DSL file to reproduce this issue: [test2.yml](https://github.com/user-attachments/files/22382012/test2.yml) Create a Chatflow containing two "Conditional Branch" nodes. The if condition of the first "Conditional Branch" node should directly connect to the second "Conditional Branch" node, while the else branch connects to any other type of node, such as a "Variable Assignment" node as shown in the DSL I uploaded. Then, the if condition of the second "Conditional Branch" node should connect to a "Direct Reply" node configured with a constant string (e.g., "I cannot answer this question"), and the else branch should connect to an "LLM" node. The "LLM" node should then connect to a "Direct Reply" node and output the LLM's text. Start a new session and provide input such that the first "Conditional Branch" node follows the else branch and the second "Conditional Branch" node also follows the else branch. In the same session, provide another input such that the first "Conditional Branch" node follows the if branch, but the second "Conditional Branch" node still follows the else branch. At this point, the response to the second input will display the content from the "Direct Reply" node connected to the if condition of the second "Conditional Branch" node, such as "I cannot answer this question." Additionally, the LLM's response will not be streamed but will be displayed in full on the interface after complete output. Just Like: <img width="1564" height="860" alt="Image" src="https://github.com/user-attachments/assets/828da583-7210-44cb-bba0-1be2dc598557" /> ### ✔️ Expected Behavior The response to the second input should not contain the "I cannot answer this question" text, and the output should be in streaming mode. ### ❌ Actual Behavior The response to the second input will display the content from the "Direct Reply" node connected to the if condition of the second "Conditional Branch" node, such as "I cannot answer this question." Additionally, the LLM's response will not be streamed but will be displayed in full on the interface after complete output. Just Like: <img width="1564" height="860" alt="Image" src="https://github.com/user-attachments/assets/828da583-7210-44cb-bba0-1be2dc598557" />
yindo added the 🐞 bug label 2026-02-21 19:37:31 -05:00
yindo closed this issue 2026-02-21 19:37:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#17615