A workflow with dynamic Waiting time

mahmoudhabiball
Giga Contributor

Hi,

I have the following Problem:

I have a catalog Item, that can be requested via Form. Once Requested, a workflow will be triggered on this Item.

The Item includes data to activate an AD User. But the activation time depends on the input. If the input says, the user should be activated in one month, then the workflow needs to wait there for one month.

And because the workflow might be running and waiting for a long time, I want to be able to cancel it (changing the state of the request).

Is that possible? And what is the best way to implement this in ServiceNow?

Thanks

1 ACCEPTED SOLUTION

Yes if you choose "Timer based on script" then you can calculate the amount of seconds it should wait - pr RITM depending on your input.

If the input says, the user should be activated in one month, then the workflow needs to wait there for one month.

View solution in original post

6 REPLIES 6

what about cancelling he workflow if the state changes. Would it work if I defined to Conditions:

1 - The first is defined in the Script, which holds the timer and sets to true.

2 - The second is one of he predefined drop down condition which checks if the state is not close. Would this cound as an AND?

Theres an OOB business rule on task that cancel thw workflow if state is changed to 4

https://<instance_name>.service-now.com/nav_to.do?uri=sys_script.do?sys_id=69527269c0a80a663a2d934e33801ced

If you have some custom cancellation then you can cancel the workflow 

https://docs.servicenow.com/bundle/jakarta-application-development/page/app-store/dev_portal/API_reference/Workflow/concept/c_Workflow_api.html#ariaid-title3