How to stop running workflow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2020 09:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2022 01:37 AM
Hi @Ankur Bawiskar ,
The background script is not working for me in Prod. Can you please tell if I need to modify something here.
var gr = new GlideRecord('sc_req_item');
gr.get('69a41e39db96051071310661f39619c9'); //ritm sys_id
var workflow = new Workflow();
workflow.cancel(gr);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2022 01:43 AM - edited ‎12-22-2022 01:43 AM
Hi @sbeginner , If you are looking for cancelling the workflow, you can just cancel the workflow context that is 'Executing'. It will cancel the activity. You can see in this thread on how to cancel it without script by using Cancel Ui action on the context form.
Regards,
Badal Khojare
Community Rising Star 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2020 12:22 PM
Hi
You do not need to go the hard way through code.
Just navigate to Workflow Contexts, and open the Context of the Workflow you want to cancel.
Then, click on "Cancel", like shown in the screenshot below:
Let me know if that answers your question and mark my answer as correct and helpful.
BR
Dirk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 11:28 PM
Hi
Do you have some update on this?
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 11:08 PM
Hi,
Hope you are doing good.
Let me know if that answered your question.
If so, please mark appropriate answer as correct & helpful to close the thread.
If not, please let us know if you need some more assistance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader