@@ -208,7 +208,7 @@ def raise_workflow_event(
208208 """
209209 return self .__obj .raise_orchestration_event (instance_id , event_name , data = data )
210210
211- def terminate_workflow (self , instance_id : str , * , output : Optional [Any ] = None ):
211+ def terminate_workflow (self , instance_id : str , * , output : Optional [Any ] = None , recursive : bool = True ):
212212 """Terminates a running workflow instance and updates its runtime status to
213213 WorkflowRuntimeStatus.Terminated This method internally enqueues a "terminate" message in
214214 the task hub. When the task hub worker processes this message, it will update the runtime
@@ -226,9 +226,10 @@ def terminate_workflow(self, instance_id: str, *, output: Optional[Any] = None):
226226 Args:
227227 instance_id: The ID of the workflow instance to terminate.
228228 output: The optional output to set for the terminated workflow instance.
229+ recursive: The optional flag to terminate all child workflows.
229230
230231 """
231- return self .__obj .terminate_orchestration (instance_id , output = output )
232+ return self .__obj .terminate_orchestration (instance_id , output = output , recursive = recursive )
232233
233234 def pause_workflow (self , instance_id : str ):
234235 """Suspends a workflow instance, halting processing of it until resume_workflow is used to
@@ -246,3 +247,12 @@ def resume_workflow(self, instance_id: str):
246247 instance_id: The instance ID of the workflow to resume.
247248 """
248249 return self .__obj .resume_orchestration (instance_id )
250+
251+ def purge_workflow (self , instance_id : str , recursive : bool = True ):
252+ """Purge data from a workflow instance.
253+
254+ Args:
255+ instance_id: The instance ID of the workflow to purge.
256+ recursive: The optional flag to also purge data from all child workflows.
257+ """
258+ return self .__obj .purge_orchestration (instance_id , recursive )
0 commit comments