How do I keep the waiting period in a subflow, flow, and workflow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello everyone,
I’m currently testing a workflow and subflow, but both include waiting conditions.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025,2026
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
why not add small wait time for your testing?
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
