Integrate a manual 'break' into the iterate node #7451

Closed
opened 2026-02-21 18:20:39 -05:00 by yindo · 5 comments
Owner

Originally created by @Charlieyurong on GitHub (Dec 30, 2024).

Originally assigned to: @laipz8200 on GitHub.

Self Checks

  • 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.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Currently, the iterate node cannot be terminated midway, and there is a desire to forcibly terminate the iteration under certain conditions

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @Charlieyurong on GitHub (Dec 30, 2024). Originally assigned to: @laipz8200 on GitHub. ### Self Checks - [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. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. Currently, the iterate node cannot be terminated midway, and there is a desire to forcibly terminate the iteration under certain conditions ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [X] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:20:39 -05:00
yindo closed this issue 2026-02-21 18:20:39 -05:00
Author
Owner

@laipz8200 commented on GitHub (Dec 30, 2024):

Hi, I've noticed that you are interested in contributing to this feature. Could you please share your plan?

@laipz8200 commented on GitHub (Dec 30, 2024): Hi, I've noticed that you are interested in contributing to this feature. Could you please share your plan?
Author
Owner

@Charlieyurong commented on GitHub (Jan 1, 2025):

I have two ideas:
1、When executing iterations serially, is it possible to add a code node after any node, where the dependency judgment condition can force an exit from the current iteration using keywords like break?

2、The execution of loop bodies is also a common scenario, such as A->B->C->(D or jump back to A), where keywords can be used in code nodes to forcibly control the flow, like jumping back or exiting the loop.

@Charlieyurong commented on GitHub (Jan 1, 2025): I have two ideas: 1、When executing iterations serially, is it possible to add a code node after any node, where the dependency judgment condition can force an exit from the current iteration using keywords like break? 2、The execution of loop bodies is also a common scenario, such as A->B->C->(D or jump back to A), where keywords can be used in code nodes to forcibly control the flow, like jumping back or exiting the loop.
Author
Owner

@laipz8200 commented on GitHub (Jan 1, 2025):

is it possible to add a code node after any node, where the dependency judgment condition can force an exit from the current iteration using keywords like break?

We actually send the content in the Code node to the sandbox for execution, so this way cannot be implemented.

The execution of loop bodies is also a common scenario, such as A->B->C->(D or jump back to A), where keywords can be used in code nodes to forcibly control the flow, like jumping back or exiting the loop.

We planned a Loop node with the break function, maybe we could convert this issue to a feature request.

@laipz8200 commented on GitHub (Jan 1, 2025): > is it possible to add a code node after any node, where the dependency judgment condition can force an exit from the current iteration using keywords like break? We actually send the content in the Code node to the sandbox for execution, so this way cannot be implemented. > The execution of loop bodies is also a common scenario, such as A->B->C->(D or jump back to A), where keywords can be used in code nodes to forcibly control the flow, like jumping back or exiting the loop. We planned a Loop node with the break function, maybe we could convert this issue to a feature request.
Author
Owner

@Charlieyurong commented on GitHub (Jan 3, 2025):

thxs for your reply

@Charlieyurong commented on GitHub (Jan 3, 2025): thxs for your reply
Author
Owner

@dosubot[bot] commented on GitHub (Feb 3, 2025):

Hi, @Charlieyurong. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You suggested adding a manual 'break' feature to the iterate node.
  • You proposed two ideas for implementation.
  • Laipz8200 mentioned the first idea isn't feasible but noted a planned Loop node with a break function.
  • You acknowledged Laipz8200's response.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the Dify repository by commenting here.
  • If there is no further activity, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Feb 3, 2025): Hi, @Charlieyurong. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You suggested adding a manual 'break' feature to the iterate node. - You proposed two ideas for implementation. - Laipz8200 mentioned the first idea isn't feasible but noted a planned Loop node with a break function. - You acknowledged Laipz8200's response. **Next Steps:** - Please let us know if this issue is still relevant to the latest version of the Dify repository by commenting here. - If there is no further activity, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7451