@@ -260,7 +260,7 @@ def __init__(
260260 }[input .op_input .caller_reference ],
261261 endpoint = make_nexus_endpoint_name (task_queue ),
262262 )
263- self ._nexus_operation_started = False
263+ self ._nexus_operation_start_resolved = False
264264 self ._proceed = False
265265
266266 @workflow .run
@@ -271,12 +271,14 @@ async def run(
271271 task_queue : str ,
272272 ) -> CallerWfOutput :
273273 op_input = input .op_input
274- op_handle = await self .nexus_client .start_operation (
275- self ._get_operation (op_input ), # type: ignore[arg-type] # test uses non-public operation types
276- op_input ,
277- headers = op_input .headers ,
278- )
279- self ._nexus_operation_started = True
274+ try :
275+ op_handle = await self .nexus_client .start_operation (
276+ self ._get_operation (op_input ), # type: ignore[arg-type] # test uses non-public operation types
277+ op_input ,
278+ headers = op_input .headers ,
279+ )
280+ finally :
281+ self ._nexus_operation_start_resolved = True
280282 if not input .op_input .response_type .exception_in_operation_start :
281283 if isinstance (input .op_input .response_type , SyncResponse ):
282284 assert (
@@ -295,8 +297,8 @@ async def run(
295297 return CallerWfOutput (op_output = OpOutput (value = op_output .value ))
296298
297299 @workflow .update
298- async def wait_nexus_operation_started (self ) -> None :
299- await workflow .wait_condition (lambda : self ._nexus_operation_started )
300+ async def wait_nexus_operation_start_resolved (self ) -> None :
301+ await workflow .wait_condition (lambda : self ._nexus_operation_start_resolved )
300302
301303 @staticmethod
302304 def _get_operation (
@@ -720,7 +722,7 @@ async def _start_wf_and_nexus_op(
720722 )
721723
722724 await client .execute_update_with_start_workflow (
723- CallerWorkflow .wait_nexus_operation_started ,
725+ CallerWorkflow .wait_nexus_operation_start_resolved ,
724726 start_workflow_operation = start_op ,
725727 )
726728 caller_wf_handle = await start_op .workflow_handle ()
0 commit comments