How to restart a workflow at a certain task when a field value on a form is changed.

sandeep p1
Mega Expert

We have a requirement where we need to restart (after task 1 is completed) the workflow based on a change in the field value of a request form.

Scenario is, there is a field 'hire date' on a HR request form which the user fills in before submitting. Now, the WF has 3 tasks. After the first task is completed, we have an if condition to check if the hire date is <21 days. If it is, then it immediately triggers task 2 and task 3.When it is >21, it needs to wait for certain time(10 days) to trigger task 2 and wait 5 days to trigger task 3, which is also working fine. Now our requirement is, during fulfillment when the hire date is changed by a fulfiller, the workflow needs to restart after the task 1 and check through the if condition and based on new hire date it should trigger task 2 & task 3. Not sure what is the best approach for this, I tried wait for condition & roll back but couldn't achieve desired outcome. Any help is appreciated.

Thanks!

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

I have used a if condition in workflow where i check if the current variable value is same as previous value. And then i have used rollbck activity to bring workflow to activity just after first task.

Restarting the workflow is not a good option i guess. In your case we can use roll back activity.

Thanks,
Ashutosh
ServiceNow MVP 2019

 

Please Mark Answer as Helpful or Correct Based on it's impact.

View solution in original post

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Can you not add an if condition to the workflow that goes straight from 'begin' to 'end' if the relevant field changes, and set the workflow to run multiple times\start whenever the field changes.

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

I have used a if condition in workflow where i check if the current variable value is same as previous value. And then i have used rollbck activity to bring workflow to activity just after first task.

Restarting the workflow is not a good option i guess. In your case we can use roll back activity.

Thanks,
Ashutosh
ServiceNow MVP 2019

 

Please Mark Answer as Helpful or Correct Based on it's impact.