@@ -206,12 +206,12 @@ async def _handle_activation(
206206
207207 # Extract a couple of jobs from the activation
208208 cache_remove_job = None
209- start_job = None
209+ initialize_job = None
210210 for job in act .jobs :
211211 if job .HasField ("remove_from_cache" ):
212212 cache_remove_job = job .remove_from_cache
213- elif job .HasField ("start_workflow " ):
214- start_job = job .start_workflow
213+ elif job .HasField ("initialize_workflow " ):
214+ initialize_job = job .initialize_workflow
215215
216216 # Build default success completion (e.g. remove-job-only activations)
217217 completion = (
@@ -236,13 +236,13 @@ async def _handle_activation(
236236 workflow = self ._running_workflows .get (act .run_id )
237237 if not workflow and not cache_remove_job :
238238 # Must have a start job to create instance
239- if not start_job :
239+ if not initialize_job :
240240 raise RuntimeError (
241241 "Missing start workflow, workflow could have unexpectedly been removed from cache"
242242 )
243- workflow = self ._create_workflow_instance (act , start_job )
243+ workflow = self ._create_workflow_instance (act , initialize_job )
244244 self ._running_workflows [act .run_id ] = workflow
245- elif start_job :
245+ elif initialize_job :
246246 # This should never happen
247247 logger .warn ("Cache already exists for activation with start job" )
248248
@@ -354,54 +354,56 @@ async def _handle_activation(
354354 def _create_workflow_instance (
355355 self ,
356356 act : temporalio .bridge .proto .workflow_activation .WorkflowActivation ,
357- start : temporalio .bridge .proto .workflow_activation .StartWorkflow ,
357+ initialize : temporalio .bridge .proto .workflow_activation .InitializeWorkflow ,
358358 ) -> WorkflowInstance :
359359 # Get the definition
360- defn = self ._workflows .get (start .workflow_type , self ._dynamic_workflow )
360+ defn = self ._workflows .get (initialize .workflow_type , self ._dynamic_workflow )
361361 if not defn :
362362 workflow_names = ", " .join (sorted (self ._workflows .keys ()))
363363 raise temporalio .exceptions .ApplicationError (
364- f"Workflow class { start .workflow_type } is not registered on this worker, available workflows: { workflow_names } " ,
364+ f"Workflow class { initialize .workflow_type } is not registered on this worker, available workflows: { workflow_names } " ,
365365 type = "NotFoundError" ,
366366 )
367367
368368 # Build info
369369 parent : Optional [temporalio .workflow .ParentInfo ] = None
370- if start .HasField ("parent_workflow_info" ):
370+ if initialize .HasField ("parent_workflow_info" ):
371371 parent = temporalio .workflow .ParentInfo (
372- namespace = start .parent_workflow_info .namespace ,
373- run_id = start .parent_workflow_info .run_id ,
374- workflow_id = start .parent_workflow_info .workflow_id ,
372+ namespace = initialize .parent_workflow_info .namespace ,
373+ run_id = initialize .parent_workflow_info .run_id ,
374+ workflow_id = initialize .parent_workflow_info .workflow_id ,
375375 )
376376 info = temporalio .workflow .Info (
377- attempt = start .attempt ,
378- continued_run_id = start .continued_from_execution_run_id or None ,
379- cron_schedule = start .cron_schedule or None ,
380- execution_timeout = start .workflow_execution_timeout .ToTimedelta ()
381- if start .HasField ("workflow_execution_timeout" )
377+ attempt = initialize .attempt ,
378+ continued_run_id = initialize .continued_from_execution_run_id or None ,
379+ cron_schedule = initialize .cron_schedule or None ,
380+ execution_timeout = initialize .workflow_execution_timeout .ToTimedelta ()
381+ if initialize .HasField ("workflow_execution_timeout" )
382382 else None ,
383- headers = dict (start .headers ),
383+ headers = dict (initialize .headers ),
384384 namespace = self ._namespace ,
385385 parent = parent ,
386- raw_memo = dict (start .memo .fields ),
387- retry_policy = temporalio .common .RetryPolicy .from_proto (start .retry_policy )
388- if start .HasField ("retry_policy" )
386+ raw_memo = dict (initialize .memo .fields ),
387+ retry_policy = temporalio .common .RetryPolicy .from_proto (
388+ initialize .retry_policy
389+ )
390+ if initialize .HasField ("retry_policy" )
389391 else None ,
390392 run_id = act .run_id ,
391- run_timeout = start .workflow_run_timeout .ToTimedelta ()
392- if start .HasField ("workflow_run_timeout" )
393+ run_timeout = initialize .workflow_run_timeout .ToTimedelta ()
394+ if initialize .HasField ("workflow_run_timeout" )
393395 else None ,
394396 search_attributes = temporalio .converter .decode_search_attributes (
395- start .search_attributes
397+ initialize .search_attributes
396398 ),
397399 start_time = act .timestamp .ToDatetime ().replace (tzinfo = timezone .utc ),
398400 task_queue = self ._task_queue ,
399- task_timeout = start .workflow_task_timeout .ToTimedelta (),
401+ task_timeout = initialize .workflow_task_timeout .ToTimedelta (),
400402 typed_search_attributes = temporalio .converter .decode_typed_search_attributes (
401- start .search_attributes
403+ initialize .search_attributes
402404 ),
403- workflow_id = start .workflow_id ,
404- workflow_type = start .workflow_type ,
405+ workflow_id = initialize .workflow_id ,
406+ workflow_type = initialize .workflow_type ,
405407 )
406408
407409 # Create instance from details
@@ -411,7 +413,7 @@ def _create_workflow_instance(
411413 interceptor_classes = self ._interceptor_classes ,
412414 defn = defn ,
413415 info = info ,
414- randomness_seed = start .randomness_seed ,
416+ randomness_seed = initialize .randomness_seed ,
415417 extern_functions = self ._extern_functions ,
416418 disable_eager_activity_execution = self ._disable_eager_activity_execution ,
417419 worker_level_failure_exception_types = self ._workflow_failure_exception_types ,
0 commit comments