The retry mechanism in the workflow is not working. #7726

Closed
opened 2026-02-21 18:22:03 -05:00 by yindo · 1 comment
Owner

Originally created by @Moiyu1998 on GitHub (Jan 14, 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

0.15.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image
As shown in the figure above, I set the retry count for this node to 3. However, after one retry, it did not throw an error and was considered successful, even though the LLM actually did not return any result. I believe the retry mechanism should make another call to the LLM, but clearly, it did not make another attempt here. If it had made another call, it should have continued to throw an error and retried until the retry count was exhausted, rather than ending up with an empty return result.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Moiyu1998 on GitHub (Jan 14, 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 0.15.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![image](https://github.com/user-attachments/assets/0a9c1a3b-d071-449c-8f9d-b39335ea6622) As shown in the figure above, I set the retry count for this node to 3. However, after one retry, it did not throw an error and was considered successful, even though the LLM actually did not return any result. I believe the retry mechanism should make another call to the LLM, but clearly, it did not make another attempt here. If it had made another call, it should have continued to throw an error and retried until the retry count was exhausted, rather than ending up with an empty return result. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🌊 feat:workflow label 2026-02-21 18:22:03 -05:00
yindo closed this issue 2026-02-21 18:22:03 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 14, 2025):

In the Dify workflow, a node execution is considered successful when the NODE_SUCCEEDED event is triggered, even if the LLM returns an empty result. This is because the workflow yields a RunCompletedEvent with a status of SUCCEEDED and includes the outputs, which may contain an empty string for the "text" key [1].

To address the issue where the retry mechanism does not trigger additional attempts despite an empty result, you might need to adjust the conditions under which a retry is considered necessary. Currently, the workflow does not automatically retry if the result is empty but no error is thrown. You may need to implement a custom check to determine if an empty result should trigger a retry, depending on your specific requirements.

If you believe this behavior should be different, consider reviewing the node's configuration to ensure that the retry conditions align with your expectations. Additionally, you might want to explore the possibility of customizing the workflow logic to handle empty results as errors, prompting further retries.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Jan 14, 2025): <!-- Answer --> In the Dify workflow, a node execution is considered successful when the `NODE_SUCCEEDED` event is triggered, even if the LLM returns an empty result. This is because the workflow yields a `RunCompletedEvent` with a status of `SUCCEEDED` and includes the outputs, which may contain an empty string for the "text" key <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/llm/node.py)</sup>. To address the issue where the retry mechanism does not trigger additional attempts despite an empty result, you might need to adjust the conditions under which a retry is considered necessary. Currently, the workflow does not automatically retry if the result is empty but no error is thrown. You may need to implement a custom check to determine if an empty result should trigger a retry, depending on your specific requirements. If you believe this behavior should be different, consider reviewing the node's configuration to ensure that the retry conditions align with your expectations. Additionally, you might want to explore the possibility of customizing the workflow logic to handle empty results as errors, prompting further retries. <!-- 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/0d460fd6-bfaf-4d1e-b2f7-4e942d15e7af?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/0d460fd6-bfaf-4d1e-b2f7-4e942d15e7af?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/0d460fd6-bfaf-4d1e-b2f7-4e942d15e7af?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/0d460fd6-bfaf-4d1e-b2f7-4e942d15e7af?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0d460fd6-bfaf-4d1e-b2f7-4e942d15e7af?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/0d460fd6-bfaf-4d1e-b2f7-4e942d15e7af?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7726