Flow cannot be cancelled as the context id: fef1a4951bb5b51033ff62cce54bcb64 doesn't exist

deepika46
Tera Contributor

Hello Experts,

 

While cancelling a flow designer from a server side script i am getting the following error although the context id does exist.

Below is the script i am using:

 

var now_GR = new GlideRecord("sys_flow_context");
now_GR.addQuery("source_record", "436c8d344732211092c98021336d43aa"); //Replace with the sys_id of your RITM
now_GR.query();

while (now_GR.next()) {
sn_fd.FlowAPI.cancel(now_GR.getUniqueValue(), 'Canceling Test Flows');
}

 

Does anyone know the solution to this error

1 REPLY 1

Danish Bhairag2
Tera Sage
Tera Sage

Hi @deepika46 ,

 

Can you check this please 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0860879

 

This might occur due to the Request or RITM being cancelled already.

 

Thanks,

Danish