dify - ✅(Solved) Fix Improve default GraphEngine worker count for small parallel workflows [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#35561Fetched 2026-04-26 05:24:41
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
1
Author
Participants
Timeline (top)
cross-referenced ×1labeled ×1

Root Cause

Proposal: Change the default value to:

GRAPH_ENGINE_MIN_WORKERS=3

Why this helps: Gives common 2-3 branch workflows enough baseline workers. Makes the canvas behavior closer to runtime behavior. Reduces the need for users to tune hidden environment variables. Keeps the change conservative because GRAPH_ENGINE_MAX_WORKERS and scale-up behavior stay unchanged.

Fix Action

Fixed

PR fix notes

PR #35562: chore: increase default graph engine min workers

Description (problem / solution / changelog)

[!IMPORTANT]

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Fixes #35561 This PR changes the default GRAPH_ENGINE_MIN_WORKERS from 1 to 3.

Why:

The previous default starts each GraphEngine run with only one worker. This can make common workflows with 2 or 3 independent parallel branches run mostly sequentially unless users manually tune the environment variable.

Using 3 as the default gives small parallel workflows enough baseline workers while keeping the change conservative.

Changes:

  • Set default GRAPH_ENGINE_MIN_WORKERS to 3
  • Keep GRAPH_ENGINE_MAX_WORKERS unchanged
  • Keep GRAPH_ENGINE_SCALE_UP_THRESHOLD unchanged

Impact:

  • Better out-of-box behavior for small parallel workflows
  • Slightly higher baseline thread usage per workflow run
  • Existing deployments can still override the value with environment variables
<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> <!-- If this PR was created by an automated agent, add `From <Tool Name>` as the final line of the description. Example: `From Codex`. -->

Screenshots

BeforeAfter
......

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Changed files

  • api/.env.example (modified, +2/-2)
  • api/configs/feature/__init__.py (modified, +1/-1)
  • api/tests/unit_tests/core/workflow/graph_engine/test_table_runner.py (modified, +2/-2)
  • docker/.env.example (modified, +2/-2)
  • docker/docker-compose.yaml (modified, +1/-1)

Code Example

GRAPH_ENGINE_MIN_WORKERS=1

---

GRAPH_ENGINE_MIN_WORKERS=3
RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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.
  • 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.

Dify supports parallel branches in workflows, but the current default GraphEngine worker count can make small parallel workflows look sequential.

Current default:

GRAPH_ENGINE_MIN_WORKERS=1

With only one initial graph worker, workflows with 2 or 3 independent parallel nodes may not start those nodes at the same time. Users then need to discover and tune GRAPH_ENGINE_MIN_WORKERS manually, even for common parallel workflow patterns.

This has caused confusion in several reports where users expected parallel branches to run concurrently but observed sequential execution.

Related reports:

#26565 #29208 #29450 #31054 #31196 #34222

Proposal: Change the default value to:

GRAPH_ENGINE_MIN_WORKERS=3

Why this helps: Gives common 2-3 branch workflows enough baseline workers. Makes the canvas behavior closer to runtime behavior. Reduces the need for users to tune hidden environment variables. Keeps the change conservative because GRAPH_ENGINE_MAX_WORKERS and scale-up behavior stay unchanged.

Scope: This only improves parallel node execution inside a single GraphEngine run.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

extent analysis

TL;DR

Increase the default GRAPH_ENGINE_MIN_WORKERS value to improve parallel workflow execution in Dify.

Guidance

  • Review the current GRAPH_ENGINE_MIN_WORKERS setting and consider increasing it to 3 to support common parallel workflow patterns.
  • Verify the impact of this change by testing workflows with 2-3 independent parallel nodes and observing their execution order.
  • Check related reports (#26565, #29208, #29450, #31054, #31196, #34222) for similar issues and potential feedback on this proposed solution.
  • Consider the scope of this change, which only affects parallel node execution inside a single GraphEngine run.

Example

GRAPH_ENGINE_MIN_WORKERS=3

This example shows the proposed new default value for GRAPH_ENGINE_MIN_WORKERS.

Notes

This solution assumes that increasing the minimum worker count will not introduce significant performance issues or other unintended consequences.

Recommendation

Apply workaround: Increase the default GRAPH_ENGINE_MIN_WORKERS value to 3, as it is a conservative change that addresses common parallel workflow patterns and reduces the need for manual tuning.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING