class Client: (source)
Constructors: Client.connect(target_host, namespace, api_key, data_converter, interceptors, ...)
, Client(service_client, namespace, data_converter, interceptors, default_workflow_query_reject_condition)
Client for accessing Temporal.
Most users will use connect
to create a client. The
service
property provides access to a raw gRPC client. To create
another client, like for a different namespace, Client
may be
directly instantiated with a service
of another.
Clients are not thread-safe and should only be used in the event loop they
are first connected in. If a client needs to be used from another thread
than where it was created, make sure the event loop where it was created is
captured, and then call asyncio.run_coroutine_threadsafe
with the
client call and that event loop.
Clients do not work across forks since runtimes do not work across forks.
Async Static Method | connect |
Connect to a Temporal server. |
Method | __init__ |
Create a Temporal client from a service client. |
Method | api |
Update the API key for this client. |
Method | config |
Config, as a dictionary, used to create this client. |
Async Method | count |
Count workflows. |
Async Method | create |
Create a schedule and return its handle. |
Async Method | execute |
Send an update-with-start request and wait for the update to complete. |
Async Method | execute |
Start a workflow and wait for completion. |
Method | get |
Get an async activity handle. |
Method | get |
Get a schedule handle for the given ID. |
Async Method | get |
Get the Build ID compatibility sets for a specific task queue. |
Async Method | get |
Determine if some Build IDs for certain Task Queues could have tasks dispatched to them. |
Method | get |
Get a workflow handle to an existing workflow by its ID. |
Method | get |
Get a typed workflow handle to an existing workflow by its ID. |
Async Method | list |
List schedules. |
Method | list |
List workflows. |
Method | rpc |
Update the headers for this client. |
Async Method | start |
Send an update-with-start request and wait for it to be accepted. |
Async Method | start |
Start a workflow and return its handle. |
Async Method | update |
Used to add new Build IDs or otherwise update the relative compatibility of Build Ids as defined on a specific task queue for the Worker Versioning feature. |
Property | api |
API key for every call made by this client. |
Property | data |
Data converter used by this client. |
Property | identity |
Identity used in calls by this client. |
Property | namespace |
Namespace used in calls by this client. |
Property | operator |
Raw gRPC operator service client. |
Property | rpc |
Headers for every call made by this client. |
Property | service |
Raw gRPC service client. |
Property | test |
Raw gRPC test service client. |
Property | workflow |
Raw gRPC workflow service client. |
Async Method | _start |
Undocumented |
Instance Variable | _config |
Undocumented |
Instance Variable | _impl |
Undocumented |
async def connect(target_host:
str
, *, namespace: str
= 'default', api_key: Optional[ str]
= None, data_converter: temporalio.converter.DataConverter
= temporalio.converter.DataConverter.default, interceptors: Sequence[ Interceptor]
= [], default_workflow_query_reject_condition: Optional[ temporalio.common.QueryRejectCondition]
= None, tls: Union[ bool, TLSConfig]
= False, retry_config: Optional[ RetryConfig]
= None, keep_alive_config: Optional[ KeepAliveConfig]
= KeepAliveConfig.default, rpc_metadata: Mapping[ str, str]
= {}, identity: Optional[ str]
= None, lazy: bool
= False, runtime: Optional[ temporalio.runtime.Runtime]
= None, http_connect_proxy_config: Optional[ HttpConnectProxyConfig]
= None) -> Client
:
(source)
¶
Connect to a Temporal server.
Parameters | |
targetstr | host:port for the Temporal server. For local development, this is often "localhost:7233". |
namespace:str | Namespace to use for client calls. |
apiOptional[ | API key for Temporal. This becomes the "Authorization" HTTP header with "Bearer " prepended. This is only set if RPC metadata doesn't already have an "authorization" key. |
datatemporalio.converter.DataConverter | Data converter to use for all data conversions to/from payloads. |
interceptors:Sequence[ | Set of interceptors that are chained together to allow intercepting of client calls. The earlier interceptors wrap the later ones. Any interceptors that also implement
|
defaultOptional[ | The default rejection
condition for workflow queries if not set during query. See
WorkflowHandle.query for details on the rejection
condition. |
tls:Union[ | If false, the default, do not use TLS. If true, use system default TLS configuration. If TLS configuration present, that TLS configuration will be used. |
retryOptional[ | Retry configuration for direct service calls (when opted in) or all high-level calls made by this client (which all opt-in to retries by default). If unset, a default retry configuration is used. |
keepOptional[ | Keep-alive configuration for the client connection. Default is to check every 30s and kill the connection if a response doesn't come back in 15s. Can be set to None to disable. |
rpcMapping[ | Headers to use for all calls to the server. Keys here can be overriden by per-call RPC metadata keys. |
identity:Optional[ | Identity for this client. If unset, a default is created based on the version of the SDK. |
lazy:bool | If true, the client will not connect until the first call is attempted or a worker is created with it. Lazy clients cannot be used for workers. |
runtime:Optional[ | The runtime for this client, or the default if unset. |
httpOptional[ | Configuration for HTTP CONNECT proxy. |
Returns | |
Client | Undocumented |
temporalio.service.ServiceClient
, *, namespace: str
= 'default', data_converter: temporalio.converter.DataConverter
= temporalio.converter.DataConverter.default, interceptors: Sequence[ Interceptor]
= [], default_workflow_query_reject_condition: Optional[ temporalio.common.QueryRejectCondition]
= None):
(source)
¶
Create a Temporal client from a service client.
See connect
for details on the parameters.
Update the API key for this client.
This is only set if RPCmetadata doesn't already have an "authorization" key.
Config, as a dictionary, used to create this client.
This makes a shallow copy of the config each call.
Optional[ str]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> WorkflowExecutionCount
:
(source)
¶
Count workflows.
Parameters | |
query:Optional[ | A Temporal visibility filter. See Temporal documentation concerning visibility list filters. |
rpcMapping[ | Headers used on each RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for each RPC call. |
Returns | |
WorkflowExecutionCount | Count of workflows. |
str
, schedule: Schedule
, *, trigger_immediately: bool
= False, backfill: Sequence[ ScheduleBackfill]
= [], memo: Optional[ Mapping[ str, Any]]
= None, search_attributes: Optional[ Union[ temporalio.common.TypedSearchAttributes, temporalio.common.SearchAttributes]]
= None, static_summary: Optional[ str]
= None, static_details: Optional[ str]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> ScheduleHandle
:
(source)
¶
Create a schedule and return its handle.
Parameters | |
id:str | Unique identifier of the schedule. |
schedule:Schedule | Schedule to create. |
triggerbool | If true, trigger one action immediately when creating the schedule. |
backfill:Sequence[ | Set of time periods to take actions on as if that time passed right now. |
memo:Optional[ | Memo for the schedule. Memo for a scheduled workflow is part of the schedule action. |
searchOptional[ | Search attributes for the schedule. Search
attributes for a scheduled workflow are part of the scheduled
action. The dictionary form of this is DEPRECATED, use
temporalio.common.TypedSearchAttributes . |
staticOptional[ | A single-line fixed summary for this workflow execution that may appear in the UI/CLI. This can be in single-line Temporal markdown format. |
staticOptional[ | General fixed details for this 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 temporalio.workflow.get_current_details within the workflow. |
rpcMapping[ | Headers used on the RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for the RPC call. |
Returns | |
ScheduleHandle | A handle to the created schedule. |
Raises | |
ScheduleAlreadyRunningError | If a schedule with this ID is already running. |
temporalio.workflow.UpdateMethodMultiParam[ [ SelfType], LocalReturnType]
, *, start_workflow_operation: WithStartWorkflowOperation[ SelfType, Any]
, id: Optional[ str]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> LocalReturnType
:temporalio.workflow.UpdateMethodMultiParam[ [ SelfType, ParamType], LocalReturnType]
, arg: ParamType
, *, start_workflow_operation: WithStartWorkflowOperation[ SelfType, Any]
, id: Optional[ str]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> LocalReturnType
:temporalio.workflow.UpdateMethodMultiParam[ MultiParamSpec, LocalReturnType]
, *, args: MultiParamSpec.args
, start_workflow_operation: WithStartWorkflowOperation[ SelfType, Any]
, id: Optional[ str]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> LocalReturnType
:str
, arg: Any
= temporalio.common._arg_unset, *, start_workflow_operation: WithStartWorkflowOperation[ Any, Any]
, args: Sequence[ Any]
= [], id: Optional[ str]
= None, result_type: Optional[ Type]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> Any
:Send an update-with-start request and wait for the update to complete.
A WorkflowIDConflictPolicy must be set in the start_workflow_operation. If the specified workflow execution is not running, a new workflow execution is started and the update is sent in the first workflow task. Alternatively if the specified workflow execution is running then, if the WorkflowIDConflictPolicy is USE_EXISTING, the update is issued against the specified workflow, and if the WorkflowIDConflictPolicy is FAIL, an error is returned. This call will block until the update has completed, and return the update result. Note that this means that the call will not return successfully until the update has been delivered to a worker.
Warning
This API is experimental
Parameters | |
update:Union[ | Update function or name on the workflow. arg: Single argument to the update. |
arg:Any | Undocumented |
startWithStartWorkflowOperation[ | a WithStartWorkflowOperation definining the WorkflowIDConflictPolicy and how to start the workflow in the event that a workflow is started. |
args:Sequence[ | Multiple arguments to the update. Cannot be set if arg is. |
id:Optional[ | ID of the update. If not set, the default is a new UUID. |
resultOptional[ | For string updates, this can set the specific result type hint to deserialize into. |
rpcMapping[ | Headers used on the RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for the RPC call. |
Returns | |
Any | Undocumented |
Raises | |
WorkflowUpdateFailedError | If the update failed. |
WorkflowUpdateRPCTimeoutOrCancelledError | This update call timed out or was cancelled. This doesn't mean the update itself was timed out or cancelled. |
RPCError | There was some issue starting the workflow or sending the update to the workflow. |
MethodAsyncNoParam[ SelfType, ReturnType]
, *, id: str
, task_queue: str
, execution_timeout: Optional[ timedelta]
= None, run_timeout: Optional[ timedelta]
= None, task_timeout: Optional[ timedelta]
= None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy
= temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, id_conflict_policy: temporalio.common.WorkflowIDConflictPolicy
= temporalio.common.WorkflowIDConflictPolicy.UNSPECIFIED, retry_policy: Optional[ temporalio.common.RetryPolicy]
= None, cron_schedule: str
= '', memo: Optional[ Mapping[ str, Any]]
= None, search_attributes: Optional[ Union[ temporalio.common.TypedSearchAttributes, temporalio.common.SearchAttributes]]
= None, static_summary: Optional[ str]
= None, static_details: Optional[ str]
= None, start_delay: Optional[ timedelta]
= None, start_signal: Optional[ str]
= None, start_signal_args: Sequence[ Any]
= [], rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None, request_eager_start: bool
= False) -> ReturnType
:MethodAsyncSingleParam[ SelfType, ParamType, ReturnType]
, arg: ParamType
, *, id: str
, task_queue: str
, execution_timeout: Optional[ timedelta]
= None, run_timeout: Optional[ timedelta]
= None, task_timeout: Optional[ timedelta]
= None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy
= temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, id_conflict_policy: temporalio.common.WorkflowIDConflictPolicy
= temporalio.common.WorkflowIDConflictPolicy.UNSPECIFIED, retry_policy: Optional[ temporalio.common.RetryPolicy]
= None, cron_schedule: str
= '', memo: Optional[ Mapping[ str, Any]]
= None, search_attributes: Optional[ Union[ temporalio.common.TypedSearchAttributes, temporalio.common.SearchAttributes]]
= None, static_summary: Optional[ str]
= None, static_details: Optional[ str]
= None, start_delay: Optional[ timedelta]
= None, start_signal: Optional[ str]
= None, start_signal_args: Sequence[ Any]
= [], rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None, request_eager_start: bool
= False) -> ReturnType
:Callable[ Concatenate[ SelfType, MultiParamSpec], Awaitable[ ReturnType]]
, *, args: Sequence[ Any]
, id: str
, task_queue: str
, execution_timeout: Optional[ timedelta]
= None, run_timeout: Optional[ timedelta]
= None, task_timeout: Optional[ timedelta]
= None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy
= temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, id_conflict_policy: temporalio.common.WorkflowIDConflictPolicy
= temporalio.common.WorkflowIDConflictPolicy.UNSPECIFIED, retry_policy: Optional[ temporalio.common.RetryPolicy]
= None, cron_schedule: str
= '', memo: Optional[ Mapping[ str, Any]]
= None, search_attributes: Optional[ Union[ temporalio.common.TypedSearchAttributes, temporalio.common.SearchAttributes]]
= None, static_summary: Optional[ str]
= None, static_details: Optional[ str]
= None, start_delay: Optional[ timedelta]
= None, start_signal: Optional[ str]
= None, start_signal_args: Sequence[ Any]
= [], rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None, request_eager_start: bool
= False) -> ReturnType
:str
, arg: Any
= temporalio.common._arg_unset, *, args: Sequence[ Any]
= [], id: str
, task_queue: str
, result_type: Optional[ Type]
= None, execution_timeout: Optional[ timedelta]
= None, run_timeout: Optional[ timedelta]
= None, task_timeout: Optional[ timedelta]
= None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy
= temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, id_conflict_policy: temporalio.common.WorkflowIDConflictPolicy
= temporalio.common.WorkflowIDConflictPolicy.UNSPECIFIED, retry_policy: Optional[ temporalio.common.RetryPolicy]
= None, cron_schedule: str
= '', memo: Optional[ Mapping[ str, Any]]
= None, search_attributes: Optional[ Union[ temporalio.common.TypedSearchAttributes, temporalio.common.SearchAttributes]]
= None, static_summary: Optional[ str]
= None, static_details: Optional[ str]
= None, start_delay: Optional[ timedelta]
= None, start_signal: Optional[ str]
= None, start_signal_args: Sequence[ Any]
= [], rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None, request_eager_start: bool
= False) -> Any
:Start a workflow and wait for completion.
This is a shortcut for start_workflow
+
WorkflowHandle.result
.
str
, run_id: Optional[ str]
, activity_id: str
) -> AsyncActivityHandle
:(source) ¶
Get an async activity handle.
Either the workflow_id, run_id, and activity_id can be provided, or a singular task_token can be provided.
Parameters | |
workflowOptional[ | Workflow ID for the activity. Cannot be set if task_token is set. |
runOptional[ | Run ID for the activity. Cannot be set if task_token is set. |
activityOptional[ | ID for the activity. Cannot be set if task_token is set. |
taskOptional[ | Task token for the activity. Cannot be set if any of the id parameters are set. |
Returns | |
AsyncActivityHandle | A handle that can be used for completion or heartbeat. |
str
, max_sets: Optional[ int]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> WorkerBuildIdVersionSets
:
(source)
¶
Get the Build ID compatibility sets for a specific task queue.
For more on this feature, see https://docs.temporal.io/workers#worker-versioning
Warning
This API is experimental
Parameters | |
taskstr | The task queue to target. |
maxOptional[ | The maximum number of sets to return. If not specified, all sets will be returned. |
rpcMapping[ | Headers used on each RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for each RPC call. |
Returns | |
WorkerBuildIdVersionSets | Undocumented |
Sequence[ str]
, task_queues: Sequence[ str]
= [], reachability_type: Optional[ TaskReachabilityType]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> WorkerTaskReachability
:
(source)
¶
Determine if some Build IDs for certain Task Queues could have tasks dispatched to them.
For more on this feature, see https://docs.temporal.io/workers#worker-versioning
Warning
This API is experimental
Parameters | |
buildSequence[ | The Build IDs to query the reachability of. At least one must be specified. |
taskSequence[ | Task Queues to restrict the query to. If not specified, all Task Queues will be searched. When requesting a large number of task queues or all task queues associated with the given Build IDs in a namespace, all Task Queues will be listed in the response but some of them may not contain reachability information due to a server enforced limit. When reaching the limit, task queues that reachability information could not be retrieved for will be marked with a NotFetched entry in {@link BuildIdReachability.taskQueueReachability}. The caller may issue another call to get the reachability for those task queues. |
reachabilityOptional[ | The kind of reachability this request is concerned with. |
rpcMapping[ | Headers used on each RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for each RPC call. |
Returns | |
WorkerTaskReachability | Undocumented |
str
, *, run_id: Optional[ str]
= None, first_execution_run_id: Optional[ str]
= None, result_type: Optional[ Type]
= None) -> WorkflowHandle[ Any, Any]
:
(source)
¶
Get a workflow handle to an existing workflow by its ID.
Parameters | |
workflowstr | Workflow ID to get a handle to. |
runOptional[ | Run ID that will be used for all calls. |
firstOptional[ | First execution run ID used for cancellation and termination. |
resultOptional[ | The result type to deserialize into if known. |
Returns | |
WorkflowHandle[ | The workflow handle. |
Union[ MethodAsyncNoParam[ SelfType, ReturnType], MethodAsyncSingleParam[ SelfType, Any, ReturnType]]
, workflow_id: str
, *, run_id: Optional[ str]
= None, first_execution_run_id: Optional[ str]
= None) -> WorkflowHandle[ SelfType, ReturnType]
:
(source)
¶
Get a typed workflow handle to an existing workflow by its ID.
This is the same as get_workflow_handle
but typed.
Parameters | |
workflow:Union[ | The workflow run method to use for typing the handle. |
workflowstr | Workflow ID to get a handle to. |
runOptional[ | Run ID that will be used for all calls. |
firstOptional[ | First execution run ID used for cancellation and termination. |
Returns | |
WorkflowHandle[ | The workflow handle. |
Optional[ str]
= None, *, page_size: int
= 1000, next_page_token: Optional[ bytes]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> ScheduleAsyncIterator
:
(source)
¶
List schedules.
This does not make a request until the first iteration is attempted. Therefore any errors will not occur until then.
Note, this list is eventually consistent. Therefore if a schedule is added or deleted, it may not be available in the list immediately.
Parameters | |
query:Optional[ | A Temporal visibility list filter. See Temporal documentation concerning visibility list filters including behavior when left unset. |
pageint | Maximum number of results for each page. |
nextOptional[ | A previously obtained next page token if doing pagination. Usually not needed as the iterator automatically starts from the beginning. |
rpcMapping[ | Headers used on each RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for each RPC call. |
Returns | |
ScheduleAsyncIterator | An async iterator that can be used with async for. |
Optional[ str]
= None, *, limit: Optional[ int]
= None, page_size: int
= 1000, next_page_token: Optional[ bytes]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> WorkflowExecutionAsyncIterator
:
(source)
¶
List workflows.
This does not make a request until the first iteration is attempted. Therefore any errors will not occur until then.
Parameters | |
query:Optional[ | A Temporal visibility list filter. See Temporal documentation concerning visibility list filters including behavior when left unset. |
limit:Optional[ | Maximum number of workflows to return. If unset, all
workflows are returned. Only applies if using the
returned WorkflowExecutionAsyncIterator .
as an async iterator. |
pageint | Maximum number of results for each page. |
nextOptional[ | A previously obtained next page token if doing pagination. Usually not needed as the iterator automatically starts from the beginning. |
rpcMapping[ | Headers used on each RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for each RPC call. |
Returns | |
WorkflowExecutionAsyncIterator | An async iterator that can be used with async for. |
Update the headers for this client.
Do not mutate this mapping after set. Rather, set an entirely new mapping if changes are needed.
temporalio.workflow.UpdateMethodMultiParam[ [ SelfType], LocalReturnType]
, *, start_workflow_operation: WithStartWorkflowOperation[ SelfType, Any]
, wait_for_stage: WorkflowUpdateStage
, id: Optional[ str]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> WorkflowUpdateHandle[ LocalReturnType]
:temporalio.workflow.UpdateMethodMultiParam[ [ SelfType, ParamType], LocalReturnType]
, arg: ParamType
, *, start_workflow_operation: WithStartWorkflowOperation[ SelfType, Any]
, wait_for_stage: WorkflowUpdateStage
, id: Optional[ str]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> WorkflowUpdateHandle[ LocalReturnType]
:temporalio.workflow.UpdateMethodMultiParam[ MultiParamSpec, LocalReturnType]
, *, args: MultiParamSpec.args
, start_workflow_operation: WithStartWorkflowOperation[ SelfType, Any]
, wait_for_stage: WorkflowUpdateStage
, id: Optional[ str]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> WorkflowUpdateHandle[ LocalReturnType]
:str
, arg: Any
= temporalio.common._arg_unset, *, start_workflow_operation: WithStartWorkflowOperation[ Any, Any]
, wait_for_stage: WorkflowUpdateStage
, args: Sequence[ Any]
= [], id: Optional[ str]
= None, result_type: Optional[ Type]
= None, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> WorkflowUpdateHandle[ Any]
:Send an update-with-start request and wait for it to be accepted.
A WorkflowIDConflictPolicy must be set in the start_workflow_operation. If the specified workflow execution is not running, a new workflow execution is started and the update is sent in the first workflow task. Alternatively if the specified workflow execution is running then, if the WorkflowIDConflictPolicy is USE_EXISTING, the update is issued against the specified workflow, and if the WorkflowIDConflictPolicy is FAIL, an error is returned. This call will block until the update has been accepted, and return a WorkflowUpdateHandle. Note that this means that the call will not return successfully until the update has been delivered to a worker.
Warning
This API is experimental
Parameters | |
update:Union[ | Update function or name on the workflow. arg: Single argument to the update. |
arg:Any | Undocumented |
startWithStartWorkflowOperation[ | a WithStartWorkflowOperation definining the WorkflowIDConflictPolicy and how to start the workflow in the event that a workflow is started. |
waitWorkflowUpdateStage | Required stage to wait until returning: either ACCEPTED or COMPLETED. ADMITTED is not currently supported. See https://docs.temporal.io/workflows#update for more details. |
args:Sequence[ | Multiple arguments to the update. Cannot be set if arg is. |
id:Optional[ | ID of the update. If not set, the default is a new UUID. |
resultOptional[ | For string updates, this can set the specific result type hint to deserialize into. |
rpcMapping[ | Headers used on the RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for the RPC call. |
Returns | |
WorkflowUpdateHandle[ | Undocumented |
Raises | |
WorkflowUpdateFailedError | If the update failed. |
WorkflowUpdateRPCTimeoutOrCancelledError | This update call timed out or was cancelled. This doesn't mean the update itself was timed out or cancelled. |
RPCError | There was some issue starting the workflow or sending the update to the workflow. |
MethodAsyncNoParam[ SelfType, ReturnType]
, *, id: str
, task_queue: str
, execution_timeout: Optional[ timedelta]
= None, run_timeout: Optional[ timedelta]
= None, task_timeout: Optional[ timedelta]
= None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy
= temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, id_conflict_policy: temporalio.common.WorkflowIDConflictPolicy
= temporalio.common.WorkflowIDConflictPolicy.UNSPECIFIED, retry_policy: Optional[ temporalio.common.RetryPolicy]
= None, cron_schedule: str
= '', memo: Optional[ Mapping[ str, Any]]
= None, search_attributes: Optional[ Union[ temporalio.common.TypedSearchAttributes, temporalio.common.SearchAttributes]]
= None, static_summary: Optional[ str]
= None, static_details: Optional[ str]
= None, start_delay: Optional[ timedelta]
= None, start_signal: Optional[ str]
= None, start_signal_args: Sequence[ Any]
= [], rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None, request_eager_start: bool
= False) -> WorkflowHandle[ SelfType, ReturnType]
:MethodAsyncSingleParam[ SelfType, ParamType, ReturnType]
, arg: ParamType
, *, id: str
, task_queue: str
, execution_timeout: Optional[ timedelta]
= None, run_timeout: Optional[ timedelta]
= None, task_timeout: Optional[ timedelta]
= None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy
= temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, id_conflict_policy: temporalio.common.WorkflowIDConflictPolicy
= temporalio.common.WorkflowIDConflictPolicy.UNSPECIFIED, retry_policy: Optional[ temporalio.common.RetryPolicy]
= None, cron_schedule: str
= '', memo: Optional[ Mapping[ str, Any]]
= None, search_attributes: Optional[ Union[ temporalio.common.TypedSearchAttributes, temporalio.common.SearchAttributes]]
= None, static_summary: Optional[ str]
= None, static_details: Optional[ str]
= None, start_delay: Optional[ timedelta]
= None, start_signal: Optional[ str]
= None, start_signal_args: Sequence[ Any]
= [], rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None, request_eager_start: bool
= False) -> WorkflowHandle[ SelfType, ReturnType]
:Callable[ Concatenate[ SelfType, MultiParamSpec], Awaitable[ ReturnType]]
, *, args: Sequence[ Any]
, id: str
, task_queue: str
, execution_timeout: Optional[ timedelta]
= None, run_timeout: Optional[ timedelta]
= None, task_timeout: Optional[ timedelta]
= None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy
= temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, id_conflict_policy: temporalio.common.WorkflowIDConflictPolicy
= temporalio.common.WorkflowIDConflictPolicy.UNSPECIFIED, retry_policy: Optional[ temporalio.common.RetryPolicy]
= None, cron_schedule: str
= '', memo: Optional[ Mapping[ str, Any]]
= None, search_attributes: Optional[ Union[ temporalio.common.TypedSearchAttributes, temporalio.common.SearchAttributes]]
= None, static_summary: Optional[ str]
= None, static_details: Optional[ str]
= None, start_delay: Optional[ timedelta]
= None, start_signal: Optional[ str]
= None, start_signal_args: Sequence[ Any]
= [], rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None, request_eager_start: bool
= False) -> WorkflowHandle[ SelfType, ReturnType]
:str
, arg: Any
= temporalio.common._arg_unset, *, args: Sequence[ Any]
= [], id: str
, task_queue: str
, result_type: Optional[ Type]
= None, execution_timeout: Optional[ timedelta]
= None, run_timeout: Optional[ timedelta]
= None, task_timeout: Optional[ timedelta]
= None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy
= temporalio.common.WorkflowIDReusePolicy.ALLOW_DUPLICATE, id_conflict_policy: temporalio.common.WorkflowIDConflictPolicy
= temporalio.common.WorkflowIDConflictPolicy.UNSPECIFIED, retry_policy: Optional[ temporalio.common.RetryPolicy]
= None, cron_schedule: str
= '', memo: Optional[ Mapping[ str, Any]]
= None, search_attributes: Optional[ Union[ temporalio.common.TypedSearchAttributes, temporalio.common.SearchAttributes]]
= None, static_summary: Optional[ str]
= None, static_details: Optional[ str]
= None, start_delay: Optional[ timedelta]
= None, start_signal: Optional[ str]
= None, start_signal_args: Sequence[ Any]
= [], rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None, request_eager_start: bool
= False) -> WorkflowHandle[ Any, Any]
:Start a workflow and return its handle.
Parameters | |
workflow:Union[ | String name or class method decorated with @workflow.run for the workflow to start. |
arg:Any | Single argument to the workflow. |
args:Sequence[ | Multiple arguments to the workflow. Cannot be set if arg is. |
id:str | Unique identifier for the workflow execution. |
taskstr | Task queue to run the workflow on. |
resultOptional[ | For string workflows, this can set the specific result type hint to deserialize into. |
executionOptional[ | Total workflow execution timeout including retries and continue as new. |
runOptional[ | Timeout of a single workflow run. |
taskOptional[ | Timeout of a single workflow task. |
idtemporalio.common.WorkflowIDReusePolicy | How already-existing IDs are treated. |
idtemporalio.common.WorkflowIDConflictPolicy | How already-running workflows of the same ID are treated. Default is unspecified which effectively means fail the start attempt. This cannot be set if id_reuse_policy is set to terminate if running. |
retryOptional[ | Retry policy for the workflow. |
cronstr | See https://docs.temporal.io/docs/content/what-is-a-temporal-cron-job/ |
memo:Optional[ | Memo for the workflow. |
searchOptional[ | Search attributes for the workflow. The
dictionary form of this is deprecated, use
temporalio.common.TypedSearchAttributes . |
staticOptional[ | A single-line fixed summary for this workflow execution that may appear in the UI/CLI. This can be in single-line Temporal markdown format. |
staticOptional[ | General fixed details for this 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 temporalio.workflow.get_current_details within the workflow. |
startOptional[ | Amount of time to wait before starting the workflow. This does not work with cron_schedule. |
startOptional[ | If present, this signal is sent as signal-with-start instead of traditional workflow start. |
startSequence[ | Arguments for start_signal if start_signal present. |
rpcMapping[ | Headers used on the RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for the RPC call. |
requestbool | Potentially reduce the latency to start this workflow by encouraging the server to start it on a local worker running with this same client. This is currently experimental. |
stackint | Undocumented |
Returns | |
WorkflowHandle[ | A workflow handle to the started workflow. |
Raises | |
temporalio.exceptions.WorkflowAlreadyStartedError | Workflow has already been started. |
RPCError | Workflow could not be started for some other reason. |
str
, operation: BuildIdOp
, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None):
(source)
¶
Used to add new Build IDs or otherwise update the relative compatibility of Build Ids as defined on a specific task queue for the Worker Versioning feature.
For more on this feature, see https://docs.temporal.io/workers#worker-versioning
Warning
This API is experimental
Parameters | |
taskstr | The task queue to target. |
operation:BuildIdOp | The operation to perform. |
rpcMapping[ | Headers used on each RPC call. Keys here override client-level RPC metadata keys. |
rpcOptional[ | Optional RPC deadline to set for each RPC call. |
Headers for every call made by this client.
Do not use mutate this mapping. Rather, set this property with an entirely new mapping to change the headers.
Union[ str, Callable]
, arg: Any
= temporalio.common._arg_unset, *, wait_for_stage: WorkflowUpdateStage
, args: Sequence[ Any]
= [], id: Optional[ str]
= None, result_type: Optional[ Type]
= None, start_workflow_operation: WithStartWorkflowOperation[ SelfType, ReturnType]
, rpc_metadata: Mapping[ str, str]
= {}, rpc_timeout: Optional[ timedelta]
= None) -> WorkflowUpdateHandle[ Any]
:
(source)
¶
Undocumented