Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How do I keep the waiting period in a subflow, flow, and workflow?

jays34229660407
Tera Contributor

Hello everyone,

 

I’m currently testing a workflow and subflow, but both include waiting conditions.

jays34229660407_0-1789744104732.png

jays34229660407_1-1789744116833.png

 

 

 

Could you please advise whether there’s a way to manage this waiting time through a script or another workaround so I can do my test without wait for waiting time ? 

 

I checked few articles but did not helped 

 

Thanks 

 

 

4 REPLIES 4

Hemanth M
Tera Sage

Hi @jays34229660407 ,

 

why do you have manage waiting time through script?, if you need to update - update directly there

 

if you would like to test update to 1 to 2 minutes and test once done update back to original wait time.

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025,2026

MalakaSilva
Tera Contributor

Unfortunately, for a Date-based Timer in ServiceNow Flow Designer, you generally can't directly "skip" the timer with a script while the flow is paused. The timer creates a scheduled/waiting execution that resumes when the specified date/time is reached.

 

For testing, folloeing is more practical solution.:

 

if (gs.getProperty('my.flow.test_mode') == 'true') {
var testDate = new GlideDateTime();
testDate.addSeconds(30);
return testDate;
}

return current.due_date;

Ankur Bawiskar
Tera Patron

@jays34229660407 

why not add small wait time for your testing?

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

Aditya_hublikar
Giga Sage

Hello @jays34229660407 ,

 

You can simply reduce wait duration while testing . once testing is done you can revert it back to original wait duration .

 

If this helps you then mark it as helpful and accept as solution.

Regards,

Aditya