@@ -851,6 +851,40 @@ async def execute_update_with_start( # type: ignore
851851 rpc_metadata : Mapping [str , str ] = {},
852852 rpc_timeout : Optional [timedelta ] = None ,
853853 ) -> Any :
854+ """Send an update-with-start request and wait for the update to complete.
855+
856+ A WorkflowIDConflictPolicy must be set in the start_workflow_operation. If the
857+ specified workflow execution is not running, a new workflow execution is started
858+ and the update is sent in the first workflow task. Alternatively if the specified
859+ workflow execution is running then, if the WorkflowIDConflictPolicy is
860+ USE_EXISTING, the update is issued against the specified workflow, and if the
861+ WorkflowIDConflictPolicy is FAIL, an error is returned. This call will block until
862+ the update has completed, and return the update result. Note that this means that
863+ the call will not return successfully until the update has been delivered to a
864+ worker.
865+
866+ Args:
867+ update: Update function or name on the workflow. arg: Single argument to the
868+ update. args: Multiple arguments to the update. Cannot be set if arg is.
869+ start_workflow_operation: a WithStartWorkflowOperation definining the
870+ WorkflowIDConflictPolicy and how to start the workflow in the event that a
871+ workflow is started.
872+ id: ID of the update. If not set, the default is a new UUID. result_type: For
873+ string updates, this can set the specific result
874+ type hint to deserialize into.
875+ rpc_metadata: Headers used on the RPC call. Keys here override
876+ client-level RPC metadata keys.
877+ rpc_timeout: Optional RPC deadline to set for the RPC call.
878+
879+ Raises:
880+ WorkflowUpdateFailedError: If the update failed.
881+ WorkflowUpdateRPCTimeoutOrCancelledError: This update call timed out
882+ or was cancelled. This doesn't mean the update itself was timed out or
883+ cancelled.
884+
885+ RPCError: There was some issue starting the workflow or sending the update to
886+ the workflow.
887+ """
854888 handle = await self ._start_update_with_start (
855889 update ,
856890 arg ,
@@ -940,6 +974,43 @@ async def start_update_with_start( # type: ignore
940974 rpc_metadata : Mapping [str , str ] = {},
941975 rpc_timeout : Optional [timedelta ] = None ,
942976 ) -> WorkflowUpdateHandle [Any ]:
977+ """Send an update-with-start request and wait for it to be accepted.
978+
979+ A WorkflowIDConflictPolicy must be set in the start_workflow_operation. If the
980+ specified workflow execution is not running, a new workflow execution is started
981+ and the update is sent in the first workflow task. Alternatively if the specified
982+ workflow execution is running then, if the WorkflowIDConflictPolicy is
983+ USE_EXISTING, the update is issued against the specified workflow, and if the
984+ WorkflowIDConflictPolicy is FAIL, an error is returned. This call will block until
985+ the update has been accepted, and return a WorkflowUpdateHandle. Note that this
986+ means that the call will not return successfully until the update has been
987+ delivered to a worker.
988+
989+ Args:
990+ update: Update function or name on the workflow. arg: Single argument to the
991+ update. args: Multiple arguments to the update. Cannot be set if arg is.
992+ start_workflow_operation: a WithStartWorkflowOperation definining the
993+ WorkflowIDConflictPolicy and how to start the workflow in the event that a
994+ workflow is started.
995+ wait_for_stage: Required stage to wait until returning: either ACCEPTED or
996+ COMPLETED. ADMITTED is not currently supported. See
997+ https://docs.temporal.io/workflows#update for more details.
998+ id: ID of the update. If not set, the default is a new UUID. result_type: For
999+ string updates, this can set the specific result
1000+ type hint to deserialize into.
1001+ rpc_metadata: Headers used on the RPC call. Keys here override
1002+ client-level RPC metadata keys.
1003+ rpc_timeout: Optional RPC deadline to set for the RPC call.
1004+
1005+ Raises:
1006+ WorkflowUpdateFailedError: If the update failed.
1007+ WorkflowUpdateRPCTimeoutOrCancelledError: This update call timed out
1008+ or was cancelled. This doesn't mean the update itself was timed out or
1009+ cancelled.
1010+
1011+ RPCError: There was some issue starting the workflow or sending the update to
1012+ the workflow.
1013+ """
9431014 return await self ._start_update_with_start (
9441015 update ,
9451016 arg ,
@@ -2186,23 +2257,23 @@ async def start_update(
21862257 unrelated to the started workflow.
21872258
21882259 Args:
2189- update: Update function or name on the workflow.
2190- arg: Single argument to the update.
2191- wait_for_stage: Required stage to wait until returning. ADMITTED is
2192- not currently supported. See https://docs.temporal.io/workflows#update
2193- for more details.
2194- args: Multiple arguments to the update. Cannot be set if arg is.
2195- id: ID of the update. If not set, the default is a new UUID.
2196- result_type: For string updates, this can set the specific result
2260+ update: Update function or name on the workflow. arg: Single argument to the
2261+ update.
2262+ wait_for_stage: Required stage to wait until returning: either ACCEPTED or
2263+ COMPLETED. ADMITTED is not currently supported. See
2264+ https://docs.temporal.io/workflows#update for more details.
2265+ args: Multiple arguments to the update. Cannot be set if arg is. id: ID of the
2266+ update. If not set, the default is a new UUID. result_type: For string
2267+ updates, this can set the specific result
21972268 type hint to deserialize into.
21982269 rpc_metadata: Headers used on the RPC call. Keys here override
21992270 client-level RPC metadata keys.
22002271 rpc_timeout: Optional RPC deadline to set for the RPC call.
22012272
22022273 Raises:
22032274 WorkflowUpdateRPCTimeoutOrCancelledError: This update call timed out
2204- or was cancelled. This doesn't mean the update itself was timed
2205- out or cancelled.
2275+ or was cancelled. This doesn't mean the update itself was timed out or
2276+ cancelled.
22062277 RPCError: There was some issue sending the update to the workflow.
22072278 """
22082279 return await self ._start_update (
@@ -2321,8 +2392,7 @@ def get_update_handle_for(
23212392
23222393
23232394class WithStartWorkflowOperation (Generic [SelfType , ReturnType ]):
2324- """
2325- Defines a start-workflow operation used by update-with-start requests.
2395+ """Defines a start-workflow operation used by update-with-start requests.
23262396
23272397 Update-With-Start allows you to send an update to a workflow, while starting the
23282398 workflow if necessary.
@@ -2471,8 +2541,7 @@ def __init__(
24712541 rpc_timeout : Optional [timedelta ] = None ,
24722542 stack_level : int = 2 ,
24732543 ) -> None :
2474- """
2475- Create a WithStartWorkflowOperation.
2544+ """Create a WithStartWorkflowOperation.
24762545
24772546 See :py:meth:`temporalio.client.Client.start_workflow` for documentation of the
24782547 arguments.
@@ -2507,6 +2576,7 @@ def __init__(
25072576 self ._workflow_handle : Future [WorkflowHandle [SelfType , ReturnType ]] = Future ()
25082577
25092578 async def workflow_handle (self ) -> WorkflowHandle [SelfType , ReturnType ]:
2579+ """Return the WorkflowHandle once the workflow is running."""
25102580 return await self ._workflow_handle
25112581
25122582
@@ -5397,8 +5467,7 @@ async def start_workflow_update(
53975467 async def start_workflow_update_with_start (
53985468 self , input : StartWorkflowUpdateWithStartInput
53995469 ) -> WorkflowUpdateHandle [Any ]:
5400- """Called for every :py:meth:`Client.start_update_with_start` and
5401- :py:meth:`Client.execute_update_with_start` call."""
5470+ """Called for every :py:meth:`Client.start_update_with_start` and :py:meth:`Client.execute_update_with_start` call."""
54025471 return await self .next .start_workflow_update_with_start (input )
54035472
54045473 ### Async activity calls
0 commit comments