Utilities that can decorate or be called inside workflows.
Class |
| How an activity cancellation should be handled. |
Class |
| TypedDict of config that can be used forstart_activity andexecute_activity . |
Class |
| Handle returned fromstart_activity andstart_local_activity . |
Class |
| How a child workflow cancellation should be handled. |
Class |
| TypedDict of config that can be used forstart_child_workflow andexecute_child_workflow . |
Class |
| Handle for interacting with a child workflow. |
Class |
| Returned by functions using thedynamic_config decorator, see it for more. |
Class |
| Handle for interacting with an external workflow. |
Class |
| Actions taken if a workflow terminates with running handlers. |
Class |
| Information about the running workflow. |
Class |
| TypedDict of config that can be used forstart_local_activity andexecute_local_activity . |
Class |
| Adapter that adds details to the log about the running workflow. |
Class |
| A client for invoking Nexus operations. |
Class |
| Defines behavior of a Nexus operation when the caller workflow initiates cancellation. |
Class |
| Handle for interacting with a Nexus operation. |
Class |
| How a child workflow should be handled when the parent closes. |
Class |
| Information about the parent workflow. |
Class |
| Information about the root workflow. |
Class | unsafe | Contains static methods that should not normally be called during workflow execution except in advanced cases. |
Class |
| Information about a workflow update. |
Class |
| Decorated workflow update functions implement this. |
Class |
| Indicates whether the user intends certain commands to be run on a compatible worker Build Id version or not. |
Exception |
| Error thrown bycontinue_as_new . |
Exception |
| Error that can be thrown during replay for non-deterministic workflow. |
Exception |
| Error thrown when trying to do mutable workflow calls in a read-only context like a query or update validator. |
Exception |
| The workflow exited before all signal handlers had finished executing. |
Exception |
| The workflow exited before all update handlers had finished executing. |
Function | all | Whether update and signal handlers have finished executing. |
Function | as | Return an iterator whose values are coroutines. |
Function | continue | Stop the workflow immediately and continue as new. |
Function | create | Create a Nexus client. |
Function | current | Info for the current update if any. |
Function | defn | Decorator for workflow classes. |
Function | deprecate | Mark a patch as deprecated. |
Function | dynamic | Decorator to allow configuring a dynamic workflow's behavior. |
Async Function | execute | Start an activity and wait for completion. |
Async Function | execute | Start an activity from a callable class and wait for completion. |
Async Function | execute | Start an activity from a method and wait for completion. |
Async Function | execute | Start a child workflow and wait for completion. |
Async Function | execute | Start a local activity and wait for completion. |
Async Function | execute | Start a local activity from a callable class and wait for completion. |
Async Function | execute | Start a local activity from a method and wait for completion. |
Function | extern | External functions available in the workflow sandbox. |
Function | get | Get the current details of the workflow which may appear in the UI/CLI. Unlike static details set at start, this value can be updated throughout the life of the workflow and is independent of the static details... |
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 result of the last run of the workflow. This will be None if there was no previous completion or the result was None. has_last_completion_result() can be used to differentiate. |
Function | get | Get the last failure of the workflow if it has run previously. |
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 | has | Gets whether there is a last completion result of the workflow. |
Function | in | Whether the code is currently running in a workflow. |
Function | info | Current workflow's info. |
Function | init | Decorator for the workflow init method. |
Function | instance | Current workflow's instance. |
Function | is | Checks if the given exception is a workflow failure in the current workflow. |
Function | memo | Current workflow's memo values, converted without type hints. |
Function | memo | Memo value for the given key, optional default, and optional type hint. |
Function | metric | Get the metric meter for the current workflow. |
Function | now | Current time from the workflow perspective. |
Function | patched | Patch a workflow. |
Function | payload | Get the payload converter for the current workflow. |
Function | query | Decorator for a workflow query method. |
Function | random | Get a deterministic pseudo-random number generator. |
Function | run | Decorator for the workflow run method. |
Function | set | Set the current details of the workflow which may appear in the UI/CLI. Unlike static details set at start, this value can be updated throughout the life of the workflow and is independent of the static details... |
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. |
Function | signal | Decorator for a workflow signal method. |
Async Function | sleep | Sleep for the given duration. |
Function | start | Start an activity and return its handle. |
Function | start | Start an activity from a callable class. |
Function | start | Start an activity from a method. |
Async Function | start | Start a child workflow and return its handle. |
Function | start | Start a local activity and return its handle. |
Function | start | Start a local activity from a callable class. |
Function | start | Start a local activity from a method. |
Function | time | Current seconds since the epoch from the workflow perspective. |
Function | time | Current nanoseconds since the epoch from the workflow perspective. |
Function | update | Decorator for a workflow update handler method. |
Function | upsert | Adds, modifies, and/or removes memos, with upsert semantics. |
Function | upsert | Upsert search attributes for this workflow. |
Function | uuid4 | Get a new, determinism-safe v4 UUID based onrandom . |
Async Function | wait | Wait for the Futures or Tasks given by fs to complete. |
Async Function | wait | Wait on a callback to become true. |
Type Variable |
| Undocumented |
Variable | logger | Logger that will have contextual workflow details embedded. |
Class | _ | Undocumented |
Class | _ | Undocumented |
Class | _ | No class docstring; 0/2 instance variable, 1/3 method documented |
Class | _ | Undocumented |
Class | _ | Undocumented |
Class | _ | Undocumented |
Class | _ | Undocumented |
Exception | _ | Undocumented |
Exception | _ | Undocumented |
Function | _assert | Undocumented |
Function | _bind | Undocumented |
Function | _is | Undocumented |
Function | _parameters | Return True if the functions have identical parameter lists, ignoring parameter names. |
Function | _release | Undocumented |
Function | _set | Undocumented |
Function | _update | Decorator for a workflow update validator method. |
Async Function | _wait | Undocumented |
Type Variable | _FT | Undocumented |
Variable | _current | Undocumented |
Variable | _imports | Undocumented |
Variable | _in | Undocumented |
Variable | _sandbox | Undocumented |
Whether update and signal handlers have finished executing.
Consider waiting on this condition before workflow return or continue-as-new, to preventinterruption 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. |
Iterable[ Awaitable[ AnyType]]
, *, timeout:float |None
=None) ->Iterator[ Awaitable[ AnyType]]
: (source) ¶Return an iterator whose values are coroutines.
This is a deterministic version ofasyncio.as_completed
. Thisfunction should be used instead of that one in workflows.
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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=None, versioning_intent:VersioningIntent |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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=None, versioning_intent:VersioningIntent |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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=None, versioning_intent:VersioningIntent |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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=None, versioning_intent:VersioningIntent |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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=None, versioning_intent:VersioningIntent |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 argis. |
workflow:None |Callable |str | Specific workflow to continue to. Defaults to the currentworkflow. |
taskstr |None | Task queue to run the workflow on. Defaults to the currentworkflow's task queue. |
runtimedelta |None | Timeout of a single workflow run. Defaults to the currentworkflow's run timeout. |
tasktimedelta |None | Timeout of a single workflow task. Defaults to the currentworkflow's task timeout. |
retrytemporalio.common.RetryPolicy |None | Undocumented |
memo:Mapping[ | Memo for the workflow. Defaults to the current workflow's memo. |
searchtemporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None | Search attributes for the workflow. Defaults to thecurrent workflow's search attributes. The dictionary form of this isDEPRECATED. |
versioningVersioningIntent |None | When using the Worker Versioning feature, specifies whether this Workflowshould Continue-as-New onto a worker with a compatible Build Id or not.Deprecated: Use Worker Deployment versioning instead. |
Returns | |
NoReturn | Never returns, always raises aContinueAsNewError . |
Raises | |
ContinueAsNewError | Always raised by this function. Should not be caughtbut instead be allowed to |
Info for the current update if any.
This is powered bycontextvars
so it is only valid within theupdate handler and coroutines/tasks it has started.
Returns | |
UpdateInfo |None |
|
str |None
=None, sandboxed:bool
=True, failure_exception_types:Sequence[ type[ BaseException]]
= [], versioning_behavior:temporalio.common.VersioningBehavior
= temporalio.common.VersioningBehavior.UNSPECIFIED) ->Callable[ [ ClassType], ClassType]
:bool
=True, dynamic:bool
=False, versioning_behavior:temporalio.common.VersioningBehavior
= temporalio.common.VersioningBehavior.UNSPECIFIED) ->Callable[ [ ClassType], ClassType]
:Decorator for workflow classes.
This must be set on any registered workflow class (it is ignored if on abase class).
Parameters | |
cls:ClassType |None | The class to decorate. |
name:str |None | Name to use for the workflow. Defaults to class__name__. Thiscannot be set if dynamic is set. |
sandboxed:bool | Whether the workflow should run in a sandbox. Default istrue. |
dynamic:bool | If true, this activity will be dynamic. Dynamic workflows haveto accept a single 'Sequence[RawValue]' parameter. This cannot beset to true if name is present. |
failureSequence[ | The types of exceptions that, if aworkflow-thrown exception extends, will cause the workflow/update tofail instead of suspending the workflow via task failure. These areapplied in addition to ones set on the worker constructor. IfException is set, it effectively will fail a workflow/update inall user exception cases. WARNING: This setting is experimental. |
versioningtemporalio.common.VersioningBehavior | Specifies the versioning behavior to use for this workflow.WARNING: This setting is experimental. |
Mark a patch as deprecated.
This marks a workflow that hadpatched
in a previous version ofthe code as no longer applicable because all workflows that use the old codepath are done and will never be queried again. Therefore the old code pathis removed as well.
Parameters | |
id:str | The identifier originally used withpatched . |
MethodSyncNoParam[ SelfType, DynamicWorkflowConfig]
) ->MethodSyncNoParam[ SelfType, DynamicWorkflowConfig]
: (source) ¶Decorator to allow configuring a dynamic workflow's behavior.
Because dynamic workflows may conceptually represent more than one workflow type, it may bedesirable to have different settings for fields that would normally be passed todefn
, but vary based on the workflow type name or other information available inthe workflow's context. This function will be called after the workflow'sinit
,if it has one, but before the workflow'srun
method.
The method must only take self as a parameter, and any values set in the class it returns willoverride those provided todefn
.
Cannot be specified on non-dynamic workflows.
Parameters | |
fn:MethodSyncNoParam[ | The function to decorate. |
Returns | |
MethodSyncNoParam[ | Undocumented |
CallableAsyncNoParam[ ReturnType]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:CallableSyncNoParam[ ReturnType]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:CallableAsyncSingleParam[ ParamType, ReturnType]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:CallableSyncSingleParam[ ParamType, ReturnType]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:Callable[ ..., Awaitable[ ReturnType]]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:Callable[ ..., ReturnType]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:str
, arg:Any
=temporalio.common._arg_unset, *, args:Sequence[ Any]
= [], task_queue:str |None
=None, result_type:type |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->Any
:Start an activity and wait for completion.
This is a shortcut forawaitstart_activity
.
type[ CallableAsyncNoParam[ ReturnType]]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:type[ CallableSyncNoParam[ ReturnType]]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:type[ CallableAsyncSingleParam[ ParamType, ReturnType]]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:type[ CallableSyncSingleParam[ ParamType, ReturnType]]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:type[ Callable[ ..., Awaitable[ ReturnType]]]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:type[ Callable[ ..., ReturnType]]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:Start an activity from a callable class and wait for completion.
This is a shortcut forawaitstart_activity_class
.
MethodAsyncNoParam[ SelfType, ReturnType]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:MethodSyncNoParam[ SelfType, ReturnType]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:MethodAsyncSingleParam[ SelfType, ParamType, ReturnType]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:MethodSyncSingleParam[ SelfType, ParamType, ReturnType]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:Callable[ Concatenate[ SelfType, MultiParamSpec], Awaitable[ ReturnType]]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:Callable[ Concatenate[ SelfType, MultiParamSpec], ReturnType]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ReturnType
:Start an activity from a method and wait for completion.
This is a shortcut forawaitstart_activity_method
.
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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=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 forawait (awaitstart_child_workflow
).
CallableAsyncNoParam[ ReturnType]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:CallableSyncNoParam[ ReturnType]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:CallableAsyncSingleParam[ ParamType, ReturnType]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:CallableSyncSingleParam[ ParamType, ReturnType]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:Callable[ ..., Awaitable[ ReturnType]]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:Callable[ ..., ReturnType]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:str
, arg:Any
=temporalio.common._arg_unset, *, args:Sequence[ Any]
= [], result_type:type |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->Any
:Start a local activity and wait for completion.
This is a shortcut forawaitstart_local_activity
.
type[ CallableAsyncNoParam[ ReturnType]]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:type[ CallableSyncNoParam[ ReturnType]]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:type[ CallableAsyncSingleParam[ ParamType, ReturnType]]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:type[ CallableSyncSingleParam[ ParamType, ReturnType]]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:type[ Callable[ ..., Awaitable[ ReturnType]]]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:type[ Callable[ ..., ReturnType]]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:Start a local activity from a callable class and wait for completion.
This is a shortcut forawaitstart_local_activity_class
.
MethodAsyncNoParam[ SelfType, ReturnType]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:MethodSyncNoParam[ SelfType, ReturnType]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:MethodAsyncSingleParam[ SelfType, ParamType, ReturnType]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:MethodSyncSingleParam[ SelfType, ParamType, ReturnType]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:Callable[ Concatenate[ SelfType, MultiParamSpec], Awaitable[ ReturnType]]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:Callable[ Concatenate[ SelfType, MultiParamSpec], ReturnType]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ReturnType
:Start a local activity from a method and wait for completion.
This is a shortcut forawaitstart_local_activity_method
.
Get the current details of the workflow which may appear in the UI/CLI.Unlike static details set at start, this value can be updated throughoutthe life of the workflow and is independent of the static details.This can be in Temporal markdown format and can span multiple lines.
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 asget_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 result of the last run of the workflow. This will be None if there wasno previous completion or the result was None. has_last_completion_result()can be used to differentiate.
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. |
Decorator for the workflow init method.
This may be used on the __init__ method of the workflow class to specifythat it accepts the same workflow input arguments as the@workflow.runmethod. If used, the parameters of your __init__ and@workflow.runmethods must be identical.
Parameters | |
initCallableType | The __init__ method to decorate. |
Returns | |
CallableType | Undocumented |
Checks if the given exception is a workflow failure in the current workflow.
Returns | |
bool | True if the given exception is a workflow failure in the current workflow. |
Current workflow's memo values, converted without type hints.
Since type hints are not used, the default converted values will come back.For example, if the memo was originally created with a dataclass, the valuewill be a dict. To convert using proper type hints, usememo_value
.
Returns | |
Mapping[ | Mapping of all memo keys and they values without type hints. |
Memo value for the given key, optional default, and optional typehint.
Parameters | |
key:str | Key to get memo value for. |
default:Any | Default to use if key is not present. If unset, aKeyError is raised when the key does not exist. |
typetype |None | Type hint to use when converting. |
Returns | |
Any | Memo value, converted with the type hint if present. |
Raises | |
KeyError | Key not present and default not set. |
Get the metric meter for the current workflow.
This meter is replay safe which means that metrics will not be recordedduring replay.
Returns | |
temporalio.common.MetricMeter | Current metric meter for this workflow for recording metrics. |
Current time from the workflow perspective.
This is the workflow equivalent ofdatetime.now
with thetimezone.utc
parameter.
Returns | |
datetime | UTC datetime for the current workflow time. The datetime does have UTCset as the time zone. |
Patch a workflow.
When called, this will only return true if code should take the newer pathwhich means this is either not replaying or is replaying and has seen thispatch before.
Usedeprecate_patch
when all workflows are done and will never bequeried again. The old code path can be used at that time too.
Parameters | |
id:str | The identifier for this patch. This identifier may be usedrepeatedly in the same workflow to represent the same patch |
Returns | |
bool | True if this should take the newer path, false if it should take theolder path. |
Get the payload converter for the current workflow.
The returned converter hastemporalio.converter.WorkflowSerializationContext
set.This is often used for dynamic workflows/signals/queries to convertpayloads.
Literal[ True]
, description:str |None
=None) ->Callable[ [ CallableType], CallableType]
:Decorator for a workflow query method.
This is used on any non-async method that expects to handle a query. If afunction overrides one with this decorator, it too must be decorated.
Query methods can only have positional parameters. Best practice fornon-dynamic query methods is to only take a single object/dataclassargument that can accept more fields later if needed. The return value isthe resulting query value. Query methods must not mutate any workflow state.
Parameters | |
fn:CallableType |None | The function to decorate. |
name:str |None | Query name. Defaults to method__name__. Cannot be presentwhendynamic is present. |
dynamic:bool |None | If true, this handles all queries not otherwise handled. Theparameters of the method should be self, a string name, and aSequence[RawValue]. An older form of this accepted varargparameters which will now warn. Cannot be present whenname ispresent. |
description:str |None | A short description of the query that may appear in the UI/CLI. |
Get a deterministic pseudo-random number generator.
Note, this random number generator is not cryptographically safe and shouldnot be used for security purposes.
Returns | |
Random | The deterministically-seeded pseudo-random number generator. |
Decorator for the workflow run method.
This must be used on one and only one async method defined on the same classas@workflow.defn. This can be defined on a base class method but mustthen be explicitly overridden and defined on the workflow class.
Run methods can only have positional parameters. Best practice is to onlytake a single object/dataclass argument that can accept more fields later ifneeded.
Parameters | |
fn:CallableAsyncType | The function to decorate. |
Returns | |
CallableAsyncType | Undocumented |
Set the current details of the workflow which may appear in the UI/CLI.Unlike static details set at start, this value can be updated throughoutthe life of the workflow and is independent of the static details.This can be in Temporal markdown format and can span multiple lines.
Set or unset the signal handler for the given name.
This overrides any existing handlers for the given name, including handlerscreated via the@workflow.signal decorator.
When set, all unhandled past signals for the given name are immediately sentto 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 handlerscreated 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. |
HandlerUnfinishedPolicy
=HandlerUnfinishedPolicy.WARN_AND_ABANDON, description:str |None
=None) ->Callable[ [ CallableSyncOrAsyncReturnNoneType], CallableSyncOrAsyncReturnNoneType]
:str
, unfinished_policy:HandlerUnfinishedPolicy
=HandlerUnfinishedPolicy.WARN_AND_ABANDON, description:str |None
=None) ->Callable[ [ CallableSyncOrAsyncReturnNoneType], CallableSyncOrAsyncReturnNoneType]
:Literal[ True]
, unfinished_policy:HandlerUnfinishedPolicy
=HandlerUnfinishedPolicy.WARN_AND_ABANDON, description:str |None
=None) ->Callable[ [ CallableSyncOrAsyncReturnNoneType], CallableSyncOrAsyncReturnNoneType]
:Decorator for a workflow signal method.
This is used on any async or non-async method that you wish to be called uponreceiving a signal. If a function overrides one with this decorator, it toomust be decorated.
Signal methods can only have positional parameters. Best practice fornon-dynamic signal methods is to only take a single object/dataclassargument that can accept more fields later if needed. Return values fromsignal methods are ignored.
Parameters | |
fn:CallableSyncOrAsyncReturnNoneType |None | The function to decorate. |
name:str |None | Signal name. Defaults to method__name__. Cannot be presentwhendynamic is present. |
dynamic:bool |None | If true, this handles all signals not otherwise handled. Theparameters of the method must be self, a string name, and a*args positional varargs. Cannot be present whenname ispresent. |
unfinishedHandlerUnfinishedPolicy | Actions taken if a workflow terminates witha running instance of this handler. |
description:str |None | A short description of the signal that may appear in the UI/CLI. |
CallableAsyncNoParam[ ReturnType]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:CallableSyncNoParam[ ReturnType]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:CallableAsyncSingleParam[ ParamType, ReturnType]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:CallableSyncSingleParam[ ParamType, ReturnType]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:Callable[ ..., Awaitable[ ReturnType]]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:Callable[ ..., ReturnType]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:str
, arg:Any
=temporalio.common._arg_unset, *, args:Sequence[ Any]
= [], task_queue:str |None
=None, result_type:type |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ Any]
:Start an activity and return its handle.
At least one ofschedule_to_close_timeout orstart_to_close_timeoutmust be present.
Parameters | |
activity:Any | Activity name or function reference. |
arg:Any | Single argument to the activity. |
args:Sequence[ | Multiple arguments to the activity. Cannot be set if arg is. |
taskstr |None | Task queue to run the activity on. Defaults to the currentworkflow's task queue. |
resulttype |None | For string activities, this can set the specific resulttype hint to deserialize into. |
scheduletimedelta |None | Max amount of time the activity can take fromfirst being scheduled to being completed before it times out. Thisis inclusive of all retries. |
scheduletimedelta |None | Max amount of time the activity can take tobe started from first being scheduled. |
starttimedelta |None | Max amount of time a single activity run cantake from when it starts to when it completes. This is per retry. |
heartbeattimedelta |None | How frequently an activity must invoke heartbeatwhile running before it is considered timed out. |
retrytemporalio.common.RetryPolicy |None | How an activity is retried on failure. If unset, aserver-defined default is used. Set maximum attempts to 1 to disableretries. |
cancellationActivityCancellationType | How the activity is treated when it is cancelled fromthe workflow. |
activitystr |None | Optional unique identifier for the activity. This is anadvanced setting that should not be set unless users are sure theyneed to. Contact Temporal before setting this value. |
versioningVersioningIntent |None | When using the Worker Versioning feature, specifies whether this Activityshould run on a worker with a compatible Build Id or not.Deprecated: Use Worker Deployment versioning instead. |
summary:str |None | A single-line fixed summary for this activity that may appear in UI/CLI.This can be in single-line Temporal markdown format. |
priority:temporalio.common.Priority | Priority of the activity. |
Returns | |
ActivityHandle[ | An activity handle to the activity which is an async task. |
type[ CallableAsyncNoParam[ ReturnType]]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:type[ CallableSyncNoParam[ ReturnType]]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:type[ CallableAsyncSingleParam[ ParamType, ReturnType]]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:type[ CallableSyncSingleParam[ ParamType, ReturnType]]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:type[ Callable[ ..., Awaitable[ ReturnType]]]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:type[ Callable[ ..., ReturnType]]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:Start an activity from a callable class.
Seestart_activity
for parameter and return details.
MethodAsyncNoParam[ SelfType, ReturnType]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:MethodSyncNoParam[ SelfType, ReturnType]
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:MethodAsyncSingleParam[ SelfType, ParamType, ReturnType]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:MethodSyncSingleParam[ SelfType, ParamType, ReturnType]
, arg:ParamType
, *, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:Callable[ Concatenate[ SelfType, MultiParamSpec], Awaitable[ ReturnType]]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:Callable[ Concatenate[ SelfType, MultiParamSpec], ReturnType]
, *, args:Sequence[ Any]
, task_queue:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, heartbeat_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, versioning_intent:VersioningIntent |None
=None, summary:str |None
=None, priority:temporalio.common.Priority
=temporalio.common.Priority.default) ->ActivityHandle[ ReturnType]
:Start an activity from a method.
Seestart_activity
for parameter and return details.
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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=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:temporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None
=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.runfor 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 touuid4 . |
taskstr |None | Task queue to run the workflow on. Defaults to the currentworkflow's task queue. |
resulttype |None | For string workflows, this can set the specific result typehint to deserialize into. |
cancellationChildWorkflowCancellationType | How the child workflow will react to cancellation. |
parentParentClosePolicy | How to handle the child workflow when the parentworkflow closes. |
executiontimedelta |None | Total workflow execution timeout includingretries 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 | Seehttps://docs.temporal.io/docs/content/what-is-a-temporal-cron-job/ |
memo:Mapping[ | Memo for the workflow. |
searchtemporalio.common.SearchAttributes |temporalio.common.TypedSearchAttributes |None | Search attributes for the workflow. The dictionaryform of this is DEPRECATED. |
versioningVersioningIntent |None | When using the Worker Versioning feature, specifies whether this ChildWorkflow 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 appearin 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 inUI/CLI. This can be in Temporal markdown format and can span multiple lines. This isa fixed value on the workflow that cannot be updated. For details that can beupdated, useWorkflow.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. |
CallableAsyncNoParam[ ReturnType]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:CallableSyncNoParam[ ReturnType]
, *, activity_id:str |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:CallableAsyncSingleParam[ ParamType, ReturnType]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:CallableSyncSingleParam[ ParamType, ReturnType]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:Callable[ ..., Awaitable[ ReturnType]]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:Callable[ ..., ReturnType]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:str
, arg:Any
=temporalio.common._arg_unset, *, args:Sequence[ Any]
= [], result_type:type |None
=None, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ Any]
:Start a local activity and return its handle.
At least one ofschedule_to_close_timeout orstart_to_close_timeoutmust be present.
Parameters | |
activity:Any | Activity name or function reference. |
arg:Any | Single argument to the activity. |
args:Sequence[ | Multiple arguments to the activity. Cannot be set if arg is. |
resulttype |None | For string activities, this can set the specific resulttype hint to deserialize into. |
scheduletimedelta |None | Max amount of time the activity can take fromfirst being scheduled to being completed before it times out. Thisis inclusive of all retries. |
scheduletimedelta |None | Max amount of time the activity can take tobe started from first being scheduled. |
starttimedelta |None | Max amount of time a single activity run cantake from when it starts to when it completes. This is per retry. |
retrytemporalio.common.RetryPolicy |None | How an activity is retried on failure. If unset, anSDK-defined default is used. Set maximum attempts to 1 to disableretries. |
localtimedelta |None | Undocumented |
cancellationActivityCancellationType | How the activity is treated when it is cancelled fromthe workflow. |
activitystr |None | Optional unique identifier for the activity. This is anadvanced setting that should not be set unless users are sure theyneed to. Contact Temporal before setting this value. |
summary:str |None | Optional summary for the activity. |
Returns | |
ActivityHandle[ | An activity handle to the activity which is an async task. |
type[ CallableAsyncNoParam[ ReturnType]]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None) ->ActivityHandle[ ReturnType]
:type[ CallableSyncNoParam[ ReturnType]]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None) ->ActivityHandle[ ReturnType]
:type[ CallableAsyncSingleParam[ ParamType, ReturnType]]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None) ->ActivityHandle[ ReturnType]
:type[ CallableSyncSingleParam[ ParamType, ReturnType]]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None) ->ActivityHandle[ ReturnType]
:type[ Callable[ ..., Awaitable[ ReturnType]]]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None) ->ActivityHandle[ ReturnType]
:type[ Callable[ ..., ReturnType]]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None) ->ActivityHandle[ ReturnType]
:Start a local activity from a callable class.
Seestart_local_activity
for parameter and return details.
MethodAsyncNoParam[ SelfType, ReturnType]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:MethodSyncNoParam[ SelfType, ReturnType]
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:MethodAsyncSingleParam[ SelfType, ParamType, ReturnType]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:MethodSyncSingleParam[ SelfType, ParamType, ReturnType]
, arg:ParamType
, *, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:Callable[ Concatenate[ SelfType, MultiParamSpec], Awaitable[ ReturnType]]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:Callable[ Concatenate[ SelfType, MultiParamSpec], ReturnType]
, *, args:Sequence[ Any]
, schedule_to_close_timeout:timedelta |None
=None, schedule_to_start_timeout:timedelta |None
=None, start_to_close_timeout:timedelta |None
=None, retry_policy:temporalio.common.RetryPolicy |None
=None, local_retry_threshold:timedelta |None
=None, cancellation_type:ActivityCancellationType
=ActivityCancellationType.TRY_CANCEL, activity_id:str |None
=None, summary:str |None
=None) ->ActivityHandle[ ReturnType]
:Start a local activity from a method.
Seestart_local_activity
for parameter and return details.
Current nanoseconds since the epoch from the workflow perspective.
This is the workflow equivalent oftime.time_ns
.
Returns | |
int | Nanoseconds since the epoch |
Callable[ MultiParamSpec, Awaitable[ ReturnType]]
) ->UpdateMethodMultiParam[ MultiParamSpec, ReturnType]
:Callable[ MultiParamSpec, ReturnType]
) ->UpdateMethodMultiParam[ MultiParamSpec, ReturnType]
:HandlerUnfinishedPolicy
=HandlerUnfinishedPolicy.WARN_AND_ABANDON, description:str |None
=None) ->Callable[ [ Callable[ MultiParamSpec, ReturnType]], UpdateMethodMultiParam[ MultiParamSpec, ReturnType]]
:str
, unfinished_policy:HandlerUnfinishedPolicy
=HandlerUnfinishedPolicy.WARN_AND_ABANDON, description:str |None
=None) ->Callable[ [ Callable[ MultiParamSpec, ReturnType]], UpdateMethodMultiParam[ MultiParamSpec, ReturnType]]
:Literal[ True]
, unfinished_policy:HandlerUnfinishedPolicy
=HandlerUnfinishedPolicy.WARN_AND_ABANDON, description:str |None
=None) ->Callable[ [ Callable[ MultiParamSpec, ReturnType]], UpdateMethodMultiParam[ MultiParamSpec, ReturnType]]
:Decorator for a workflow update handler method.
This is used on any async or non-async method that you wish to be called uponreceiving an update. If a function overrides one with this decorator, it toomust be decorated.
You may also optionally define a validator method that will be called beforethis handler you have applied this decorator to. You can specify the validatorwith@update_handler_function_name.validator.
Update methods can only have positional parameters. Best practice fornon-dynamic update methods is to only take a single object/dataclassargument that can accept more fields later if needed. The handler may returna serializable value which will be sent back to the caller of the update.
Parameters | |
fn:CallableSyncOrAsyncType |None | The function to decorate. |
name:str |None | Update name. Defaults to method__name__. Cannot be presentwhendynamic is present. |
dynamic:bool |None | If true, this handles all updates not otherwise handled. Theparameters of the method must be self, a string name, and a*args positional varargs. Cannot be present whenname ispresent. |
unfinishedHandlerUnfinishedPolicy | Actions taken if a workflow terminates witha running instance of this handler. |
description:str |None | A short description of the update that may appear in the UI/CLI. |
Adds, modifies, and/or removes memos, with upsert semantics.
Every memo that has a matching key has its value replaced with the one specified inupdates.If the value is set toNone, the memo is removed instead.For every key with no existing memo, a new memo is added with specified value (unless the value isNone).Memos with keys not included inupdates remain unchanged.
temporalio.common.SearchAttributes |Sequence[ temporalio.common.SearchAttributeUpdate]
): (source) ¶Upsert search attributes for this workflow.
Parameters | |
attributes:temporalio.common.SearchAttributes |Sequence[ | The attributes to set. This should be a sequence ofupdates (i.e. values created via value_set and value_unset calls onsearch attribute keys). The dictionary form of attributes isDEPRECATED and if used, result in invalid key types on thetyped_search_attributes property in the info. |
Iterable[ _FT]
, *, timeout:float |None
=None, return_when:str
=asyncio.ALL_COMPLETED) ->tuple[ list[ _FT], list[ _FT]]
:Iterable[ asyncio.Task[ AnyType]]
, *, timeout:float |None
=None, return_when:str
=asyncio.ALL_COMPLETED) ->tuple[ list[ asyncio.Task[ AnyType]], list[ asyncio.Task[ AnyType]]]
:Wait for the Futures or Tasks given by fs to complete.
This is a deterministic version ofasyncio.wait
. This functionshould be used instead of that one in workflows.
Callable[ [], bool]
, *, timeout:timedelta |float |None
=None, timeout_summary:str |None
=None): (source) ¶Wait on a callback to become true.
This function returns when the callback returns true (invoked each loopiteration) or the timeout has been reached.
Parameters | |
fn:Callable[ | Non-async callback that accepts no parameters and returns a boolean. |
timeout:timedelta |float |None | Optional number of seconds to wait until throwingasyncio.TimeoutError . |
timeoutstr |None | Optional simple string identifying the timer (created iftimeout ispresent) that may be visible in UI/CLI. While it can be normal text, it is best to treatas a timer ID. |
Logger that will have contextual workflow details embedded.
Logs are skipped during replay by default.
Callable
, arg_types:list[ type] |None
, is_method:bool
) ->bool
: (source) ¶Undocumented
_UpdateDefinition
, fn:Callable[ ..., None] |None
=None) ->Callable[ ..., None] |None
: (source) ¶Decorator for a workflow update validator method.
Iterable[ asyncio.Future |asyncio.Task]
, timeout:float |None
, return_when:str
, loop:asyncio.AbstractEventLoop
) ->tuple[ list, list]
: (source) ¶Undocumented