Track and manage running workflows.
Submit a workflow without waiting:
result = driver.run(wait=False)
run_id = result.run_id
print(f"Submitted: {run_id}")Query workflow status:
status = driver.status(run_id)
print(status.state) # RUNNING, COMPLETED, FAILED, etc.
print(status.is_terminal) # True when workflow finished (completed/failed)
print(status.tasks) # Task results when completeCancel a running workflow:
driver.cancel(run_id)Note: The
logs()method returns an empty list. Stabilize stores workflow state but not execution logs. For detailed logs, use the Highway dashboard.
logs = driver.logs(run_id) # Returns []List recent workflow executions:
workflows = driver.list_workflows(limit=10)
for wf in workflows:
print(f"{wf.run_id}: {wf.state}")For workflows that take minutes to complete, submit and check later:
# Submit and exit immediately
result = driver.run(wait=False, timeout=600)
print(f"Run ID: {result.run_id}")
# Driver can exit, workflow continues on Highway
# Later, check status
status = driver.status(result.run_id)
if status.is_terminal:
print("Workflow finished!")
print(status.tasks)Use workflow IDs for idempotent execution:
result1 = driver.run(workflow_id="order-12345")
result2 = driver.run(workflow_id="order-12345") # Returns cached resultSame workflow_id = same execution. Safe for retries.