When using workflow, I found that when I used streaming output, it was normal in other branches, but failed in this branch. It was output in one big block. #12653

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

Originally created by @mozou on GitHub (Apr 8, 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.01

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

First of all, I didn't do any exception handling.
【首先,我并没有做异常处理的返回值】

I found that when I used streaming output, it was normal in other branches, but failed in this branch. It was output in one big block.
【我发现我使用流式输出,在其他分支是正常的,只有在这个分支处理失败了。变成一大块一起输出。】

Whether Dify is running in the workflow or my own code, it is returned as a whole block
【不管是Dify在工作流中的运行,还是我自己的代码,都是一整块返回】

It should have generated multiple text_chunk blocks, but only one text_chunk was returned. Because this branch is associated with a lot of database data, I don't know if this is the reason
【他本来应该是生成多个 text_chunk 块,但是却只返回了一个 text_chunk 。因为这个分支会关联非常多的数据库数据,我不清楚是不是这个原因】

Image

✔️ Expected Behavior

Image

Actual Behavior

Image

Originally created by @mozou on GitHub (Apr 8, 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.01 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce First of all, I didn't do any exception handling. 【首先,我并没有做异常处理的返回值】 I found that when I used streaming output, it was normal in other branches, but failed in this branch. It was output in one big block. 【我发现我使用流式输出,在其他分支是正常的,只有在这个分支处理失败了。变成一大块一起输出。】 Whether Dify is running in the workflow or my own code, it is returned as a whole block 【不管是Dify在工作流中的运行,还是我自己的代码,都是一整块返回】 It should have generated multiple text_chunk blocks, but only one text_chunk was returned. Because this branch is associated with a lot of database data, I don't know if this is the reason 【他本来应该是生成多个 text_chunk 块,但是却只返回了一个 text_chunk 。因为这个分支会关联非常多的数据库数据,我不清楚是不是这个原因】 ![Image](https://github.com/user-attachments/assets/5d63ddea-4aee-45d7-9589-5e23133ff126) ### ✔️ Expected Behavior ![Image](https://github.com/user-attachments/assets/07e9e21f-3207-4a54-8b1c-c7832ef45d9d) ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/6b849cfd-12ed-430a-86d4-da2440700b7b)
yindo added the 🌊 feat:workflow label 2026-02-21 19:08:22 -05:00
yindo closed this issue 2026-02-21 19:08:22 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

Hi @mozou! 👋 I'm Dosu, your friendly bot here to help you solve bugs, answer questions, and guide you in becoming a contributor. I'm waiting alongside you for a human maintainer, so let's tackle this together! 😊

There is a known issue with Dify version 1.01 that affects streaming output in workflows. Specifically, the streaming output of conversations fails when there are nodes with exception handling settings in the chat flow, even if you haven't explicitly set exception handling. This is a confirmed bug in version 1.01, and there is currently no workaround available. It is recommended to wait for the next version update for a fix [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 (Apr 8, 2025): <!-- Greeting --> Hi @mozou! 👋 I'm [Dosu](https://dosu.dev), your friendly bot here to help you solve bugs, answer questions, and guide you in becoming a contributor. I'm waiting alongside you for a human maintainer, so let's tackle this together! 😊 <!-- Answer --> There is a known issue with Dify version 1.01 that affects streaming output in workflows. Specifically, the streaming output of conversations fails when there are nodes with exception handling settings in the chat flow, even if you haven't explicitly set exception handling. This is a confirmed bug in version 1.01, and there is currently no workaround available. It is recommended to wait for the next version update for a fix <sup>[[1]](https://github.com/langgenius/dify/issues/16004)</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/7089d6cd-97f4-41e3-b91e-85d1be3c680f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/7089d6cd-97f4-41e3-b91e-85d1be3c680f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/7089d6cd-97f4-41e3-b91e-85d1be3c680f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/7089d6cd-97f4-41e3-b91e-85d1be3c680f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7089d6cd-97f4-41e3-b91e-85d1be3c680f?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/7089d6cd-97f4-41e3-b91e-85d1be3c680f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7089d6cd-97f4-41e3-b91e-85d1be3c680f?feedback_type=other)</sup>
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

@dosu However, when I ran the test directly in the workflow in Dify, all nodes passed without any exceptions, but the output was also a whole block.
【但是我在 Dify中的工作流中直接运行测试,所有的节点都没有出现异常,全部都是通过的,但是也是整块输出。】

Image

@mozou commented on GitHub (Apr 8, 2025): @dosu However, when I ran the test directly in the workflow in Dify, all nodes passed without any exceptions, but the output was also a whole block. 【但是我在 Dify中的工作流中直接运行测试,所有的节点都没有出现异常,全部都是通过的,但是也是整块输出。】 ![Image](https://github.com/user-attachments/assets/bb5cfd22-4594-4f10-9fe5-187e2800e362)
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

The issue you're experiencing with the streaming output resulting in a single block, even when all nodes pass without exceptions, is likely related to the use of 'if else' nodes in combination with answer nodes. This is a known issue in Dify versions 0.14.1/0.14.2, where the streaming output switches to blocking mode under these conditions. Although you are using version 1.01, similar behavior might still be present. Applying the patch from PR #12355 could potentially resolve this issue [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 (Apr 8, 2025): <!-- Answer --> The issue you're experiencing with the streaming output resulting in a single block, even when all nodes pass without exceptions, is likely related to the use of 'if else' nodes in combination with answer nodes. This is a known issue in Dify versions 0.14.1/0.14.2, where the streaming output switches to blocking mode under these conditions. Although you are using version 1.01, similar behavior might still be present. Applying the patch from PR #12355 could potentially resolve this issue <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/ad7d06c8-6023-42a9-89b2-0913d7c8890e?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/ad7d06c8-6023-42a9-89b2-0913d7c8890e?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/ad7d06c8-6023-42a9-89b2-0913d7c8890e?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/ad7d06c8-6023-42a9-89b2-0913d7c8890e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ad7d06c8-6023-42a9-89b2-0913d7c8890e?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/ad7d06c8-6023-42a9-89b2-0913d7c8890e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ad7d06c8-6023-42a9-89b2-0913d7c8890e?feedback_type=other)</sup>
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

@dosu In fact, I use a code processor at the end of the if-else to aggregate them, then return them to LLM, and finally output the answer.
【事实上,我对于 if-else 在最后使用了一个代码处理器来聚合他们,然后返回给LLM,最后才输出答案。】

@mozou commented on GitHub (Apr 8, 2025): @dosu In fact, I use a code processor at the end of the if-else to aggregate them, then return them to LLM, and finally output the answer. 【事实上,我对于 if-else 在最后使用了一个代码处理器来聚合他们,然后返回给LLM,最后才输出答案。】
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

The code processor, specifically the ConditionProcessor, plays a crucial role in Dify workflows when used at the end of an if-else structure. It processes the conditions associated with each case in the if-else node, evaluating them using the provided variable_pool and logical operators. If a case's conditions evaluate to true, it facilitates a logical short-circuit, allowing the workflow to select the corresponding case and terminate further condition checks [1][2].

Additionally, the aggregation process in the code processor involves transforming the execution result into a validated and structured output format. This ensures that the output is consistent, valid, and within defined constraints before being returned to the LLM [3].

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 (Apr 8, 2025): <!-- Answer --> The code processor, specifically the `ConditionProcessor`, plays a crucial role in Dify workflows when used at the end of an if-else structure. It processes the conditions associated with each case in the if-else node, evaluating them using the provided `variable_pool` and logical operators. If a case's conditions evaluate to true, it facilitates a logical short-circuit, allowing the workflow to select the corresponding case and terminate further condition checks <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/if_else/if_else_node.py)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/workflow/utils/condition/processor.py)</sup>. Additionally, the aggregation process in the code processor involves transforming the execution result into a validated and structured output format. This ensures that the output is consistent, valid, and within defined constraints before being returned to the LLM <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/code/code_node.py)</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/f93a735d-4b3d-404a-b157-e22a7e47452b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/f93a735d-4b3d-404a-b157-e22a7e47452b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/f93a735d-4b3d-404a-b157-e22a7e47452b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/f93a735d-4b3d-404a-b157-e22a7e47452b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f93a735d-4b3d-404a-b157-e22a7e47452b?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/f93a735d-4b3d-404a-b157-e22a7e47452b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f93a735d-4b3d-404a-b157-e22a7e47452b?feedback_type=other)</sup>
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

@dosu So, why is this link streaming down and what can I do about it?
【所以,为什么这个链路出现了流式中断,我该如何做?】

@mozou commented on GitHub (Apr 8, 2025): @dosu So, why is this link streaming down and what can I do about it? 【所以,为什么这个链路出现了流式中断,我该如何做?】
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

The streaming output is interrupted due to the use of 'if else' nodes in combination with answer nodes, which causes the streaming output to switch to blocking mode. Additionally, enabling exception handling in Dify workflow nodes can also affect streaming output functionality. To resolve this, apply the patch from PR #12355 and disable exception handling in the workflow nodes. A simple workflow without these nodes and exception handling maintains normal streaming output [1][2].

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 (Apr 8, 2025): <!-- Answer --> The streaming output is interrupted due to the use of 'if else' nodes in combination with answer nodes, which causes the streaming output to switch to blocking mode. Additionally, enabling exception handling in Dify workflow nodes can also affect streaming output functionality. To resolve this, apply the patch from PR #12355 and disable exception handling in the workflow nodes. A simple workflow without these nodes and exception handling maintains normal streaming output <sup>[[1]](https://github.com/langgenius/dify/issues/11985)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/15458)</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/3ab76213-bfc5-4a9e-9f9a-65a392260728?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/3ab76213-bfc5-4a9e-9f9a-65a392260728?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/3ab76213-bfc5-4a9e-9f9a-65a392260728?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/3ab76213-bfc5-4a9e-9f9a-65a392260728?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3ab76213-bfc5-4a9e-9f9a-65a392260728?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/3ab76213-bfc5-4a9e-9f9a-65a392260728?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3ab76213-bfc5-4a9e-9f9a-65a392260728?feedback_type=other)</sup>
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

@dosu I checked the source code and found that this part has been commented out in version 1.01, so PR #12355 seems to be invalid.
【我查看了源码,发现在1.01版本这部分已经被注释掉了,所以 PR #12355 好像无效了】

                    # remove unreachable nodes
                    # FIXME: because of the code branch can combine directly, so for answer node
                    # we remove the node maybe shortcut the answer node, so comment this code for now
                    # there is not effect on the answer node and the workflow, when we have a better solution
                    # we can open this code. Issues: #11542 #9560 #10638 #10564
                    # ids = self._fetch_node_ids_in_reachable_branch(edge.target_node_id)
                    # if "answer" in ids:
                    #     continue
                    # else:
                    #     reachable_node_ids.extend(ids)

                    # The branch_identify parameter is added to ensure that
                    # only nodes in the correct logical branch are included.
                    reachable_node_ids.append(edge.target_node_id)
                    ids = self._fetch_node_ids_in_reachable_branch(edge.target_node_id, run_result.edge_source_handle)
                    reachable_node_ids.extend(ids)
@mozou commented on GitHub (Apr 8, 2025): @dosu I checked the source code and found that this part has been commented out in version 1.01, so PR #12355 seems to be invalid. 【我查看了源码,发现在1.01版本这部分已经被注释掉了,所以 PR #12355 好像无效了】 ```python # remove unreachable nodes # FIXME: because of the code branch can combine directly, so for answer node # we remove the node maybe shortcut the answer node, so comment this code for now # there is not effect on the answer node and the workflow, when we have a better solution # we can open this code. Issues: #11542 #9560 #10638 #10564 # ids = self._fetch_node_ids_in_reachable_branch(edge.target_node_id) # if "answer" in ids: # continue # else: # reachable_node_ids.extend(ids) # The branch_identify parameter is added to ensure that # only nodes in the correct logical branch are included. reachable_node_ids.append(edge.target_node_id) ids = self._fetch_node_ids_in_reachable_branch(edge.target_node_id, run_result.edge_source_handle) reachable_node_ids.extend(ids)
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

In version 1.01, the code related to removing unreachable nodes has been commented out, which affects the handling of answer nodes in workflows. This change was made to prevent shortcutting answer nodes, ensuring that the workflow logic remains intact even when nodes are combined directly. As a result, the patch from PR #12355 is indeed invalid for version 1.01 because the relevant code has been disabled.

To address the streaming output issue, you might need to explore alternative solutions or wait for a future update that provides a more robust fix. Currently, the commented-out code indicates that a better solution is anticipated, but not yet implemented [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 (Apr 8, 2025): <!-- Answer --> In version 1.01, the code related to removing unreachable nodes has been commented out, which affects the handling of answer nodes in workflows. This change was made to prevent shortcutting answer nodes, ensuring that the workflow logic remains intact even when nodes are combined directly. As a result, the patch from PR #12355 is indeed invalid for version 1.01 because the relevant code has been disabled. To address the streaming output issue, you might need to explore alternative solutions or wait for a future update that provides a more robust fix. Currently, the commented-out code indicates that a better solution is anticipated, but not yet implemented <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/answer/base_stream_processor.py)</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/10b0abc0-76f4-44f6-bde1-d3940254cc86?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/10b0abc0-76f4-44f6-bde1-d3940254cc86?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/10b0abc0-76f4-44f6-bde1-d3940254cc86?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/10b0abc0-76f4-44f6-bde1-d3940254cc86?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/10b0abc0-76f4-44f6-bde1-d3940254cc86?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/10b0abc0-76f4-44f6-bde1-d3940254cc86?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/10b0abc0-76f4-44f6-bde1-d3940254cc86?feedback_type=other)</sup>
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

@dosu So is there no solution now? Can we only shorten the if-else relationship? Or is there a better design idea? For example, use a method to receive in advance?【所以现在是没有办法解决了吗?只能缩短if-else 关联吗?或者是还有更好的设计思路?比如使用某个方法提前接收?】

@mozou commented on GitHub (Apr 8, 2025): @dosu So is there no solution now? Can we only shorten the if-else relationship? Or is there a better design idea? For example, use a method to receive in advance?【所以现在是没有办法解决了吗?只能缩短if-else 关联吗?或者是还有更好的设计思路?比如使用某个方法提前接收?】
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

The solution to the streaming output issue in Dify version 1.01 is to update to a version that includes the patch from PR #12355, which addresses the problem. If updating is not possible, you can try applying the patch from PR #12355 directly. There is no need to shorten the if-else relationship or use a different design idea, as the issue has been addressed in the patch [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 (Apr 8, 2025): <!-- Answer --> The solution to the streaming output issue in Dify version 1.01 is to update to a version that includes the patch from PR #12355, which addresses the problem. If updating is not possible, you can try applying the patch from PR #12355 directly. There is no need to shorten the if-else relationship or use a different design idea, as the issue has been addressed in the patch <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/f7aa367b-e76a-4c47-95f5-f0674a561bc4?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/f7aa367b-e76a-4c47-95f5-f0674a561bc4?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/f7aa367b-e76a-4c47-95f5-f0674a561bc4?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/f7aa367b-e76a-4c47-95f5-f0674a561bc4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f7aa367b-e76a-4c47-95f5-f0674a561bc4?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/f7aa367b-e76a-4c47-95f5-f0674a561bc4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f7aa367b-e76a-4c47-95f5-f0674a561bc4?feedback_type=other)</sup>
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

@dosu But the code of PR #12355 has been commented out! 【但是PR #12355的代码都已经被注释掉了啊!】

@mozou commented on GitHub (Apr 8, 2025): @dosu But the code of PR #12355 has been commented out! 【但是PR #12355的代码都已经被注释掉了啊!】
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

In Dify version 1.01, the code related to PR #12355 has indeed been commented out, which means the patch is not applicable in this version. This change was made to prevent shortcutting answer nodes, and a better solution is anticipated but not yet implemented. Currently, there is no alternative solution provided in the codebase for this specific issue. You might need to wait for a future update that addresses this problem more robustly [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 (Apr 8, 2025): <!-- Answer --> In Dify version 1.01, the code related to PR #12355 has indeed been commented out, which means the patch is not applicable in this version. This change was made to prevent shortcutting answer nodes, and a better solution is anticipated but not yet implemented. Currently, there is no alternative solution provided in the codebase for this specific issue. You might need to wait for a future update that addresses this problem more robustly <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/answer/base_stream_processor.py)</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/31b6d282-4fcc-4925-96f2-c6bcc48a8535?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/31b6d282-4fcc-4925-96f2-c6bcc48a8535?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/31b6d282-4fcc-4925-96f2-c6bcc48a8535?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/31b6d282-4fcc-4925-96f2-c6bcc48a8535?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/31b6d282-4fcc-4925-96f2-c6bcc48a8535?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/31b6d282-4fcc-4925-96f2-c6bcc48a8535?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/31b6d282-4fcc-4925-96f2-c6bcc48a8535?feedback_type=other)</sup>
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

The robot is no longer useful, so does anyone else know how to deal with it?
【机器人已经不管用了,所以有没有其他大佬知道该怎么处理?】

@mozou commented on GitHub (Apr 8, 2025): The robot is no longer useful, so does anyone else know how to deal with it? 【机器人已经不管用了,所以有没有其他大佬知道该怎么处理?】
Author
Owner

@DavideDelbianco commented on GitHub (Apr 8, 2025):

duplicate of #17085

@DavideDelbianco commented on GitHub (Apr 8, 2025): duplicate of #17085
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

@dosu According to PR #17085, the LLM in the loop cannot be used to end, so I cannot get the answer from LLM.
【我根据PR #17085 后在循环中的LLM无法使用结束,所以导致我无法获取到LLM的回答。】

Image

@mozou commented on GitHub (Apr 8, 2025): @dosu According to PR #17085, the LLM in the loop cannot be used to end, so I cannot get the answer from LLM. 【我根据PR #17085 后在循环中的LLM无法使用结束,所以导致我无法获取到LLM的回答。】 ![Image](https://github.com/user-attachments/assets/e94319af-0190-4c06-997a-851449458a68)
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

To address the issue where the LLM in a loop cannot be used to end, preventing you from getting the answer from the LLM, you can try a workaround by wrapping the problematic LLM node and its associated Answer node inside a Loop component set to iterate only once. This should help maintain the flow structure and restore normal streaming output functionality.

Additionally, I found a similar unsolved discussion that might be helpful: Using post to call dify chatflow's API (enable streaming), the response is very slow.

If you're still facing challenges, it might be beneficial to get input from a maintainer. @crazywoola, could you provide some insights on this issue?

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 (Apr 8, 2025): <!-- Answer --> To address the issue where the LLM in a loop cannot be used to end, preventing you from getting the answer from the LLM, you can try a workaround by wrapping the problematic LLM node and its associated Answer node inside a Loop component set to iterate only once. This should help maintain the flow structure and restore normal streaming output functionality. Additionally, I found a similar unsolved discussion that might be helpful: [Using post to call dify chatflow's API (enable streaming), the response is very slow](https://github.com/langgenius/dify/discussions/16602). If you're still facing challenges, it might be beneficial to get input from a maintainer. @crazywoola, could you provide some insights on this issue? <!-- 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/c433ba14-15a0-44e3-98f4-db42d7df9cbe?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/c433ba14-15a0-44e3-98f4-db42d7df9cbe?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/c433ba14-15a0-44e3-98f4-db42d7df9cbe?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/c433ba14-15a0-44e3-98f4-db42d7df9cbe?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c433ba14-15a0-44e3-98f4-db42d7df9cbe?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/c433ba14-15a0-44e3-98f4-db42d7df9cbe?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c433ba14-15a0-44e3-98f4-db42d7df9cbe?feedback_type=other)</sup>
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

#17085的重复

Thanks, I have successfully solved this problem. I used iteration instead of loop. Because in version 1.01, I couldn't set the end after the loop, so I changed my mindset and used the iterative module after code processing, and successfully solved the problem.
【感谢,我已经成功解决了这个问题。我使用了迭代而不是循环。因为在1.01版本中,在循环后面我无法设置结束,所以我转换了一种思路,通过代码处理后,再使用迭代的模块,就成功解决了问题。】

@mozou commented on GitHub (Apr 8, 2025): > [#17085](https://github.com/langgenius/dify/issues/17085)的重复[](https://github.com/langgenius/dify/issues/17085) Thanks, I have successfully solved this problem. I used iteration instead of loop. Because in version 1.01, I couldn't set the end after the loop, so I changed my mindset and used the iterative module after code processing, and successfully solved the problem. 【感谢,我已经成功解决了这个问题。我使用了迭代而不是循环。因为在1.01版本中,在循环后面我无法设置结束,所以我转换了一种思路,通过代码处理后,再使用迭代的模块,就成功解决了问题。】
Author
Owner

@mozou commented on GitHub (Apr 8, 2025):

@dosu Hi,I have successfully solved this problem by replacing the loop with an iteration, because the loop cannot set the end in version 1.01.【我已经成功解决了这个问题。使用迭代替换循环,因为循环在1.01版本无法设置结束。】

@mozou commented on GitHub (Apr 8, 2025): @dosu Hi,I have successfully solved this problem by replacing the loop with an iteration, because the loop cannot set the end in version 1.01.【我已经成功解决了这个问题。使用迭代替换循环,因为循环在1.01版本无法设置结束。】
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

Hey @mozou! 🎉 That's awesome to hear that you solved the problem by using iteration instead of a loop! As a bot, I'm here to help with bugs, technical questions, and engineering knowledge, but it looks like you've got this one covered. If you think there's something I should have helped with, feel free to reach out to the Dosu Team. Keep up the great work! 😊

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 (Apr 8, 2025): <!-- Answer --> Hey @mozou! 🎉 That's awesome to hear that you solved the problem by using iteration instead of a loop! As a bot, I'm here to help with bugs, technical questions, and engineering knowledge, but it looks like you've got this one covered. If you think there's something I should have helped with, feel free to reach out to the [Dosu Team](mailto:customersuccess@dosu.dev). Keep up the great work! 😊 <!-- 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/54dd7357-86a3-40d8-beb6-334342aaed4a?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/54dd7357-86a3-40d8-beb6-334342aaed4a?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/54dd7357-86a3-40d8-beb6-334342aaed4a?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/54dd7357-86a3-40d8-beb6-334342aaed4a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/54dd7357-86a3-40d8-beb6-334342aaed4a?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/54dd7357-86a3-40d8-beb6-334342aaed4a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/54dd7357-86a3-40d8-beb6-334342aaed4a?feedback_type=other)</sup>
Author
Owner

@shihuimin1012 commented on GitHub (Apr 25, 2025):

你好 你的问题如何解决的?目前我遇到工作流无法流式输出问题

@shihuimin1012 commented on GitHub (Apr 25, 2025): 你好 你的问题如何解决的?目前我遇到工作流无法流式输出问题
Author
Owner

@mozou commented on GitHub (Apr 26, 2025):

你好你的问题如何解决?目前我遇到工作流无法流式输出的问题

我不太清楚你遇到的问题是否和我一样。我是因为条件分支模块过多分支,之后还需要聚合这些信息,导致的LLM的流式输出失效。但是我在只保留一条分支的情况下,是可以正常流式输出的,我使用了迭代循环完成,把分钟放在里面遍历。

我的建议是你可以查查看issue,是否有和你一样的的问题。如果不存在或者找不到,提一个issue,dosubot是自动回复的机器人,他会提供一些帮助。

@mozou commented on GitHub (Apr 26, 2025): > 你好你的问题如何解决?目前我遇到工作流无法流式输出的问题 我不太清楚你遇到的问题是否和我一样。我是因为条件分支模块过多分支,之后还需要聚合这些信息,导致的LLM的流式输出失效。但是我在只保留一条分支的情况下,是可以正常流式输出的,我使用了迭代循环完成,把分钟放在里面遍历。 我的建议是你可以查查看issue,是否有和你一样的的问题。如果不存在或者找不到,提一个issue,dosubot是自动回复的机器人,他会提供一些帮助。
Author
Owner

@hubutui commented on GitHub (Apr 27, 2025):

有一个解决方案,如果我们的工作流是一棵树,也就是从开始节点开始,如果有分支节点导致的树分叉,后面即使有一些逻辑是相同的,也不合并起来,而是复制节点,保持整个工作流看起来是一棵树,这样就不会有输出节点不能流式输出的问题了。但是这样的话,重复的逻辑不能合并起来,维护可能比较困难。

@hubutui commented on GitHub (Apr 27, 2025): 有一个解决方案,如果我们的工作流是一棵树,也就是从开始节点开始,如果有分支节点导致的树分叉,后面即使有一些逻辑是相同的,也不合并起来,而是复制节点,保持整个工作流看起来是一棵树,这样就不会有输出节点不能流式输出的问题了。但是这样的话,重复的逻辑不能合并起来,维护可能比较困难。
Author
Owner

@FLYyyyy2016 commented on GitHub (Apr 28, 2025):

你好 你的问题如何解决的?目前我遇到工作流无法流式输出问题

发现有一个原因是代码执行时候的错误处理导致的,可以把错误处理设置为无,然后就ok了。

@FLYyyyy2016 commented on GitHub (Apr 28, 2025): > 你好 你的问题如何解决的?目前我遇到工作流无法流式输出问题 发现有一个原因是代码执行时候的错误处理导致的,可以**把错误处理设置为无**,然后就ok了。
Author
Owner

@luanluan1 commented on GitHub (Jun 6, 2025):

我也遇到了这个问题,我把工作流里的一个三分支的if else拆成两个两分支的if else解决了我的问题。但是奇怪的是我的工作流开始就有一个多分之的if else,但这似乎并不会影响我后续的流式输出。

@luanluan1 commented on GitHub (Jun 6, 2025): 我也遇到了这个问题,我把工作流里的一个三分支的if else拆成两个两分支的if else解决了我的问题。但是奇怪的是我的工作流开始就有一个多分之的if else,但这似乎并不会影响我后续的流式输出。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12653