Skip to content

Commit f1dba55

Browse files
authored
Added suspend/resume support to DaprWorkflowClient (#661)
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
1 parent fc52f99 commit f1dba55

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/workflow/client/DaprWorkflowClient.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,23 @@ export default class DaprWorkflowClient {
193193
return false;
194194
}
195195

196+
/**
197+
* This method suspends a workflow instance, halting processing of it until resumeWorkflow is used to
198+
* resume the workflow.
199+
* @param {string} workflowInstanceId - The unique identifier of the workflow instance to suspend.
200+
*/
201+
public async suspendWorkflow(workflowInstanceId: string): Promise<void> {
202+
return await this._innerClient.suspendOrchestration(workflowInstanceId);
203+
}
204+
205+
/**
206+
* This method resumes a workflow instance that was suspended via suspendWorkflow.
207+
* @param {string} workflowInstanceId - The unique identifier of the workflow instance to resume.
208+
*/
209+
public async resumeWorkflow(workflowInstanceId: string): Promise<void> {
210+
return await this._innerClient.resumeOrchestration(workflowInstanceId);
211+
}
212+
196213
/**
197214
* Closes the inner DurableTask client and shutdown the GRPC channel.
198215
*/

0 commit comments

Comments
 (0)