hysts
Add workflow error propagation repro
d202a2e
Raw
History Blame Contribute Delete
680 Bytes
"""Repro: downstream workflow nodes still run after an upstream node fails.
Two bound functions are chained: `first` -> `second`. `first` always raises,
so `second` should never run. Instead, `second` executes with `None` as its
input: the canvas shows "got: None" on the node, and the server log prints
"second() called with None".
"""
import gradio as gr
def first(x: str) -> str:
raise ValueError("boom")
def second(x: str) -> str:
print(f"second() called with {x!r}")
return f"got: {x}"
wf = gr.Workflow(
graph="workflow.json",
bind={"first": first, "second": second},
edges=[("first", "second")],
)
if __name__ == "__main__":
wf.launch()