Workflow run result shows wrong values for iterations #6797

Closed
opened 2026-02-21 18:17:21 -05:00 by yindo · 4 comments
Owner

Originally created by @johnpccd on GitHub (Nov 15, 2024).

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

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Create a workflow with 2 iteration nodes: Iteration1 and Iteration2
Run with some data.. for example Iteration1 should run 10 times and Iteration2 should run 5

✔️ Expected Behavior

In the results window, I expect to see Iteration1 showing 10 runs and Iteration2 showing 5

Actual Behavior

In the results window, Iteration1 shows 10 runs and Iteration2 shows 15 (it accumulates all previous iteration runs even from other iteration nodes).

Originally created by @johnpccd on GitHub (Nov 15, 2024). ### 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.11.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Create a workflow with 2 iteration nodes: Iteration1 and Iteration2 Run with some data.. for example Iteration1 should run 10 times and Iteration2 should run 5 ### ✔️ Expected Behavior In the results window, I expect to see Iteration1 showing 10 runs and Iteration2 showing 5 ### ❌ Actual Behavior In the results window, Iteration1 shows 10 runs and Iteration2 shows 15 (it accumulates all previous iteration runs even from other iteration nodes).
yindo added the 🐞 bug label 2026-02-21 18:17:21 -05:00
yindo closed this issue 2026-02-21 18:17:21 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 15, 2024):

The issue you're experiencing, where iteration run counts are accumulating incorrectly across different iteration nodes, might be related to how the workflow engine handles iteration metadata. The engine uses metadata like ITERATION_ID and PARALLEL_MODE_RUN_ID to differentiate between iterations. If these identifiers are not correctly managed or reset between different iteration nodes, it could lead to the accumulation of run counts from previous nodes [1][2].

To address this, you might want to check the configuration and ensure that each iteration node is correctly isolated in terms of its execution metadata. This could involve verifying that the metadata is reset or cleared appropriately between nodes to prevent such accumulation. If the issue persists, it might require a deeper look into the workflow engine's handling of iteration metadata in version 0.11.0.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 15, 2024): <!-- Answer --> The issue you're experiencing, where iteration run counts are accumulating incorrectly across different iteration nodes, might be related to how the workflow engine handles iteration metadata. The engine uses metadata like `ITERATION_ID` and `PARALLEL_MODE_RUN_ID` to differentiate between iterations. If these identifiers are not correctly managed or reset between different iteration nodes, it could lead to the accumulation of run counts from previous nodes <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/iteration/iteration_node.py)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/run/index.tsx)</sup>. To address this, you might want to check the configuration and ensure that each iteration node is correctly isolated in terms of its execution metadata. This could involve verifying that the metadata is reset or cleared appropriately between nodes to prevent such accumulation. If the issue persists, it might require a deeper look into the workflow engine's handling of iteration metadata in version 0.11.0. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@johnpccd commented on GitHub (Nov 15, 2024):

Worth mentioning: I am using parallelism

@johnpccd commented on GitHub (Nov 15, 2024): Worth mentioning: I am using parallelism
Author
Owner

@qkzsky commented on GitHub (Nov 27, 2024):

I also encountered this problem, running 2 iterative parallel nodes in the same workflow at the same time, the data would be messed up

@qkzsky commented on GitHub (Nov 27, 2024): I also encountered this problem, running 2 iterative parallel nodes in the same workflow at the same time, the data would be messed up
Author
Owner

@dosubot[bot] commented on GitHub (Dec 28, 2024):

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

Issue Summary:

  • Bug in workflow run results for self-hosted Dify version 0.11.0.
  • Iteration counts are incorrectly accumulated across nodes.
  • Suggested cause: improper management of iteration metadata.
  • Parallelism noted as a factor; confirmed by another user, @qkzsky.

Next Steps:

  • Is this issue still relevant to the latest version of Dify? If so, please comment to keep the discussion open.
  • If no further activity occurs, the issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Dec 28, 2024): Hi, @johnpccd. 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:** - Bug in workflow run results for self-hosted Dify version 0.11.0. - Iteration counts are incorrectly accumulated across nodes. - Suggested cause: improper management of iteration metadata. - Parallelism noted as a factor; confirmed by another user, @qkzsky. **Next Steps:** - Is this issue still relevant to the latest version of Dify? If so, please comment to keep the discussion open. - If no further activity occurs, the 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#6797