When using parallelism, it may unexpectedly cause streaming output to fail. #13988

Closed
opened 2026-02-21 19:14:56 -05:00 by yindo · 8 comments
Owner

Originally created by @Reverse-Flash-Kamen on GitHub (May 18, 2025).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.4.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

https://github.com/user-attachments/assets/1bb68dd2-b9a6-4fd2-9d99-c4dbd5d7cf0a

https://github.com/user-attachments/assets/c1387f36-6eb5-4b70-bec0-253d6c5db6a1

Here is my DSL file

noStreaming.txt

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Reverse-Flash-Kamen on GitHub (May 18, 2025). ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.4.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce https://github.com/user-attachments/assets/1bb68dd2-b9a6-4fd2-9d99-c4dbd5d7cf0a https://github.com/user-attachments/assets/c1387f36-6eb5-4b70-bec0-253d6c5db6a1 Here is my DSL file [noStreaming.txt](https://github.com/user-attachments/files/20276536/noStreaming.txt) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:14:56 -05:00
Author
Owner

@Reverse-Flash-Kamen commented on GitHub (May 18, 2025):

Even after adding a variable aggregation node, the streaming output still cannot be used normally.

@Reverse-Flash-Kamen commented on GitHub (May 18, 2025): Even after adding a variable aggregation node, the streaming output still cannot be used normally.
Author
Owner

@dosubot[bot] commented on GitHub (May 18, 2025):

In Dify version 1.4.0, there are known limitations with parallelism that might affect streaming output. Specifically, when using parallelism, the same nodes cannot run in parallel across different conditional branches, and each node can only have one parallel ID [1]. Additionally, the variable aggregation node does not support streaming output, which is a design choice in Dify [2].

To address the issue with streaming output failing due to parallelism, consider the following:

  1. Separate Nodes for Parallel Execution: Ensure that you are not reusing the same nodes across different branches. Create separate, duplicate nodes for each parallel execution path.

  2. Nginx Configuration: If you are running Dify in a self-hosted Docker environment, check your Nginx configuration. The default setup might cache messages, leading to blocking output. Modify your Nginx configuration to support Server-Sent Events (SSE) to enable proper streaming output [3].

  3. Variable Aggregation Node: Since the variable aggregation node does not support streaming output, avoid using it if streaming is required in your workflow [2].

These steps should help mitigate the issues with streaming output when using parallelism in your Dify setup.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 18, 2025): <!-- Answer --> In Dify version 1.4.0, there are known limitations with parallelism that might affect streaming output. Specifically, when using parallelism, the same nodes cannot run in parallel across different conditional branches, and each node can only have one parallel ID <sup>[[1]](https://github.com/langgenius/dify/issues/18233)</sup>. Additionally, the variable aggregation node does not support streaming output, which is a design choice in Dify <sup>[[2]](https://github.com/langgenius/dify/issues/15351)</sup>. To address the issue with streaming output failing due to parallelism, consider the following: 1. **Separate Nodes for Parallel Execution**: Ensure that you are not reusing the same nodes across different branches. Create separate, duplicate nodes for each parallel execution path. 2. **Nginx Configuration**: If you are running Dify in a self-hosted Docker environment, check your Nginx configuration. The default setup might cache messages, leading to blocking output. Modify your Nginx configuration to support Server-Sent Events (SSE) to enable proper streaming output <sup>[[3]](https://github.com/langgenius/dify/issues/19324)</sup>. 3. **Variable Aggregation Node**: Since the variable aggregation node does not support streaming output, avoid using it if streaming is required in your workflow <sup>[[2]](https://github.com/langgenius/dify/issues/15351)</sup>. These steps should help mitigate the issues with streaming output when using parallelism in your Dify setup. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/1df25dd3-7a09-41ea-b7a7-9da8b3626f5a?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/1df25dd3-7a09-41ea-b7a7-9da8b3626f5a?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/1df25dd3-7a09-41ea-b7a7-9da8b3626f5a?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/1df25dd3-7a09-41ea-b7a7-9da8b3626f5a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1df25dd3-7a09-41ea-b7a7-9da8b3626f5a?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/1df25dd3-7a09-41ea-b7a7-9da8b3626f5a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1df25dd3-7a09-41ea-b7a7-9da8b3626f5a?feedback_type=other)</sup>
Author
Owner

@Reverse-Flash-Kamen commented on GitHub (May 18, 2025):

So, does that mean I have to give up streaming output if I want to use parallelism in the workflow? @dosu

@Reverse-Flash-Kamen commented on GitHub (May 18, 2025): So, does that mean I have to give up streaming output if I want to use parallelism in the workflow? @dosu
Author
Owner

@dosubot[bot] commented on GitHub (May 18, 2025):

No, you do not have to give up streaming output if you want to use parallelism in the workflow. The streaming output issue in complex Dify workflows can be resolved by applying the patch from PR #12355, which addresses the problem of streaming output switching to blocking mode when using 'if else' nodes in combination with answer nodes. A simple workflow without these nodes maintains normal streaming output [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 18, 2025): <!-- Answer --> No, you do not have to give up streaming output if you want to use parallelism in the workflow. The streaming output issue in complex Dify workflows can be resolved by applying the patch from PR #12355, which addresses the problem of streaming output switching to blocking mode when using 'if else' nodes in combination with answer nodes. A simple workflow without these nodes maintains normal streaming output <sup>[[1]](https://github.com/langgenius/dify/issues/11985)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b15111af-a9f6-4e50-8d54-f6e320aaa5d4?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b15111af-a9f6-4e50-8d54-f6e320aaa5d4?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b15111af-a9f6-4e50-8d54-f6e320aaa5d4?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b15111af-a9f6-4e50-8d54-f6e320aaa5d4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b15111af-a9f6-4e50-8d54-f6e320aaa5d4?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/b15111af-a9f6-4e50-8d54-f6e320aaa5d4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b15111af-a9f6-4e50-8d54-f6e320aaa5d4?feedback_type=other)</sup>
Author
Owner

@Reverse-Flash-Kamen commented on GitHub (May 18, 2025):

It's not that using if-else nodes causes the streaming output to switch to blocking mode. Now, as long as I use parallelism, this issue will be reproduced. @dosu

@Reverse-Flash-Kamen commented on GitHub (May 18, 2025): It's not that using if-else nodes causes the streaming output to switch to blocking mode. Now, as long as I use parallelism, this issue will be reproduced. @dosu
Author
Owner

@dosubot[bot] commented on GitHub (May 18, 2025):

To resolve streaming output issues when using parallelism in Dify version 1.4.0, you can try wrapping the problematic nodes (such as LLM and response components) in a loop component that iterates only once. This configuration has been confirmed to restore normal streaming output functionality [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 18, 2025): <!-- Answer --> To resolve streaming output issues when using parallelism in Dify version 1.4.0, you can try wrapping the problematic nodes (such as LLM and response components) in a loop component that iterates only once. This configuration has been confirmed to restore normal streaming output functionality <sup>[[1]](https://github.com/langgenius/dify/issues/16882)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/5ce97680-ba43-4c76-92e6-53f500a3657b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/5ce97680-ba43-4c76-92e6-53f500a3657b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/5ce97680-ba43-4c76-92e6-53f500a3657b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/5ce97680-ba43-4c76-92e6-53f500a3657b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5ce97680-ba43-4c76-92e6-53f500a3657b?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/5ce97680-ba43-4c76-92e6-53f500a3657b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5ce97680-ba43-4c76-92e6-53f500a3657b?feedback_type=other)</sup>
Author
Owner

@Reverse-Flash-Kamen commented on GitHub (May 19, 2025):

I merged complex parallel operations into the workflow and called the workflow in Chatflow, which allows normal use of streaming output. I found that the current version supports passing parameters to workflows—thanks for the update! However, I still wonder how to use both parallel operations and streaming output in Chatflow.

@Reverse-Flash-Kamen commented on GitHub (May 19, 2025): I merged complex parallel operations into the workflow and called the workflow in Chatflow, which allows normal use of streaming output. I found that the current version supports passing parameters to workflows—thanks for the update! However, I still wonder how to use both parallel operations and streaming output in Chatflow.
Author
Owner

@Reverse-Flash-Kamen commented on GitHub (May 28, 2025):

My new problem is with the Variable Aggregator node – if you want to use streaming output, you must not use this node in Chatflow.

@Reverse-Flash-Kamen commented on GitHub (May 28, 2025): My new problem is with the Variable Aggregator node – if you want to use streaming output, you must not use this node in Chatflow.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13988