- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 07:06 AM
How do I rerun a flow that failed or did not generate a task after I had made a modification to the flow?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 08:07 AM
you can use this to re-run the flow for your RITM
var grScReqItem = new GlideRecord('sc_req_item');
grScReqItem.addEncodedQuery("number=RITM0001"); // provide a Query
grScReqItem.query();
if (grScReqItem.next()) {
try {
var inputs = {};
inputs['request_item'] = grScReqItem; // GlideRecord of table: sc_req_item
inputs['table_name'] = 'sc_req_item';
var contextId = sn_fd.FlowAPI.startFlow('your Flow name', inputs);
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
}
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
‎02-27-2025 08:07 AM
you can use this to re-run the flow for your RITM
var grScReqItem = new GlideRecord('sc_req_item');
grScReqItem.addEncodedQuery("number=RITM0001"); // provide a Query
grScReqItem.query();
if (grScReqItem.next()) {
try {
var inputs = {};
inputs['request_item'] = grScReqItem; // GlideRecord of table: sc_req_item
inputs['table_name'] = 'sc_req_item';
var contextId = sn_fd.FlowAPI.startFlow('your Flow name', inputs);
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
}
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
‎02-27-2025 07:57 AM
Hi @athavichith The new changes in the flow will apply only to new records, and there's no need to run the new flow on old records. It's possible that you added a new variable or condition that doesn't match with the old records.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************