How to cancel a timer in workflow

Joshuu
Kilo Sage

Hello All,

As shown below, I want the timer should be cancelled once if the approval is completed before 3 days of time. If not completed then it should go to the 2nd level of approval from the timer.

find_real_file.png

What should the next activity in the workflow?

Please assist.

Thanks,

Priya.

1 ACCEPTED SOLUTION

Sukrit
Giga Contributor
Hi Priyarao,
 
I think this can be easily solved by using a sub-flow. Just make another workflow with timer and approvals (these should begin and end together) and call this workflow in the workflow that you have built.
 
Hope this works 🙂
 
Thanks
 
 

 

View solution in original post

27 REPLIES 27

Hi,

why to cancel the timer? let it run no issues.

if the workflow reaches end before timer timer would get cancelled

in the above script you have kept line 6, 8, 9 outside the function

add that inside and test

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Joshuu
Kilo Sage

Hi Ankur,

Because It is running twice as shown below.

find_real_file.png

And the CMDB application is also getting created twice because of this as below.

find_real_file.png

That is why I need to cancel that timer or else I need to write some script to include timer in approval-user condition itself.

Hi,

where is the logic to create cmdb record

the timer activity should not cause an issue for that

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Joshuu
Kilo Sage

Hi Ankur,

This is the next part of the workflow. continuation..

find_real_file.png

 

And for the second level of approval also we have a timer of 10 days. after that we have cancel action. That is why it is working fine as there is no dependency with the second timer. once the 2nd level of approval is done it is automatically getting cancelled. But this 1st level is not like that. It is still running behind. 

asifnoor
Kilo Patron

Hello Priya,

Refer to this link. This might help you.

https://community.servicenow.com/community?id=community_question&sys_id=9160eed3db70af841cd8a345ca96...

Mark the comment as a correct answer and also helpful if this helps to solve the problem.