Undocumented
| Class | |
How a child workflow cancellation should be handled. |
| Class | |
TypedDict of config that can be used for start_child_workflow and execute_child_workflow. |
| Class | |
Handle for interacting with a child workflow. |
| Class | |
Handle for interacting with an external workflow. |
| Class | |
How a child workflow should be handled when the parent closes. |
| Exception | |
Error thrown by continue_as_new. |
| Function | all |
Whether update and signal handlers have finished executing. |
| Function | continue |
Stop the workflow immediately and continue as new. |
| Async Function | execute |
Start a child workflow and wait for completion. |
| Function | get |
Get the dynamic query handler if any. |
| Function | get |
Get the dynamic signal handler if any. |
| Function | get |
Get the dynamic update handler if any. |
| Function | get |
Get a workflow handle to an existing workflow by its ID. |
| Function | get |
Get a typed workflow handle to an existing workflow by its ID. |
| Function | get |
Get the query handler for the given name if any. |
| Function | get |
Get the signal handler for the given name if any. |
| Function | get |
Get the update handler for the given name if any. |
| Function | set |
Set or unset the dynamic query handler. |
| Function | set |
Set or unset the dynamic signal handler. |
| Function | set |
Set or unset the dynamic update handler. |
| Function | set |
Set or unset the query handler for the given name. |
| Function | set |
Set or unset the signal handler for the given name. |
| Function | set |
Set or unset the update handler for the given name. |
| Async Function | start |
Start a child workflow and return its handle. |
Whether update and signal handlers have finished executing.
Consider waiting on this condition before workflow return or continue-as-new, to prevent interruption of in-progress handlers by workflow exit: await workflow.wait_condition(lambda: workflow.all_handlers_finished())
| Returns | |
bool | True if there are no in-progress update or signal handler executions. |
Any = temporalio.common._arg_unset, *, args: Sequence[ Any] = [], task_queue: str | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, retry_policy: temporalio.common.RetryPolicy | None = None, memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, initial_versioning_behavior: ContinueAsNewVersioningBehavior | None = None) -> NoReturn:MethodAsyncNoParam[ SelfType, Any], task_queue: str | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, retry_policy: temporalio.common.RetryPolicy | None = None, memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, initial_versioning_behavior: ContinueAsNewVersioningBehavior | None = None) -> NoReturn:ParamType, *, workflow: MethodAsyncSingleParam[ SelfType, ParamType, Any], task_queue: str | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, retry_policy: temporalio.common.RetryPolicy | None = None, memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, initial_versioning_behavior: ContinueAsNewVersioningBehavior | None = None) -> NoReturn:Callable[ Concatenate[ SelfType, MultiParamSpec], Awaitable[ Any]], args: Sequence[ Any], task_queue: str | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, retry_policy: temporalio.common.RetryPolicy | None = None, memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, initial_versioning_behavior: ContinueAsNewVersioningBehavior | None = None) -> NoReturn:str, args: Sequence[ Any] = [], task_queue: str | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, retry_policy: temporalio.common.RetryPolicy | None = None, memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, initial_versioning_behavior: ContinueAsNewVersioningBehavior | None = None) -> NoReturn:Stop the workflow immediately and continue as new.
| Parameters | |
arg:Any | Single argument to the continued workflow. |
args:Sequence[ | Multiple arguments to the continued workflow. Cannot be set if arg is. |
workflow:None | Callable | str | Specific workflow to continue to. Defaults to the current workflow. |
taskstr | None | Task queue to run the workflow on. Defaults to the current workflow's task queue. |
runtimedelta | None | Timeout of a single workflow run. Defaults to the current workflow's run timeout. |
tasktimedelta | None | Timeout of a single workflow task. Defaults to the current workflow's task timeout. |
retrytemporalio.common.RetryPolicy | None | Undocumented |
memo:Mapping[ | Memo for the workflow. Defaults to the current workflow's memo. |
searchNone | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes | Search attributes for the workflow. Defaults to the current workflow's search attributes. The dictionary form of this is DEPRECATED. |
versioningVersioningIntent | None | When using the Worker Versioning feature, specifies whether this Workflow should Continue-as-New onto a worker with a compatible Build Id or not. Deprecated: Use Worker Deployment versioning instead. |
initialContinueAsNewVersioningBehavior | None | Undocumented |
| Returns | |
NoReturn | Never returns, always raises a ContinueAsNewError. |
| Raises | |
ContinueAsNewError | Always raised by this function. Should not be caught but instead be allowed to |
MethodAsyncNoParam[ SelfType, ReturnType], *, id: str | None = None, task_queue: str | None = None, cancellation_type: ChildWorkflowCancellationType = ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED, parent_close_policy: ParentClosePolicy = ParentClosePolicy.TERMINATE, execution_timeout: timedelta | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy = temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, retry_policy: temporalio.common.RetryPolicy | None = None, cron_schedule: str = '', memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, static_summary: str | None = None, static_details: str | None = None, priority: temporalio.common.Priority = temporalio.common.Priority.default) -> ReturnType:MethodAsyncSingleParam[ SelfType, ParamType, ReturnType], arg: ParamType, *, id: str | None = None, task_queue: str | None = None, cancellation_type: ChildWorkflowCancellationType = ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED, parent_close_policy: ParentClosePolicy = ParentClosePolicy.TERMINATE, execution_timeout: timedelta | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy = temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, retry_policy: temporalio.common.RetryPolicy | None = None, cron_schedule: str = '', memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, static_summary: str | None = None, static_details: str | None = None, priority: temporalio.common.Priority = temporalio.common.Priority.default) -> ReturnType:Callable[ Concatenate[ SelfType, MultiParamSpec], Awaitable[ ReturnType]], *, args: Sequence[ Any], id: str | None = None, task_queue: str | None = None, cancellation_type: ChildWorkflowCancellationType = ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED, parent_close_policy: ParentClosePolicy = ParentClosePolicy.TERMINATE, execution_timeout: timedelta | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy = temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, retry_policy: temporalio.common.RetryPolicy | None = None, cron_schedule: str = '', memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, static_summary: str | None = None, static_details: str | None = None, priority: temporalio.common.Priority = temporalio.common.Priority.default) -> ReturnType:str, arg: Any = temporalio.common._arg_unset, *, args: Sequence[ Any] = [], id: str | None = None, task_queue: str | None = None, result_type: type | None = None, cancellation_type: ChildWorkflowCancellationType = ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED, parent_close_policy: ParentClosePolicy = ParentClosePolicy.TERMINATE, execution_timeout: timedelta | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy = temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, retry_policy: temporalio.common.RetryPolicy | None = None, cron_schedule: str = '', memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, static_summary: str | None = None, static_details: str | None = None, priority: temporalio.common.Priority = temporalio.common.Priority.default) -> Any:Start a child workflow and wait for completion.
This is a shortcut for await (await start_child_workflow ).
str, *, run_id: str | None = None) -> ExternalWorkflowHandle[ Any]:
(source)
¶
Get a workflow handle to an existing workflow by its ID.
| Parameters | |
workflowstr | Workflow ID to get a handle to. |
runstr | None | Optional run ID for the workflow. |
| Returns | |
ExternalWorkflowHandle[ | The external workflow handle. |
MethodAsyncNoParam[ SelfType, Any] | MethodAsyncSingleParam[ SelfType, Any, Any], workflow_id: str, *, run_id: str | None = None) -> ExternalWorkflowHandle[ SelfType]:
(source)
¶
Get a typed workflow handle to an existing workflow by its ID.
This is the same as get_external_workflow_handle but typed. Note,
the workflow type given is not validated, it is only for typing.
| Parameters | |
workflow:MethodAsyncNoParam[ | The workflow run method to use for typing the handle. |
workflowstr | Workflow ID to get a handle to. |
runstr | None | Optional run ID for the workflow. |
| Returns | |
ExternalWorkflowHandle[ | The external workflow handle. |
Get the query handler for the given name if any.
This includes handlers created via the @workflow.query decorator.
| Parameters | |
name:str | Name of the query. |
| Returns | |
Callable | None | Callable for the query if any. If a handler is not found for the name, this will not return the dynamic handler even if there is one. |
Get the signal handler for the given name if any.
This includes handlers created via the @workflow.signal decorator.
| Parameters | |
name:str | Name of the signal. |
| Returns | |
Callable | None | Callable for the signal if any. If a handler is not found for the name, this will not return the dynamic handler even if there is one. |
Get the update handler for the given name if any.
This includes handlers created via the @workflow.update decorator.
| Parameters | |
name:str | Name of the update. |
| Returns | |
Callable | None | Callable for the update if any. If a handler is not found for the name, this will not return the dynamic handler even if there is one. |
Set or unset the signal handler for the given name.
This overrides any existing handlers for the given name, including handlers created via the @workflow.signal decorator.
When set, all unhandled past signals for the given name are immediately sent to the handler.
| Parameters | |
name:str | Name of the signal. |
handler:Callable | None | Callable to set or None to unset. |
str, handler: Callable | None, *, validator: Callable | None = None):
(source)
¶
Set or unset the update handler for the given name.
This overrides any existing handlers for the given name, including handlers created via the @workflow.update decorator.
| Parameters | |
name:str | Name of the update. |
handler:Callable | None | Callable to set or None to unset. |
validator:Callable | None | Callable to set or None to unset as the update validator. |
MethodAsyncNoParam[ SelfType, ReturnType], *, id: str | None = None, task_queue: str | None = None, cancellation_type: ChildWorkflowCancellationType = ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED, parent_close_policy: ParentClosePolicy = ParentClosePolicy.TERMINATE, execution_timeout: timedelta | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy = temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, retry_policy: temporalio.common.RetryPolicy | None = None, cron_schedule: str = '', memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, static_summary: str | None = None, static_details: str | None = None, priority: temporalio.common.Priority = temporalio.common.Priority.default) -> ChildWorkflowHandle[ SelfType, ReturnType]:MethodAsyncSingleParam[ SelfType, ParamType, ReturnType], arg: ParamType, *, id: str | None = None, task_queue: str | None = None, cancellation_type: ChildWorkflowCancellationType = ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED, parent_close_policy: ParentClosePolicy = ParentClosePolicy.TERMINATE, execution_timeout: timedelta | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy = temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, retry_policy: temporalio.common.RetryPolicy | None = None, cron_schedule: str = '', memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, static_summary: str | None = None, static_details: str | None = None, priority: temporalio.common.Priority = temporalio.common.Priority.default) -> ChildWorkflowHandle[ SelfType, ReturnType]:Callable[ Concatenate[ SelfType, MultiParamSpec], Awaitable[ ReturnType]], *, args: Sequence[ Any], id: str | None = None, task_queue: str | None = None, cancellation_type: ChildWorkflowCancellationType = ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED, parent_close_policy: ParentClosePolicy = ParentClosePolicy.TERMINATE, execution_timeout: timedelta | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy = temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, retry_policy: temporalio.common.RetryPolicy | None = None, cron_schedule: str = '', memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, static_summary: str | None = None, static_details: str | None = None, priority: temporalio.common.Priority = temporalio.common.Priority.default) -> ChildWorkflowHandle[ SelfType, ReturnType]:str, arg: Any = temporalio.common._arg_unset, *, args: Sequence[ Any] = [], id: str | None = None, task_queue: str | None = None, result_type: type | None = None, cancellation_type: ChildWorkflowCancellationType = ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED, parent_close_policy: ParentClosePolicy = ParentClosePolicy.TERMINATE, execution_timeout: timedelta | None = None, run_timeout: timedelta | None = None, task_timeout: timedelta | None = None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy = temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, retry_policy: temporalio.common.RetryPolicy | None = None, cron_schedule: str = '', memo: Mapping[ str, Any] | None = None, search_attributes: None | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes = None, versioning_intent: VersioningIntent | None = None, static_summary: str | None = None, static_details: str | None = None, priority: temporalio.common.Priority = temporalio.common.Priority.default) -> ChildWorkflowHandle[ Any, Any]:Start a child workflow and return its handle.
| Parameters | |
workflow:Any | String name or class method decorated with @workflow.run for the workflow to start. |
arg:Any | Single argument to the child workflow. |
args:Sequence[ | Multiple arguments to the child workflow. Cannot be set if arg is. |
id:str | None | Optional unique identifier for the workflow execution. If not set,
defaults to uuid4. |
taskstr | None | Task queue to run the workflow on. Defaults to the current workflow's task queue. |
resulttype | None | For string workflows, this can set the specific result type hint to deserialize into. |
cancellationChildWorkflowCancellationType | How the child workflow will react to cancellation. |
parentParentClosePolicy | How to handle the child workflow when the parent workflow closes. |
executiontimedelta | None | Total workflow execution timeout including retries and continue as new. |
runtimedelta | None | Timeout of a single workflow run. |
tasktimedelta | None | Timeout of a single workflow task. |
idtemporalio.common.WorkflowIDReusePolicy | How already-existing IDs are treated. |
retrytemporalio.common.RetryPolicy | None | Retry policy for the workflow. |
cronstr | See https://docs.temporal.io/docs/content/what-is-a-temporal-cron-job/ |
memo:Mapping[ | Memo for the workflow. |
searchNone | temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes | Search attributes for the workflow. The dictionary form of this is DEPRECATED. |
versioningVersioningIntent | None | When using the Worker Versioning feature, specifies whether this Child Workflow should run on a worker with a compatible Build Id or not. Deprecated: Use Worker Deployment versioning instead. |
staticstr | None | A single-line fixed summary for this child workflow execution that may appear in the UI/CLI. This can be in single-line Temporal markdown format. |
staticstr | None | General fixed details for this child workflow execution that may appear in
UI/CLI. This can be in Temporal markdown format and can span multiple lines. This is
a fixed value on the workflow that cannot be updated. For details that can be
updated, use get_current_details within the workflow. |
priority:temporalio.common.Priority | Priority to use for this workflow. |
| Returns | |
ChildWorkflowHandle[ | A workflow handle to the started/existing workflow. |