Workflow Timer activity Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I’m troubleshooting a Workflow Timer that should wait until a calculated date, then continue.
Today is Jan 8, 2026.
Yesterday (Jan 7, 2026) I set my Exception Start Date catalog variable to Jan 8, 2025 (a year in the past) for testing. The timer logic adds one year to the date and sets the trigger to 12:00 AM local time on that calculated day.
Based on this, the Timer should have triggered at 12:00 AM on Jan 8, 2026, but the activity is still in a Waiting state this morning and never fired.
Here is the timer script being used:
// Wait until 1 year after exception_start_date (date-only), at 12:00 AM local time
var gd = new GlideDate();
gd.setValue(current.variables.exception_start_date);
gd.addYearsLocalTime(1);
// Convert to DateTime at start of that day
var target = new GlideDateTime();
target.setDisplayValue(gd.getValue() + " 00:00:00");
answer = target.getNumericValue();
Has anyone seen this behavior with Timer activities when using date-only catalog variables? Is there a better way to convert a GlideDate into a GlideDateTime for a Timer so it reliably triggers at the expected time?
Any insight would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
As the comment states, when enabling the Script on a Timer activity, the answer is to be set to the number of seconds the timer should wait. For this use case, consider the approach of basing the timer instead on a date/time or duration field, changing the variable type to date/time if you can and must for this to work, then you can wait for a period after that date/time.
A scripted approach can be tested with a Fix Script for immediate feedback and troubleshooting. You should set the answer to the number of seconds that is now minus the variable value plus one year.
