The actual behavior of the workflow configuration item WORKFLOW_CALL_MAX_DEPTH requires the value to be divided by 2. #11745

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

Originally created by @qq43060292 on GitHub (Mar 19, 2025).

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 report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Provide a description of requested docs changes

When WORKFLOW_CALL_MAX_DEPTH is configured to 10, errors occur beyond the 6th layer due to exceeding the depth limit. Tracing the code revealed that in the following files:

https://github.com/langgenius/dify/blob/0.15.0/api/core/tools/tool_engine.py#L144
https://github.com/langgenius/dify/blob/0.15.0/api/core/tools/tool/workflow_tool.py#L63
Each call increments the depth by 1 twice (once in each file), resulting in a +2 depth increase per actual call. This means the effective maximum depth is halved compared to the configured value. For example, a configuration of 10 allows only 5 actual nested layers before hitting the limit.

Originally created by @qq43060292 on GitHub (Mar 19, 2025). 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 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. ### Provide a description of requested docs changes When WORKFLOW_CALL_MAX_DEPTH is configured to 10, errors occur beyond the 6th layer due to exceeding the depth limit. Tracing the code revealed that in the following files: https://github.com/langgenius/dify/blob/0.15.0/api/core/tools/tool_engine.py#L144 https://github.com/langgenius/dify/blob/0.15.0/api/core/tools/tool/workflow_tool.py#L63 Each call increments the depth by 1 twice (once in each file), resulting in a +2 depth increase per actual call. This means the effective maximum depth is halved compared to the configured value. For example, a configuration of 10 allows only 5 actual nested layers before hitting the limit.
yindo added the 🌊 feat:workflow label 2026-02-21 19:03:25 -05:00
yindo closed this issue 2026-02-21 19:03:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#11745