Skip to content

feat: expose is_inside_foreach in DAG step info endpoint response#470

Open
Vinyl-Davyl wants to merge 2 commits intoNetflix:masterfrom
Vinyl-Davyl:fix/DAG-step-info-silently-drops-is-inside-foreach-field
Open

feat: expose is_inside_foreach in DAG step info endpoint response#470
Vinyl-Davyl wants to merge 2 commits intoNetflix:masterfrom
Vinyl-Davyl:fix/DAG-step-info-silently-drops-is-inside-foreach-field

Conversation

@Vinyl-Davyl
Copy link
Copy Markdown

@Vinyl-Davyl Vinyl-Davyl commented Mar 23, 2026

Requirements for a pull request

  • Unit tests related to the change have been updated
  • Documentation related to the change has been updated

Description of the Change

This PR exposes the is_inside_foreach boolean for DAG steps in the API response. While the service was already calculating this value during graph traversal, it was not being serialized in the final JSON output.

Exposing this field is the backend enhancement for the Expanded DAG Mode implemented in metaflow-ui#180. It allows the UI to:

  • Identify steps that belong to a foreach branch.
  • Render task iteration grids and foreach-specific metadata correctly.
  • Support better task identification (TaskID · Value) as requested in UI Issue #88.

Alternate Designs

-

Possible Drawbacks

-
This is a purely additive change to a JSON response and maintains full backwards compatibility.

Verification Process

  1. Unit Tests: Updated services/ui_backend_service/tests/unit_tests/custom_flowgraph_test.py to verify the new field exists and is correct for all node types (start, linear, split-foreach, join, end).
  2. Logic Validation: Verified using a test script that is_inside_foreach returns True only for nodes within the foreach block and False for the splitting node and subsequent joins.
  3. Addresses Issue DAG step info silently drops is_inside_foreach field #469

Release Notes

Exposed is_inside_foreach in DAG step metadata to support enhanced foreach visualization in the Metaflow UI.

Screenshot 2026-03-23 at 3 00 34 PM

@Vinyl-Davyl Vinyl-Davyl changed the title fix: expose is_inside_foreach in DAG step info endpoint response fix: expose is_inside_foreach in DAG step info endpoint response Mar 23, 2026
@Vinyl-Davyl Vinyl-Davyl changed the title fix: expose is_inside_foreach in DAG step info endpoint response update: expose is_inside_foreach in DAG step info endpoint response Mar 23, 2026
@Vinyl-Davyl Vinyl-Davyl changed the title update: expose is_inside_foreach in DAG step info endpoint response feat: expose is_inside_foreach in DAG step info endpoint response Mar 23, 2026
@Vinyl-Davyl
Copy link
Copy Markdown
Author

cc: @saikonen @obgibson @romain-intel

@Aryan95614
Copy link
Copy Markdown

Looked through this. Clean change, is_inside_foreach is already computed on DAGNode during graph traversal, just wasn't being serialized. Makes sense to expose it for the UI. No overlap with the pagination work on the service side.

@Vinyl-Davyl
Copy link
Copy Markdown
Author

Looked through this. Clean change, is_inside_foreach is already computed on DAGNode during graph traversal, just wasn't being serialized. Makes sense to expose it for the UI. No overlap with the pagination work on the service side.

Thanks, @Aryan95614 Appreciate. Glad to hear this aligns well with the existing DAG traversal and doesn’t conflict with the pagination work. Goal is, exposing is_inside_foreach to help improve how the UI identifies and represents foreach tasks, suited for the UI representation on the metaflow UI.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants