Skip to content

DAG step info silently drops is_inside_foreach field #469

@Vinyl-Davyl

Description

@Vinyl-Davyl

Description

The FlowGraph class in services/ui_backend_service/data/cache/custom_flowgraph.py computes is_inside_foreach for every DAG step during graph postprocessing. This flag correctly identifies which steps run inside a foreach branch. However, the node_to_dict() function that serializes nodes into the API response never includes this field, it is currently silently dropped before reaching API consumers.

Exposing this metadata is a critical enabler for metaflow-ui#180 which unblocks Metaflow UI issue #88., which introduces a high-density "Expanded DAG" mode. With this field, it would be an additional plus the UI can now distinguish between a regular linear step and a step that executes as part of a foreach branch.

Steps to Reproduce

  1. Run metaflow-service locally.
  2. Execute a Flow that contains a foreach step (e.g., self.next(self.process, foreach='items')).
  3. Query the DAG API: GET /flows/{flow_id}/runs/{run_number}/dag.
  4. Inspect the JSON response for the child step (e.g., process).

Expected behavior:
The step node info should include "is_inside_foreach": true.

Actual behavior:
The is_inside_foreach field is missing. The step reports "type": "linear" only.

Reproduces how often:
100% of the time.

Versions

  • Metaflow Service: master
  • OS: macOS / Linux

Additional Information

This is a one-line fix in node_to_dict() that unblocks Metaflow UI issue #88.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions