Speed up Workflow testing on "Timer" utility
Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
| Workflow Editor is a legacy product to maintain existing workflows already in production. For new use cases and workflows, use ServiceNow Workflow Studio. Workflow Studio is a low-code alternative to Workflow Editor. |
|---|
Hi there,
With Flow Designer, 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 Flow Designer temporarily so it uses a shorter time?
So how about Workflows? How can you shortcut testing on Workflows and for example using the "Timer" utility?
Flow Designer
One of the possibilities to shorten testing on Flow Designer with for example "Wait for a duration of time", is to look up the record involved in the Events table [sysevent]. There you could simply update the Process on field value. This way you do see which date has been entered or calculated and if it's valid, and you can simply update it so you don't have to wait for hours/days.
Workflow
So how about Workflows? Are you temporarily changing the duration of the Timer utility in your workflow during testing, or is this actually also stored somewhere in a record in a table?
The associated record for a "Timer" activity is not stored in the sysevent table like Flow Designer does have. If you search a bit, you would come across the Schedule table [sys_trigger].
Schedule [sys_trigger]
When a "Timer" utility in a Workflow is reached, a record will be generated in the Schedule table. The Schedule record can be identified while filtering on "trigger_type=0, document=wf_executing".
document=wf_executingtrigger_type=0
Depending on how many Workflow contexts are active, this could be a lengthy list obviously. You might already identify the Schedule you are after based on the date mentioned on the Next action, though more reliable: copy the sys_id value from your active Workflow contexts (obtain it for example through "Workflow > Active Contexts") and filter in the Schedule table on name=Workflow, for example: name=Workflow094296e4db34e410a0a26f7748961948.
Schedule: Next action
So the trick to speed up testing… Field Next action [next_action]. You could just update the value of this field, similar to doing for the Process on on Event records for Flow Designer!
And that's it actually. Once you know this, so easy.
---
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
---
https://www.servicenow.com/community/developer-articles/speed-up-workflow-testing-on-quot-timer-quot-utility/ta-p/2324157
