hysts
Add workflow error propagation repro
d202a2e
|
Raw
History Blame Contribute Delete
1.19 kB
---
title: Workflow Error Propagation
emoji: ๐ŸŒ–
colorFrom: gray
colorTo: purple
sdk: gradio
sdk_version: 6.20.0
python_version: '3.13'
app_file: app.py
pinned: false
---
# Repro: downstream workflow nodes still run after an upstream node fails
Minimal reproduction for a `gr.Workflow` bug: when an upstream node raises an exception, downstream nodes are not skipped. They execute with `None` for the input that the failed node was supposed to produce.
## Steps
1. Open the app and click Run on the canvas.
2. The `first` node fails as expected (it always raises `ValueError("boom")`).
3. The `second` node, whose only input comes from `first`, still runs: its node shows `got: None`, and the server log prints `second() called with None`.
Expected: `second` should not run its body. It should be marked as failed with the existing "upstream node failed" message, like other node types.
## Why it happens
The executor's fail-fast guard in `workflow-executor.ts` checks `port.required && inputs[port.id] === null`, but the fn-node ports generated from `bind=` never set `required`, so the guard is skipped and `null` flows into the function call. See the linked issue for details.