@@ -213,7 +213,8 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
213213 _LOGGER .debug (
214214 "API.get_instance(%s) returned: -\n %s" , instance_id , str (response )
215215 )
216- r_wfsid : str = response ["running_workflow_step" ]
216+ r_wfsid : str | None = response .get ("running_workflow_step_id" )
217+ assert r_wfsid
217218 rwfs_response , _ = self ._wapi_adapter .get_running_workflow_step (
218219 running_workflow_step_id = r_wfsid
219220 )
@@ -225,7 +226,7 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
225226 step_name : str = rwfs_response ["name" ]
226227
227228 # Get the step's running workflow record.
228- r_wfid = rwfs_response ["running_workflow" ]
229+ r_wfid : str = rwfs_response ["running_workflow" ]
229230 assert r_wfid
230231 rwf_response , _ = self ._wapi_adapter .get_running_workflow (
231232 running_workflow_id = r_wfid
@@ -280,7 +281,7 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
280281 str (response ),
281282 )
282283 assert "id" in rwfs_response
283- r_wfsid = rwfs_response ["id" ]
284+ new_r_wfsid : str = rwfs_response ["id" ]
284285 project_id = rwf_response ["project" ]["id" ]
285286 variables = rwf_response ["variables" ]
286287 lp : LaunchParameters = LaunchParameters (
@@ -292,15 +293,15 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
292293 specification = json .loads (next_step ["specification" ]),
293294 specification_variables = variables ,
294295 running_workflow_id = r_wfid ,
295- running_workflow_step_id = r_wfsid ,
296+ running_workflow_step_id = new_r_wfsid ,
296297 )
297298 lr = self ._instance_launcher .launch (lp )
298299 # Handle a launch error?
299300 if lr .error_num :
300301 self ._set_step_error (
301302 next_step_name ,
302303 r_wfid ,
303- r_wfsid ,
304+ new_r_wfsid ,
304305 lr .error_num ,
305306 lr .error_msg ,
306307 )
0 commit comments