stopping flow

ma kaiyue
Giga Guru

Can I specify stopping another flow(B) in one flow(A)? Is there a possibility of this?

Thanks in advance!
1 ACCEPTED SOLUTION

Hi @ma kaiyue 

You can use sn_fd.FlowAPI.cancel, check below code snippet to cancel a flow:

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');
}

https://developer.servicenow.com/dev.do#!/reference/api/utah/server/sn_fd-namespace/ScriptableFlowAP...

 

Best Regards
Aman Kumar

View solution in original post

6 REPLIES 6

Harish KM
Kilo Patron
Kilo Patron

Hi @ma kaiyue You cannot STOP the flow, but you can "Cancel" the flow with your condition, you may refer flowAPI below to understand on your use case

https://docs.servicenow.com/bundle/washingtondc-api-reference/page/app-store/dev_portal/API_referenc...

Regards
Harish