How to get the result of a Workflow Execution in python
Use start_workflow()
or get_workflow_handle()
to return a Workflow handle.
Then use the result
method to await on the result of the Workflow.
handle = await client.start_workflow(
YourWorkflow.run, "some arg", id="your-workflow-id", task_queue="your-task-queue"
)
# Wait for result
result = await handle.result()
print(f"Result: {result}")
To get a handle for an existing Workflow by its Id, you can use get_workflow_handle()
, or use get_workflow_handle_for()
for type safety.
Then use describe()
to get the current status of the Workflow.
If the Workflow does not exist, this call fails.