Workflow

destroy()

workflow.destroy() → Promise<void>

Deletes the workflow. Its runs are kept, and a run in flight is not stopped.

DELETEruns are keptin-flight runs continue
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

await workflow.destroy();
workflow.destroy()

The run history stays

A run is a record of what happened

Deleting the definition does not rewrite history: the runs remain and are reachable by identifier with getRun(). What a workflow did is not undone by removing the workflow.

A running run is not cancelled

It carries its own copy of the definition and finishes. To stop one, call cancel() on it — deleting the workflow is not a way to stop work.

Scheduled and inbound triggers stop

Nothing new starts: a schedule no longer fires, and an inbound request no longer has a workflow to start.

There is no undo

Keep the definition if you may want it back — workflow.data is exactly what create() takes.