- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 06:31 AM
Can I specify stopping another flow(B) in one flow(A)? Is there a possibility of this?
Thanks in advance!Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 06:20 PM
Hi @ma kaiyue
You can use sn_fd.FlowAPI.cancel, check below code snippet to cancel a flow:
var now_GR = new GlideRecord("sys_flow_context");
now_GR.addQuery("name", "Test Flow");
now_GR.query();
while (now_GR.next()) {
sn_fd.FlowAPI.cancel(now_GR.getUniqueValue(), 'Canceling Test Flows');
}
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 06:41 PM
Hi @ma kaiyue You cannot STOP the flow, but you can "Cancel" the flow with your condition, you may refer flowAPI below to understand on your use case
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 08:42 PM
Hi @ma kaiyue ,
Please follow the article: How to Cancel In Progress Flow Executions - Support and Troubleshooting (servicenow.com)
Please mark helpful & correct answer if your purpose solved.