How to cancel a workflow timer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2019 08:43 AM
Hey guys:
I am looking for a way to stop a workflow timer. It is messing with a join activity. The timer waits 24 hours to auto approve a request IF the approver doesn't do it within 24 hours. If the approver approves the request before the 24 hours I need a script or a way that will go and stop this timer from continue running.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2019 08:54 AM
Looks like this post has a solution;
var wf = new GlideRecord("wf_context");
wf.addQuery('sys_id', current.context);
wf.query();
while (wf.next())
{
var wfe = new GlideRecord("wf_executing");
wfe.addQuery('context', wf.sys_id);
wfe.addQuery(activity.getDisplayValue(); "Activity Name");
var qc = wfe.addQuery('activity_index', #);
qc.addOrCondition('activity_index, #);
wfe.query();
while (wfe.next())
{
wfe.deleteRecord();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2019 09:23 AM
I tried this script but i cannot make it work. What should i change from this script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2022 03:30 PM
This assumes you have a workflow running against the item and that the catalog item is a variable called current. Have you verified those things? if you add breakpoints or logs does the code give you values you expect and then stop? if so where does it stop?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 09:17 PM
Hey @Jace Benson I am not able delete Executing activity from wf_executing it gives ''
Delete operation against 'wf_executing' has been refused due to the table's cross-scope access policy