When a workflow uses two or more LLM models, streaming output fails. #13996

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

Originally created by @zv246 on GitHub (May 19, 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.3.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Two LLM models are used in the execution of a workflow, and the streaming output cannot be implemented in the output of the last direct answer.
The other branch only uses one LLM model, which will not exhibit such phenomena and can stream the output normally.

Image

✔️ Expected Behavior

Finally, the LLM model output is installed in the form of streaming output

Actual Behavior

Finally, it is output together after the large model answer is completed。

Originally created by @zv246 on GitHub (May 19, 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.3.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Two LLM models are used in the execution of a workflow, and the streaming output cannot be implemented in the output of the last direct answer. The other branch only uses one LLM model, which will not exhibit such phenomena and can stream the output normally. ![Image](https://github.com/user-attachments/assets/593bdd42-4c89-40cb-81c9-7ee9574718ae) ### ✔️ Expected Behavior Finally, the LLM model output is installed in the form of streaming output ### ❌ Actual Behavior Finally, it is output together after the large model answer is completed。
yindo added the 🌊 feat:workflow label 2026-02-21 19:14:58 -05:00
yindo closed this issue 2026-02-21 19:14:59 -05:00
Author
Owner

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

The issue you're experiencing with streaming output failing when using multiple LLM models in a workflow might be related to the design of the workflow itself. Here are some considerations and solutions:

  1. Patch Application: Ensure that you have applied the patch from PR #12355, which addresses issues where streaming output turns into blocking mode output, especially when using 'if else' nodes in combination with answer nodes [1].

  2. Variable Aggregator Nodes: Note that variable aggregator nodes do not support streaming output by design. If your workflow includes these nodes, it might cause the streaming output to fail [2].

  3. Workflow Design: If your workflow involves loops or conditional branches, consider replacing loops with iteration modules after code processing to maintain streaming output functionality [3].

  4. Version Compatibility: Ensure that your deployment configurations are compatible with Dify's streaming requirements, especially if using specific versions of models or deployment setups that might have known issues [4].

By addressing these points, you should be able to resolve the streaming output issue in your workflow.

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 19, 2025): <!-- Answer --> The issue you're experiencing with streaming output failing when using multiple LLM models in a workflow might be related to the design of the workflow itself. Here are some considerations and solutions: 1. **Patch Application**: Ensure that you have applied the patch from PR #12355, which addresses issues where streaming output turns into blocking mode output, especially when using 'if else' nodes in combination with answer nodes <sup>[[1]](https://github.com/langgenius/dify/issues/11985)</sup>. 2. **Variable Aggregator Nodes**: Note that variable aggregator nodes do not support streaming output by design. If your workflow includes these nodes, it might cause the streaming output to fail <sup>[[2]](https://github.com/langgenius/dify/issues/16647)</sup>. 3. **Workflow Design**: If your workflow involves loops or conditional branches, consider replacing loops with iteration modules after code processing to maintain streaming output functionality <sup>[[3]](https://github.com/langgenius/dify/issues/17626)</sup>. 4. **Version Compatibility**: Ensure that your deployment configurations are compatible with Dify's streaming requirements, especially if using specific versions of models or deployment setups that might have known issues <sup>[[4]](https://github.com/langgenius/dify/issues/12143)</sup>. By addressing these points, you should be able to resolve the streaming output issue in your workflow. <!-- 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/2a903a27-97c8-4f79-b5b1-b61c55d086e3?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/2a903a27-97c8-4f79-b5b1-b61c55d086e3?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/2a903a27-97c8-4f79-b5b1-b61c55d086e3?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/2a903a27-97c8-4f79-b5b1-b61c55d086e3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2a903a27-97c8-4f79-b5b1-b61c55d086e3?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/2a903a27-97c8-4f79-b5b1-b61c55d086e3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2a903a27-97c8-4f79-b5b1-b61c55d086e3?feedback_type=other)</sup>
Author
Owner

@zv246 commented on GitHub (May 19, 2025):

在工作流中使用多个 LLM 模型时,您遇到的流式输出失败的问题可能与工作流本身的设计有关。以下是一些注意事项和解决方案:

  1. 补丁应用程序:确保您已从 PR 应用补丁修复:特别针对快捷方式的 Only Answer 的问题 #12355,它解决了流式输出变成阻塞模式输出的问题,尤其是在将“if else”节点与应答节点结合使用时[1].
  2. Variable Aggregator Nodes(可变聚合器节点):请注意,可变聚合器节点在设计上不支持流式输出。如果您的工作流程包含这些节点,则可能会导致流式处理输出失败[2].
  3. 工作流设计:如果您的工作流涉及循环或条件分支,请考虑在代码处理后将循环替换为迭代模块,以保持流式输出功能[3].
  4. 版本兼容性:确保您的部署配置与 Dify 的流式处理要求兼容,尤其是在使用可能存在已知问题的特定模型版本或部署设置时[4].

None of this fits my case,This is a BGU。This happens when multiple LLM models are used during the execution of a workflow.

@zv246 commented on GitHub (May 19, 2025): > 在工作流中使用多个 LLM 模型时,您遇到的流式输出失败的问题可能与工作流本身的设计有关。以下是一些注意事项和解决方案: > > 1. **补丁应用程序**:确保您已从 PR 应用补丁[修复:特别针对快捷方式的 Only Answer 的问题 #12355](https://github.com/langgenius/dify/pull/12355),它解决了流式输出变成阻塞模式输出的问题,尤其是在将“if else”节点与应答节点结合使用时[[1]](https://github.com/langgenius/dify/issues/11985). > 2. **Variable Aggregator Nodes(可变聚合器节点**):请注意,可变聚合器节点在设计上不支持流式输出。如果您的工作流程包含这些节点,则可能会导致流式处理输出失败[[2]](https://github.com/langgenius/dify/issues/16647). > 3. **工作流设计**:如果您的工作流涉及循环或条件分支,请考虑在代码处理后将循环替换为迭代模块,以保持流式输出功能[[3]](https://github.com/langgenius/dify/issues/17626). > 4. **版本兼容性**:确保您的部署配置与 Dify 的流式处理要求兼容,尤其是在使用可能存在已知问题的特定模型版本或部署设置时[[4]](https://github.com/langgenius/dify/issues/12143). > None of this fits my case,This is a BGU。This happens when multiple LLM models are used during the execution of a workflow.
Author
Owner

@crazywoola commented on GitHub (May 19, 2025):

Fixed in v1.4.0

@crazywoola commented on GitHub (May 19, 2025): Fixed in v1.4.0
Author
Owner

@Maxence commented on GitHub (Jun 4, 2025):

I got the same issue in 1.4.1
I removed my Variable Aggregator Node and I don't use Loop but I use multiple LLM node.
Anyone got this issue in 1.4.1 ?

@Maxence commented on GitHub (Jun 4, 2025): I got the same issue in 1.4.1 I removed my Variable Aggregator Node and I don't use Loop but I use multiple LLM node. Anyone got this issue in 1.4.1 ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13996