Skip to content

Optimize dynamic workflow by pruning node inputs (#6888) - #6908

Open
VishnuVV27 wants to merge 1 commit into
flyteorg:masterfrom
VishnuVV27:fix-dynamic-workflow-sluggishness
Open

VishnuVV27 wants to merge 1 commit into
flyteorg:masterfrom
VishnuVV27:fix-dynamic-workflow-sluggishness

Conversation

@VishnuVV27

Copy link
Copy Markdown

Tracking issue

Closes #6888

Why are the changes needed?

Dynamic workflows in Flyte can fail or suffer from performance issues when the dynamic closure becomes too large, exceeding gRPC message limits (the "message too large" error). Even if execution succeeds, the Flyte UI becomes sluggish because it has to download and parse these massive blobs. This is primarily caused by the inclusion of all node inputs in the dynamic closure, which is redundant since this data is already persisted in metadata storage.

What changes were proposed in this pull request?

  1. Pruning Logic: Added a clearNodeInputs helper in flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow.go to nullify the Inputs field for nodes in the dynamic closure.
  2. Recursive Support: The function specifically handles ArrayNode (Map Tasks) to ensure nested node inputs are also pruned, which are often the largest contributors to payload bloat.
  3. Integration: Integrated the pruning step into buildContextualDynamicWorkflow so it triggers just before the closure is cached and sent as an event.

This effectively reduces the "blueprint" size of the dynamic workflow without affecting execution, as nodes continue to read their actual inputs from the defined storage locations.

How was this patch tested?

Added a new test suite TestClearNodeInputs_WithCoreBindings in flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go.

  • Positive Case: Verified that standard node inputs are set to nil.
  • Nested Case: Verified that inputs inside ArrayNode targets are also nullified.
  • Verification Command:
    go test -v ./pkg/controller/nodes/dynamic/... -run TestClearNodeInputs_WithCoreBindings

@VishnuVV27
VishnuVV27 force-pushed the fix-dynamic-workflow-sluggishness branch from 60404f5 to 5da02b4 Compare February 9, 2026 11:48
@Sovietaced
Sovietaced force-pushed the fix-dynamic-workflow-sluggishness branch from 5da02b4 to aa9afd3 Compare May 15, 2026 04:13
@github-actions github-actions Bot added the flyte label May 15, 2026
@Sovietaced
Sovietaced force-pushed the fix-dynamic-workflow-sluggishness branch from aa9afd3 to d7721f1 Compare July 8, 2026 01:41
@codecov

codecov Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.20%. Comparing base (8f92e1d) to head (d7721f1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6908   +/-   ##
=======================================
  Coverage   57.20%   57.20%           
=======================================
  Files         930      930           
  Lines       58253    58262    +9     
=======================================
+ Hits        33322    33330    +8     
- Misses      21870    21871    +1     
  Partials     3061     3061           
Flag Coverage Δ
unittests-datacatalog 53.51% <ø> (ø)
unittests-flyteadmin 53.17% <ø> (ø)
unittests-flytecopilot 48.05% <ø> (ø)
unittests-flytectl 64.09% <ø> (ø)
unittests-flyteidl 75.71% <ø> (ø)
unittests-flyteplugins 60.38% <ø> (ø)
unittests-flytepropeller 53.81% <100.00%> (+0.02%) ⬆️
unittests-flytestdlib 64.39% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: vishnuvv27 <vardhanvishnu520@gmail.com>
@Sovietaced
Sovietaced force-pushed the fix-dynamic-workflow-sluggishness branch from d7721f1 to d454816 Compare August 5, 2026 00:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Core feature] Reduce load from dynamic closure

1 participant