How to delay the workflow without using a timer (timing)?

Mi4
Tera Expert

Hi,

My requirement is that like setting a timer in a workflow, I would like to use business rules and other features to set a delay before the workflow's approval record occurs.

(The real requirement is that I want to copy a file to an approval record, I've confirmed that this can be done by setting a timer before the approval record is created, but it's a non I think it is efficient...)

find_real_file.png

I know 'gs.sleep' is available in global scope, but I don't know where (timing) to implement it.

Example:

At which table and at what timing should the gs.sleep be executed?

 

Such Does anyone know the conditions and implementation method?

 

Regards,

1 ACCEPTED SOLUTION

Mi4
Tera Expert

Hi everyone,

Thank you for advice.

I solved the business rule 'async' by using 'gs.sleep'.

Thank you so much.

Regards,

View solution in original post

9 REPLIES 9

Anil Shewale
Mega Guru

Hi

i think you have to use work for condition yes you can achieve through this activity.

The Wait for condition activity causes the workflow to wait at this activity until the current record matches the specified condition.

The workflow evaluates the Wait for condition activity each time the current record is updated. Use this activity to pause a workflow indefinitely until a particular criteria is met by a record update. To pause a workflow for a timed duration.

for more detail refer the block.

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/workflow-activities/r...

 

If it help mark helpful or correct 

Thanks and regards

Anil

Hi,

Thank you for reply.

After all, is there no choice but to delay in the workflow?

Is the method using gs.sleep or event and script action unrealistic?

Regards,

Megha Padale
Giga Guru

Hi,

You can use wait for condition instead of timer. Use this activity to pause a workflow indefinitely until a particular criteria is met by a record update.

If my answer helped you, mark answer as helpful and correct.

Thanks and regards,

Megha.

Hi,

Thank you for confirm.

After all, is there no choice but to delay in the workflow?

Is the method using gs.sleep or event and script action unrealistic?

Regards,

Mi4
Tera Expert

Hi everyone,

Thank you for advice.

I solved the business rule 'async' by using 'gs.sleep'.

Thank you so much.

Regards,