ray.workflow.list_all#

ray.workflow.list_all(status_filter: WorkflowStatus | str | Set[WorkflowStatus | str] | None = None) List[Tuple[str, WorkflowStatus]][source]#

List all workflows matching a given status filter. When returning “RESUMEABLE” workflows, the workflows that was running ranks before the workflow that was pending in the result list.

Parameters:

status_filter – If given, only returns workflow with that status. This can be a single status or set of statuses. The string form of the status is also acceptable, i.e., “RUNNING”/”FAILED”/”SUCCESSFUL”/”CANCELED”/”RESUMABLE”/”PENDING”.

Examples

from ray import workflow

@ray.remote
def long_running_job():
    import time
    time.sleep(2)

workflow_task = long_running_job.bind()
wf = workflow.run_async(workflow_task,
    workflow_id="long_running_job")
jobs = workflow.list_all(workflow.RUNNING)
assert jobs == [ ("long_running_job", workflow.RUNNING) ]
ray.get(wf)
jobs = workflow.list_all({workflow.RUNNING})
assert jobs == []
Returns:

A list of tuple with workflow id and workflow status

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