2525 _start_nexus_backing_workflow ,
2626 _TemporalStartOperationContext ,
2727)
28- from temporalio .nexus ._token import UpdateHandle
2928from temporalio .types import (
3029 MethodAsyncNoParam ,
3130 MethodAsyncSingleParam ,
3534 SelfType ,
3635)
3736
37+ from ._token import OperationToken , OperationTokenType
38+
3839if TYPE_CHECKING :
3940 import temporalio .client
4041 import temporalio .workflow
@@ -292,6 +293,8 @@ async def start_workflow_update(
292293 id : str | None = None ,
293294 rpc_metadata : Mapping [str , str | bytes ] = {},
294295 rpc_timeout : timedelta | None = None ,
296+ run_id : str | None = None ,
297+ first_execution_run_id : str | None = None ,
295298 ) -> TemporalOperationResult [ReturnType ]: ...
296299
297300 # Overload for single-param update
@@ -307,6 +310,8 @@ async def start_workflow_update(
307310 id : str | None = None ,
308311 rpc_metadata : Mapping [str , str | bytes ] = {},
309312 rpc_timeout : timedelta | None = None ,
313+ run_id : str | None = None ,
314+ first_execution_run_id : str | None = None ,
310315 ) -> TemporalOperationResult [ReturnType ]: ...
311316
312317 # Overload for multi-param update
@@ -320,6 +325,8 @@ async def start_workflow_update(
320325 id : str | None = None ,
321326 rpc_metadata : Mapping [str , str | bytes ] = {},
322327 rpc_timeout : timedelta | None = None ,
328+ run_id : str | None = None ,
329+ first_execution_run_id : str | None = None ,
323330 ) -> TemporalOperationResult [ReturnType ]: ...
324331
325332 # Overload for string-name update
@@ -335,10 +342,10 @@ async def start_workflow_update(
335342 result_type : type [ReturnType ] | None = None ,
336343 rpc_metadata : Mapping [str , str | bytes ] = {},
337344 rpc_timeout : timedelta | None = None ,
345+ run_id : str | None = None ,
346+ first_execution_run_id : str | None = None ,
338347 ) -> TemporalOperationResult [ReturnType ]: ...
339348
340- # draft-review: check why run_id and first_execution_run_id are not used
341- # for update workflow in python sdk
342349 @abstractmethod
343350 async def start_workflow_update (
344351 self ,
@@ -495,7 +502,6 @@ async def start_workflow_update(
495502 first_execution_run_id = first_execution_run_id ,
496503 )
497504 # If the update has already completed, return the result synchronously
498- # This is in-line with the Go implementation as well
499505 if update_handle ._known_outcome is not None :
500506 try :
501507 result = await update_handle .result ()
@@ -504,7 +510,11 @@ async def start_workflow_update(
504510 str (err ), state = OperationErrorState .FAILED
505511 ) from err
506512 return TemporalOperationResult .sync (result )
507- nexus_handle : UpdateHandle [Any ] = (
508- UpdateHandle ._unsafe_from_client_workflow_update_handle (update_handle )
509- )
510- return TemporalOperationResult .async_token (nexus_handle .to_token ())
513+ token = OperationToken (
514+ type = OperationTokenType .UPDATE_WORKFLOW ,
515+ namespace = update_handle ._client .namespace ,
516+ workflow_id = update_handle .workflow_id ,
517+ update_id = update_handle .id ,
518+ run_id = update_handle .workflow_run_id ,
519+ ).encode ()
520+ return TemporalOperationResult .async_token (token )
0 commit comments