@@ -260,7 +260,7 @@ def __init__(
260
260
}[input .op_input .caller_reference ],
261
261
endpoint = make_nexus_endpoint_name (task_queue ),
262
262
)
263
- self ._nexus_operation_started = False
263
+ self ._nexus_operation_start_resolved = False
264
264
self ._proceed = False
265
265
266
266
@workflow .run
@@ -271,12 +271,14 @@ async def run(
271
271
task_queue : str ,
272
272
) -> CallerWfOutput :
273
273
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
280
282
if not input .op_input .response_type .exception_in_operation_start :
281
283
if isinstance (input .op_input .response_type , SyncResponse ):
282
284
assert (
@@ -295,8 +297,8 @@ async def run(
295
297
return CallerWfOutput (op_output = OpOutput (value = op_output .value ))
296
298
297
299
@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 )
300
302
301
303
@staticmethod
302
304
def _get_operation (
@@ -720,7 +722,7 @@ async def _start_wf_and_nexus_op(
720
722
)
721
723
722
724
await client .execute_update_with_start_workflow (
723
- CallerWorkflow .wait_nexus_operation_started ,
725
+ CallerWorkflow .wait_nexus_operation_start_resolved ,
724
726
start_workflow_operation = start_op ,
725
727
)
726
728
caller_wf_handle = await start_op .workflow_handle ()
0 commit comments