The CreatorCon Call for Content is officially open! Get started here.

How to restart the "Flow" from specific step again?

Shantharao
Kilo Sage

Hi All,
How to restart the "Flow" from a specific step again?
For example, I have a flow that contains 20 steps, and the "Ask for approval" step is 10, If I cancel the approval, I want to generate one Task and I want to restart the flow again from the 10th Step
Please suggest the recommended ServiceNow approach to me.
Thanks

5 REPLIES 5

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Shantharao 

 

I am not a developer, but as far as I know, you can use the Goto option in flow, which has been introduced latest. 

*************************************************************************************************************
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]

****************************************************************************************************************

Hi @Dr Atul G- LNG ,
I have used the "Go back to" option but it was introduced in washing ton and had some limitations, not working as expected, is there any other solution like creating a script in the steps to restart 

I have found the code below but bit confused, about where to use it and how to use

var grFlowContext = new GlideRecord('sys_flow_context');
grFlowContext.addQuery('source_record', current.sys_id); // Replace with your source record grFlowContext.addQuery('name', 'Your Flow Name'); grFlowContext.query();
if (grFlowContext.next()) {
sn_fd.FlowAPI.cancel(grFlowContext.sys_id, 'Restarting flow');
}
var inputs = {};
inputs['input_field'] = 'new value'; // Replace with your input data
var contextId = sn_fd.FlowAPI.startFlow('global.your_flow_name', inputs);

Hi @Shantharao 

 

I think it is not feasible via Script. 

 

@Community Alums  @Sandeep Rajput  any thoughts.

*************************************************************************************************************
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]

****************************************************************************************************************

Community Alums
Not applicable

Thanks @Dr Atul G- LNG  for adding me.

@Shantharao ,

You cannot retrigger a flow from specific step as such unfortunately. You can try cancelling the previous context and start new one.

Use this thread as an example :https://www.servicenow.com/community/itsm-forum/flow-designer-restarting-a-flow/td-p/604240#:~:text=....