diff --git a/src/Dapr.Workflow/Dapr.Workflow.csproj b/src/Dapr.Workflow/Dapr.Workflow.csproj index d5820deb1..9092b101a 100644 --- a/src/Dapr.Workflow/Dapr.Workflow.csproj +++ b/src/Dapr.Workflow/Dapr.Workflow.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/src/Dapr.Workflow/DaprWorkflowClient.cs b/src/Dapr.Workflow/DaprWorkflowClient.cs index 4c4902dbb..e4c88f0ef 100644 --- a/src/Dapr.Workflow/DaprWorkflowClient.cs +++ b/src/Dapr.Workflow/DaprWorkflowClient.cs @@ -158,10 +158,10 @@ public async Task WaitForWorkflowCompletionAsync( /// the terminated state. /// /// - /// Terminating a workflow instance has no effect on any in-flight activity function executions - /// or child workflows that were started by the terminated instance. Those actions will continue to run - /// without interruption. However, their results will be discarded. If you want to terminate child-workflows, - /// you must issue separate terminate commands for each child workflow instance individually. + /// Terminating a workflow terminates all of the child workflow instances that were created by the target. But it + /// has no effect on any in-flight activity function executions + /// that were started by the terminated instance. Those actions will continue to run + /// without interruption. However, their results will be discarded. /// /// At the time of writing, there is no way to terminate an in-flight activity execution. /// @@ -178,7 +178,11 @@ public Task TerminateWorkflowAsync( string? output = null, CancellationToken cancellation = default) { - return this.innerClient.TerminateInstanceAsync(instanceId, output, cancellation); + TerminateInstanceOptions options = new TerminateInstanceOptions { + Output = output, + Recursive = true, + }; + return this.innerClient.TerminateInstanceAsync(instanceId, options, cancellation); } /// @@ -269,6 +273,9 @@ public Task ResumeWorkflowAsync( /// , , or /// state can be purged. /// + /// + /// Purging a workflow purges all of the child workflows that were created by the target. + /// /// /// The unique ID of the workflow instance to purge. /// @@ -280,7 +287,8 @@ public Task ResumeWorkflowAsync( /// public async Task PurgeInstanceAsync(string instanceId, CancellationToken cancellation = default) { - PurgeResult result = await this.innerClient.PurgeInstanceAsync(instanceId, cancellation); + PurgeInstanceOptions options = new PurgeInstanceOptions {Recursive = true}; + PurgeResult result = await this.innerClient.PurgeInstanceAsync(instanceId, options, cancellation); return result.PurgedInstanceCount > 0; }