Skip to content

Commit 46c7c39

Browse files
authored
Add function to cancel running flow executions
1 parent 0ee4c26 commit 46c7c39

File tree

1 file changed

+16
-0
lines changed
  • Client-Side Components/UI Actions/Cancel Flow Executions

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
function cancelRunningFlows() {
2+
3+
try {
4+
var grFlowExecution = new GlideRecord("sys_flow_context");
5+
grFlowExecution.addQuery("source_record", current.sys_id);
6+
grFlowExecution.query();
7+
8+
while (grFlowExecution.next()) {
9+
sn_fd.FlowAPI.cancel(grFlowExecution.getUniqueValue(), "Canceling Flows");
10+
}
11+
} catch (error) {
12+
gs.error("Error cancelling flows: " + error.message);
13+
}
14+
}
15+
16+

0 commit comments

Comments
 (0)