How to kill flow using script and trigger it using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 04:40 AM
Hi,
im calling a client script that calls a script include and pass as a parameter a sys_id of a change_request.
How can I kill the current flow (not workflow) on the change_request and then trigger a new flow using his sys_id using using on the change_request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 11:34 PM
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 05:26 AM
Hi @Alon Grod ,
You can achieve your requirement by following the below step.
var flowAPI = new sn_fd.FlowAPI();
var inputs = { sys_id: 'your_parameter_sys_id_here' };
flowAPI.startSubflow('subflow_sys_id_name', inputs);
In this example I'm only providing a sys_id as input and expecting the subflow to contain a input "sysid".
Please accept my solution and give it a thumbs up if it's helpful for you.
Thanks & Regards,
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 12:00 AM
Hi @Alon Grod ,
Did you get the chance to check my code?
Please accept my solution and give it a thumbs up if it's helpful for you.
Thanks & Regards,
Prashant