[DOCS]: Example 1 has a logical error: the template transformation output variable does not exist. #262

Closed
opened 2026-02-16 05:19:39 -05:00 by yindo · 1 comment
Owner

Originally created by @linux-y on GitHub (Nov 5, 2025).

Type of Documentation Change

Error/Typo fix

Documentation Page URL or Path

https://docs.dify.ai/zh-hans/guides/workflow/node/loop#%E7%A4%BA%E4%BE%8B%E4%B8%80%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%BE%AA%E7%8E%AF%E8%8A%82%E7%82%B9%EF%BC%9F

Current Content

No response

Suggested Changes

Reason for Change

No response

Code of Conduct

  • I agree to follow Dify's documentation contribution guidelines
  • 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.
Originally created by @linux-y on GitHub (Nov 5, 2025). ### Type of Documentation Change Error/Typo fix ### Documentation Page URL or Path https://docs.dify.ai/zh-hans/guides/workflow/node/loop#%E7%A4%BA%E4%BE%8B%E4%B8%80%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%BE%AA%E7%8E%AF%E8%8A%82%E7%82%B9%EF%BC%9F ### Current Content _No response_ ### Suggested Changes <!-- Failed to upload "image.png" --> ### Reason for Change _No response_ ### Code of Conduct - [x] I agree to follow Dify's documentation [contribution guidelines](https://github.com/langgenius/dify/blob/0277a37fcad5ad86aeb239485c27fffd5cd90043/CONTRIBUTING.md) - [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.
yindo added the documentation label 2026-02-16 05:19:39 -05:00
yindo closed this issue 2026-02-16 05:19:39 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 5, 2025):

Hi @linux-y! I'm Dosu and I’m helping the dify-docs team.

You're correct—there is a logical error in Example 1. The loop termination condition relies on the 'done' variable from the template transformation node, but 'done' is only set when the random number is less than 50. For iterations where the number is 50 or above, 'done' does not exist, which can cause issues with loop termination logic. To fix this, the documentation should ensure the termination variable is always defined in every branch of the workflow, or use a variable that is guaranteed to be set each cycle. You can see the problematic logic in the source documentation.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 5, 2025): <!-- Greeting --> Hi @linux-y! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-docs team. <!-- Answer --> You're correct—there is a logical error in Example 1. The loop termination condition relies on the 'done' variable from the template transformation node, but 'done' is only set when the random number is less than 50. For iterations where the number is 50 or above, 'done' does not exist, which can cause issues with loop termination logic. To fix this, the documentation should ensure the termination variable is always defined in every branch of the workflow, or use a variable that is guaranteed to be set each cycle. You can see the problematic logic in the [source documentation](https://github.com/langgenius/dify-docs/blob/d0c4170710499da3b9b62d3df9391fb2e61be0a7/zh-hans/guides/workflow/node/loop.mdx#L77-L93). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/3b659592-f965-44b5-baba-d1f3bdc2eaf8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/3b659592-f965-44b5-baba-d1f3bdc2eaf8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/3b659592-f965-44b5-baba-d1f3bdc2eaf8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/3b659592-f965-44b5-baba-d1f3bdc2eaf8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3b659592-f965-44b5-baba-d1f3bdc2eaf8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/3b659592-f965-44b5-baba-d1f3bdc2eaf8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3b659592-f965-44b5-baba-d1f3bdc2eaf8?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-docs/issues/513)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-docs#262