logo

NJP

Speed up Flow Designer testing on "Wait for a duration of time"

Import · Aug 10, 2020 · article

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

Hi there,

With Workflows, I'm used to taking shortcuts on the testing. Especially when it comes to times… you are not going to wait for days until time passes? Or changing your workflow temporarily so it uses a shorter time?

So what about Flows? How can you shortcut testing on Flow Designer and for example "Wait for a duration of time"?

Workflow

One of the possibilities to shorten testing on Workflow timers would be to locate the Schedule record [sys_trigger] involved. You could simply update the Next action [next_action], so you don't have to wait for hours/days.

Flow Designer

While testing some Flows I thought, let's take the same shortcut as I usually do while testing Workflows. Though… Flows don't seem to be using Schedule records as Workflows do. It took me while searching (and looking back the search could be shortened a lot…), though found a way!

Events [sysevent]

When using for example "Wait for a duration of time" within your Flow, an Event record will be generated. The Event record can be identified while filtering on "name=flow.fire, queue=flow_engine". Because you are after future Events, also filter on "state=ready".

image

name=flow.firequeue=flow_enginestate=ready

Depending on how many Flow Executions are active, this could be a lengthy list obviously. You might already identify the Event you are after based on the dates and Parm1, though more reliable: copy the sys_id value from your active flow (obtain it for example through "Flow Designer > Active Flows") and filter in the Events table on instance=sys_id.

Event: Process on

So the trick to speed up testing… Field Process on [process_on]. You could just update the value of this field, similar to doing for the Next action on Schedule records for Workflows!

And that's it actually. Once you know this, so easy… And actually, when searching in your Navigator for Flow Designer, notice there's an Event Queue module listed. You just have to add the Process on the field to the List opened through this module.

---

And that's it actually. If any questions or remarks, let me know!

Kind regards,

Mark Roethof

ServiceNow Technical Consultant @ Quint Technology

1x ServiceNow Developer MVP

1x ServiceNow Community MVP

---

View original source

https://www.servicenow.com/community/developer-articles/speed-up-flow-designer-testing-on-quot-wait-for-a-duration-of/ta-p/2324331