Workflow Handles
A workflow handle represents the state of a particular active or completed workflow execution.
You obtain a workflow handle when using DBOS.start_workflow
to start a workflow in the background.
If you know a workflow's identity, you can also retrieve its handle using DBOS.retrieve_workflow
.
WorkflowHandle
Methods
get_workflow_id
handle.get_workflow_id() -> str
Retrieve the ID of the workflow.
get_result
handle.get_result() -> R
Wait for the workflow to complete, then return its result.
get_status
handle.get_status() -> WorkflowStatus
Retrieve the WorkflowStatus
of a workflow.
WorkflowHandleAsync
Methods
get_workflow_id
handle.get_workflow_id() -> str
Retrieve the ID of the workflow. Behaves identically to the WorkflowHandle version.
get_result
handle.get_result() -> Coroutine[Any, Any, R]
Asynchronously wait for the workflow to complete, then return its result. Similar to the WorkflowHandle version, except asynchronous.
get_status
handle.get_status() -> Coroutine[Any, Any, WorkflowStatus]
Asynchronously retrieve the WorkflowStatus
of a workflow.