ray.workflow.cancel#

ray.workflow.cancel(workflow_id: str) None[source]#
Cancel a workflow. Workflow checkpoints will still be saved in storage. To

clean up saved checkpoints, see workflow.delete().

Parameters:

workflow_id – The workflow to cancel.

Examples

from ray import workflow

@ray.remote
def some_job():
   return 1

workflow_task = some_job.bind()
workflow.run(workflow_task, workflow_id="some_job")
workflow.cancel(workflow_id="some_job")
assert workflow.get_status("some_job") == workflow.CANCELED
Returns:

None

PublicAPI (alpha): This API is in alpha and may change before becoming stable.