Summary
In src/langflow-stepflow/src/langflow_stepflow/translation/translator.py, the _build_output_mapping_from_edges method uses a first-edge-wins strategy that collapses all outgoing edges from a single source node into a single source_id -> output_name entry. This is lossy when a node fans out to multiple targets using different outputs — at least one downstream path will receive the wrong output.
Steps to reproduce / Follow-up work
- Identify (or author) a Langflow flow where a single component exposes multiple outputs and connects each to a different downstream node (e.g., a component with both a
message and a data output, each wired to a separate target).
- Verify that the current first-edge-wins mapping causes the wrong output to be selected for at least one consumer.
- Change the mapping to be edge-scoped (e.g., keyed by
(source_id, target_id) or by edge id) so each edge retains its selected output name.
- Update
NodeProcessor (and any other callers of _build_output_mapping_from_edges) to look up the output using the edge-scoped key.
- Add a regression test using the flow from step 1.
Context
Flagged during review of PR #12015. The first-edge-wins approach works for all existing tested flows, but is architecturally unsound for general multi-output fan-out scenarios.
Backlinks: PR #12015, comment #12015 (comment)
Requested by @bjchambers.
Summary
In
src/langflow-stepflow/src/langflow_stepflow/translation/translator.py, the_build_output_mapping_from_edgesmethod uses a first-edge-wins strategy that collapses all outgoing edges from a single source node into a singlesource_id -> output_nameentry. This is lossy when a node fans out to multiple targets using different outputs — at least one downstream path will receive the wrong output.Steps to reproduce / Follow-up work
messageand adataoutput, each wired to a separate target).(source_id, target_id)or by edge id) so each edge retains its selected output name.NodeProcessor(and any other callers of_build_output_mapping_from_edges) to look up the output using the edge-scoped key.Context
Flagged during review of PR #12015. The first-edge-wins approach works for all existing tested flows, but is architecturally unsound for general multi-output fan-out scenarios.
Backlinks: PR #12015, comment #12015 (comment)
Requested by @bjchambers.