Why are the parallel branches not executed in parallel? #20950

Closed
opened 2026-02-21 20:09:56 -05:00 by yindo · 2 comments
Owner

Originally created by @Vurtnel on GitHub (Dec 10, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Why are the parallel branches in the workflow diagram not executing in parallel?

Image

execution process:
Image

Image

✔️ Expected Behavior

Why are the parallel branches in the workflow diagram not executing in parallel?

Actual Behavior

No response

Originally created by @Vurtnel on GitHub (Dec 10, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.10.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Why are the parallel branches in the workflow diagram not executing in parallel? <img width="2592" height="1610" alt="Image" src="https://github.com/user-attachments/assets/42f83fdd-e648-42f3-93bf-f5f2fb82a170" /> execution process: <img width="836" height="604" alt="Image" src="https://github.com/user-attachments/assets/f9d30a43-2cb7-42f3-85e6-9d3b29cf61cb" /> <img width="792" height="728" alt="Image" src="https://github.com/user-attachments/assets/42effa37-f43b-4d5c-b7e2-7b5e58da6179" /> ### ✔️ Expected Behavior Why are the parallel branches in the workflow diagram not executing in parallel? ### ❌ Actual Behavior _No response_
yindo added the 🙋‍♂️ question label 2026-02-21 20:09:56 -05:00
yindo closed this issue 2026-02-21 20:09:56 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 10, 2025):

Hi @Vurtnel! I'm Dosu and I’m helping the dify team.

Dify is designed to execute parallel branches concurrently using a worker pool and a shared ready queue. Each worker is a separate thread that pulls tasks from the queue and runs them independently, so true parallelism depends on having multiple workers available and nodes being enqueued as ready at the same time. If your parallel branches are running sequentially, the most likely causes are:

  • The worker pool is configured with only one worker (check your min_workers and max_workers settings).
  • The nodes for the parallel branches are not enqueued as ready at the same time due to workflow structure or dependency issues.
  • Resource constraints in your Docker/container environment (CPU, memory limits) are preventing concurrency.
  • The code execution nodes themselves are blocking or have side effects that serialize execution.

You can adjust the worker pool settings in your Dify configuration to increase the number of workers and review your workflow structure to ensure both branches are truly independent and ready for execution at the same time. Also, check your Docker resource limits and review logs for any warnings about worker pool initialization or resource exhaustion. For more details on how the worker pool and parallel execution are implemented, see the relevant code references:

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 10, 2025): <!-- Greeting --> Hi @Vurtnel! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Dify is designed to execute parallel branches concurrently using a worker pool and a shared ready queue. Each worker is a separate thread that pulls tasks from the queue and runs them independently, so true parallelism depends on having multiple workers available and nodes being enqueued as ready at the same time. If your parallel branches are running sequentially, the most likely causes are: - The worker pool is configured with only one worker (check your `min_workers` and `max_workers` settings). - The nodes for the parallel branches are not enqueued as ready at the same time due to workflow structure or dependency issues. - Resource constraints in your Docker/container environment (CPU, memory limits) are preventing concurrency. - The code execution nodes themselves are blocking or have side effects that serialize execution. You can adjust the worker pool settings in your Dify configuration to increase the number of workers and review your workflow structure to ensure both branches are truly independent and ready for execution at the same time. Also, check your Docker resource limits and review logs for any warnings about worker pool initialization or resource exhaustion. For more details on how the worker pool and parallel execution are implemented, see the relevant code references: - [GraphEngine and WorkerPool implementation](https://github.com/langgenius/dify/blob/acdbcdb6f82b2ed2d48d5dd20cbfd745375588a6/api/core/workflow/graph_engine/graph_engine.py#L2-L342) - [WorkerPool scaling and thread management](https://github.com/langgenius/dify/blob/acdbcdb6f82b2ed2d48d5dd20cbfd745375588a6/api/core/workflow/graph_engine/worker_management/worker_pool.py#L29-L271) - [Worker thread execution logic](https://github.com/langgenius/dify/blob/acdbcdb6f82b2ed2d48d5dd20cbfd745375588a6/api/core/workflow/graph_engine/worker.py#L28-L142) <!-- 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/db3c4aa9-8cb6-4479-a256-bdc9c33f5513?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/db3c4aa9-8cb6-4479-a256-bdc9c33f5513?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/db3c4aa9-8cb6-4479-a256-bdc9c33f5513?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/db3c4aa9-8cb6-4479-a256-bdc9c33f5513?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/db3c4aa9-8cb6-4479-a256-bdc9c33f5513?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/db3c4aa9-8cb6-4479-a256-bdc9c33f5513?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/db3c4aa9-8cb6-4479-a256-bdc9c33f5513?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Dify%20is%20designed%20to%20execute%20parallel%20branches%20concurrently%20using%20a%20worker%20pool%20and%20a%20shared%20ready%20queue.%20Each%20worker%20is%20a%20separate%20thread%20that%20pulls%20tasks%20from%20the%20queue%20and%20runs%20them%20independently%2C%20so%20true%20parallelism%20depends%20on%20having%20multiple%20workers%20available%20and%20nodes%20being%20enqueued%20as%20ready%20at%20the%20same%20time.%20If%20your%20parallel%20branches%20are%20running%20sequentially%2C%20the%20most%20likely%20causes%20are%3A%0A%0A-%20The%20worker%20pool%20is%20configured%20with%20only%20one%20worker%20%28check%20your%20%60min_workers%60%20and%20%60max_workers%60%20settings%29.%0A-%20The%20nodes%20for%20the%20parallel%20branches%20are%20not%20enqueued%20as%20ready%20at%20the%20same%20time%20due%20to%20workflow%20structure%20or%20dependency%20issues.%0A-%20Resource%20constraints%20in%20your%20Docker/container%20environment%20%28CPU%2C%20memory%20limits%29%20are%20preventing%20concurrency.%0A-%20The%20code%20execution%20nodes%20themselves%20are%20blocking%20or%20have%20side%20effects%20that%20serialize%20execution.%0A%0AYou%20can%20adjust%20the%20worker%20pool%20settings%20in%20your%20Dify%20configuration%20to%20increase%20the%20number%20of%20workers%20and%20review%20your%20workflow%20structure%20to%20ensure%20both%20branches%20are%20truly%20independent%20and%20ready%20for%20execution%20at%20the%20same%20time.%20Also%2C%20check%20your%20Docker%20resource%20limits%20and%20review%20logs%20for%20any%20warnings%20about%20worker%20pool%20initialization%20or%20resource%20exhaustion.%20For%20more%20details%20on%20how%20the%20worker%20pool%20and%20parallel%20execution%20are%20implemented%2C%20see%20the%20relevant%20code%20references%3A%20%20%0A-%20%5BGraphEngine%20and%20WorkerPool%20implementation%5D%28https%3A//github.com/langgenius/dify/blob/acdbcdb6f82b2ed2d48d5dd20cbfd745375588a6/api/core/workflow/graph_engine/graph_engine.py%23L2-L342%29%0A-%20%5BWorkerPool%20scaling%20and%20thread%20management%5D%28https%3A//github.com/langgenius/dify/blob/acdbcdb6f82b2ed2d48d5dd20cbfd745375588a6/api/core/workflow/graph_engine/worker_management/worker_pool.py%23L29-L271%29%0A-%20%5BWorker%20thread%20execution%20logic%5D%28https%3A//github.com/langgenius/dify/blob/acdbcdb6f82b2ed2d48d5dd20cbfd745375588a6/api/core/workflow/graph_engine/worker.py%23L28-L142%29)&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/issues/29450)
Author
Owner

@crazywoola commented on GitHub (Dec 10, 2025):

This is only for bug report, if you would like to ask a question, please head to Discussions.

@crazywoola commented on GitHub (Dec 10, 2025): 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).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20950