When using parallel execution of nodes in workflows, can it wait for all nodes are finished and then do somothing else? #5916

Closed
opened 2026-02-21 18:13:12 -05:00 by yindo · 3 comments
Owner

Originally created by @minggg98 on GitHub (Oct 4, 2024).

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.

In order to save time, I am using a parallel workflow to complete some tasks, but the workflow will not wait for all parallel nodes to finish before executing the next node, which will cause some variables of the next node to be unavailable. So, does Dify support the ability for parallel nodes to execute simultaneously and wait for completion?

2. Additional context or comments

dify issuse
As shown in the picture, I have multiple nodes executing in parallel, and then their results are connected to the same node, and when the execution is done, the parallel nodes are not all finished, and the workflow goes to the next node. In the picture, I tried to use the variable aggregator node to try to wait them finished. Unfortunately, it failed. Is there any good solution? Or can you provide that capability?

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @minggg98 on GitHub (Oct 4, 2024). ### 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. In order to save time, I am using a parallel workflow to complete some tasks, but the workflow will not wait for all parallel nodes to finish before executing the next node, which will cause some variables of the next node to be unavailable. So, does Dify support the ability for parallel nodes to execute simultaneously and wait for completion? ### 2. Additional context or comments ![dify issuse](https://github.com/user-attachments/assets/d5f04509-15e5-4b25-a67a-883864689c1c) As shown in the picture, I have multiple nodes executing in parallel, and then their results are connected to the same node, and when the execution is done, the parallel nodes are not all finished, and the workflow goes to the next node. In the picture, I tried to use the variable aggregator node to try to wait them finished. Unfortunately, it failed. Is there any good solution? Or can you provide that capability? ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:13:12 -05:00
yindo closed this issue 2026-02-21 18:13:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 4, 2024):

@minggg98 Hello there! I'm here to help you with bug fixes, answer questions, and even guide you on how to become a contributor. Let's squash those bugs together! 🤖

Yes, Dify supports the ability for parallel nodes in a workflow to execute simultaneously and wait for all nodes to finish before proceeding to the next step. This is achieved through a parallel structure design pattern that allows concurrent execution of multiple nodes, enhancing overall workflow efficiency [1].

However, it seems you are experiencing an issue where the workflow does not wait for all parallel nodes to complete before moving to the next node. This might be related to the limitations of the 'Variable Aggregator' node, which processes variables sequentially and may not handle multiple parallel executions efficiently [2].

For ensuring synchronization of parallel nodes, the workflow engine in Dify uses a queue to manage the results of parallel node executions. The logic involves checking the completion of all parallel branches before proceeding to the next node [3].

If the current setup with the 'Variable Aggregator' node is not working as expected, you might need to review the configuration of your workflow to ensure that all parallel nodes are correctly synchronized before moving to the next step. Unfortunately, specific configuration settings or parameters to adjust for this synchronization were not found in the available documentation.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 4, 2024): <!-- Greeting --> @minggg98 Hello there! I'm here to help you with bug fixes, answer questions, and even guide you on how to become a contributor. Let's squash those bugs together! 🤖 <!-- Answer --> Yes, Dify supports the ability for parallel nodes in a workflow to execute simultaneously and wait for all nodes to finish before proceeding to the next step. This is achieved through a parallel structure design pattern that allows concurrent execution of multiple nodes, enhancing overall workflow efficiency <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/orchestrate-node.md)</sup>. However, it seems you are experiencing an issue where the workflow does not wait for all parallel nodes to complete before moving to the next node. This might be related to the limitations of the 'Variable Aggregator' node, which processes variables sequentially and may not handle multiple parallel executions efficiently <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/variable_aggregator/variable_aggregator_node.py)</sup>. For ensuring synchronization of parallel nodes, the workflow engine in Dify uses a queue to manage the results of parallel node executions. The logic involves checking the completion of all parallel branches before proceeding to the next node <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/core/workflow/graph_engine/graph_engine.py)</sup>. If the current setup with the 'Variable Aggregator' node is not working as expected, you might need to review the configuration of your workflow to ensure that all parallel nodes are correctly synchronized before moving to the next step. Unfortunately, specific configuration settings or parameters to adjust for this synchronization were not found in the available documentation. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Oct 4, 2024):

See this issue https://github.com/langgenius/dify/issues/8420 for more information.

@crazywoola commented on GitHub (Oct 4, 2024): See this issue https://github.com/langgenius/dify/issues/8420 for more information.
Author
Owner

@minggg98 commented on GitHub (Oct 26, 2024):

See this issue #8420 for more information.
After seeing the issue you provided, it seems do not figure out my problem. What I need is that behind some parallel workflow nodes there will be another node that can wait all parallel nodes finished and then use these parallel nodes result to do something else.In addition to connecting to the same end node, can you provide other solutions? Thk you.

@minggg98 commented on GitHub (Oct 26, 2024): > See this issue #8420 for more information. After seeing the issue you provided, it seems do not figure out my problem. What I need is that behind some parallel workflow nodes there will be another node that can wait all parallel nodes finished and then use these parallel nodes result to do something else.In addition to connecting to the same end node, can you provide other solutions? Thk you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5916