- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 11:19 PM - edited 02-04-2025 11:19 PM
Hi @Ankur Bawiskar There are many many subflows. It will be difficult to set flow outputs and check that in the previous flows every time... I am looking for a more generic solution to this kind of issue that is not really customised for this case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 11:29 PM
you cannot have generic solution.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 11:14 PM
Any action that is done, should be checking on the case state. So if somewhere in the flow you are calling a next subflow (or within a subflow actions are performed), you need a check on the state of the Case.
I don't know how complicated the flow is, but it could be as easy as just put a look up record to check on the case state and an 'end flow' if it is canceled.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2025 03:36 AM
Hi @Mark Manders Thanks for responding to my question. I had to do something similar to what you suggested. I had to check if the case is cancelled or not at critical points in my overall flow. If yes, then 'End subflow'.
It worked. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 11:24 PM
Have you tried to cancel the flow when the HR Case get cancelled?
Cancels a paused or running flow, subflow, or action.
cancel(String contextId, String reason)
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');
}
Cheers,
Tai Vu