handler.terminate() on the RunHandler returned by pipeline.start(...), and (2) pipeline.terminate(run_id=...) using the raw task id.
You’ll end up with. Two terminated runs with their post-termination status visible, useful when wiring a user “Stop generating” button.
Expected output
task_id is the same identifier you’d pass to pipeline.terminate(run_id=...) — handlers are just a thin wrapper around it.
See also
Background runs
Start a run and wait for it instead of cancelling.
Run pipeline (async)
Same execution surface, awaited.
Pipeline reference
Full method surface.
