@@ -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+ init_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+ init_job = job .initialize_workflow
215215
216216 # Build default success completion (e.g. remove-job-only activations)
217217 completion = (
@@ -235,16 +235,16 @@ async def _handle_activation(
235235 if not cache_remove_job or not self ._disable_safe_eviction :
236236 workflow = self ._running_workflows .get (act .run_id )
237237 if not workflow and not cache_remove_job :
238- # Must have a start job to create instance
239- if not start_job :
238+ # Must have a initialize job to create instance
239+ if not init_job :
240240 raise RuntimeError (
241- "Missing start workflow, workflow could have unexpectedly been removed from cache"
241+ "Missing initialize 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 , init_job )
244244 self ._running_workflows [act .run_id ] = workflow
245- elif start_job :
245+ elif init_job :
246246 # This should never happen
247- logger .warn ("Cache already exists for activation with start job" )
247+ logger .warn ("Cache already exists for activation with initialize job" )
248248
249249 # Run activation in separate thread so we can check if it's
250250 # deadlocked
@@ -354,54 +354,54 @@ 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+ init : 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 (init .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 { init .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 init .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 = init .parent_workflow_info .namespace ,
373+ run_id = init .parent_workflow_info .run_id ,
374+ workflow_id = init .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 = init .attempt ,
378+ continued_run_id = init .continued_from_execution_run_id or None ,
379+ cron_schedule = init .cron_schedule or None ,
380+ execution_timeout = init .workflow_execution_timeout .ToTimedelta ()
381+ if init .HasField ("workflow_execution_timeout" )
382382 else None ,
383- headers = dict (start .headers ),
383+ headers = dict (init .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 (init .memo .fields ),
387+ retry_policy = temporalio .common .RetryPolicy .from_proto (init .retry_policy )
388+ if init .HasField ("retry_policy" )
389389 else None ,
390390 run_id = act .run_id ,
391- run_timeout = start .workflow_run_timeout .ToTimedelta ()
392- if start .HasField ("workflow_run_timeout" )
391+ run_timeout = init .workflow_run_timeout .ToTimedelta ()
392+ if init .HasField ("workflow_run_timeout" )
393393 else None ,
394394 search_attributes = temporalio .converter .decode_search_attributes (
395- start .search_attributes
395+ init .search_attributes
396396 ),
397397 start_time = act .timestamp .ToDatetime ().replace (tzinfo = timezone .utc ),
398398 task_queue = self ._task_queue ,
399- task_timeout = start .workflow_task_timeout .ToTimedelta (),
399+ task_timeout = init .workflow_task_timeout .ToTimedelta (),
400400 typed_search_attributes = temporalio .converter .decode_typed_search_attributes (
401- start .search_attributes
401+ init .search_attributes
402402 ),
403- workflow_id = start .workflow_id ,
404- workflow_type = start .workflow_type ,
403+ workflow_id = init .workflow_id ,
404+ workflow_type = init .workflow_type ,
405405 )
406406
407407 # Create instance from details
@@ -411,7 +411,7 @@ def _create_workflow_instance(
411411 interceptor_classes = self ._interceptor_classes ,
412412 defn = defn ,
413413 info = info ,
414- randomness_seed = start .randomness_seed ,
414+ randomness_seed = init .randomness_seed ,
415415 extern_functions = self ._extern_functions ,
416416 disable_eager_activity_execution = self ._disable_eager_activity_execution ,
417417 worker_level_failure_exception_types = self ._workflow_failure_exception_types ,
0 commit comments