- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 05:58 AM
I am trying to schedule a Flow to run on the last Monday of every month, but I am unsure of how to set that up. Does anyone know how to do that?
(And yes, it does actually have to be the last Monday of every month - there is no leeway there, so please do not offer any suggestions that do not meet that requirement.)
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 06:31 AM
you will have to make flow run daily, then create a custom flow action and check if today is last Monday of the month.
It will return true/false.
if true then your next steps run, if false then your flow ends
OR
You can use daily scheduled job and use Conditional script, something like this and you can enhance
add that script and set answer=true or false in this script
Schedule report to run on last Friday of every month
Scheduled Job Condition - First Monday of Every Month
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 06:59 AM
Thank you. That gave me the information I needed to complete this.
I first created a Custom Action to check if we were in the last week of the month, by adapting the code in the link. The Script for that Custom Action looks like this:
(function execute(inputs, outputs) {
var report_date = new GlideDateTime();
var days_in_month = report_date.getDaysInMonthUTC();
var day_of_month = report_date.getDayOfMonthUTC();
if (day_of_month >= days_in_month - 6) {
outputs.islastweekofmonth = true;
} else {
outputs.islastweekofmonth = false;
}
})(inputs, outputs);
And I set the Trigger of my flow to run at a certain time every Monday (every day not necessary, since I only want it to run on the last Monday of every Month). And the first step of my flow as to call the Custom Action to return a True/False value indicating if where we in the last week of the month. If that returns TRUE, it proceeds to create my Task.
Thanks for the help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 08:47 AM
Glad to help.
Happy learning.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 06:36 AM - edited 07-23-2025 06:42 AM
Hello @jmiske
As per my knowledge we cannot add such condition to flow.
Here is another way:
You can create a scheduled job and add the following script in the Condition field:
isLastMondayToday();
function isLastMondayToday() {
var today = new GlideDateTime();
var year = today.getYearLocalTime();
var month = today.getMonthLocalTime();
var lastMonday = getLastMonday(year, month);
answer = today.getDate().getDisplayValue() == lastMonday.getDisplayValue();
}
function getLastMonday(year, month) {
var gdt = new GlideDateTime();
gdt.setDisplayValue(year + '-' + month + '-01');
gdt.addMonthsUTC(1);
gdt.addDaysUTC(-1);
while (gdt.getDayOfWeekUTC() != 1) {
gdt.addDaysUTC(-1);
}
return gdt.getDate();
}
And in script call your flow.