Flow designer - Restarting a flow
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2021 08:13 PM
Hi All,
Just wondering if anyone has a script that can restart a flow and not trigger approvals.
We have a flow that queries AD through the mids and this sometimes fails for whatever reason. Essentially we just want to give the flow a restart. I know this was possible in the old workflows. Anyone have anything for flow designer?
- Labels:
- 
						
							
		
			Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2021 08:46 PM
Hello Ni,
Please find below link might be it will help you to solve the issue.Please mark helpful it it will really helps you.
Thanks & Regards,
Rupali Bondar,
9082121282
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2021 08:56 PM
Hi,
not possible to re-run the flow in flow designer
You can delete the context record via background script or from sys_flow_context table. 
Also, you can execute the startFlow() API to create a new context of the flow once the executing/errored out flow context is deleted.
Refer below doc for Flow API:
Sample script for running flow from script
try {
		var inputs = {};
		inputs['current'] = ; // GlideRecord of table:  
		inputs['table_name'] = 'incident';
              // Execute Synchronously: Run in foreground.
              // var timeout = ; //timeout in ms
              //sn_fd.FlowAPI.executeFlow('global.test_flow', inputs, timeout)
              sn_fd.FlowAPI.executeFlow('global.test_flow', inputs);
	} catch (ex) {
		var message = ex.getMessage();
		gs.error(message);
	}Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
