How to schedule a Power Automate flow to run only on work days
Posted On December 30, 2020
“My Power Automate flow is scheduled to run every day, but that includes also weekends. How can I set it up to run only on work days?”
When scheduling a flow in Power Automate, the default options are quite limited, even when switched to advanced options. If they fit your needs it’s fine, but what if you need something more complex, e.g. run the flow only on work days, from Monday to Friday? How can you tell the flow to skip the weekends?
Switch to ‘Week’ frequency
As mentioned by Ben in the comments, there’s actually an easier way. Just switch to ‘Week’ frequency and select the days when the flow should run. 🙂
More complicated alternative: add a trigger condition
Luckily, all the trigger actions in Power Automate allow you to define trigger conditions: another check if the flow should run. The first check is the trigger itself, what must happen for the flow to start? If the flow passes the first check, it’ll move to the second one – trigger condition. You can imagine the flow thinking: “the trigger event happened, but should I run or ignore it?”.
The trigger condition setting is available under the 3 dots in the trigger actions -> Settings.
At this moment there’s no dynamic content available as the condition is evaluated before the flow starts. You must type in the condition by yourself. What you want to tell the flow is: start only if it’s not Saturday or Sunday today.
To find out what day of week is today, there’s an expression dayOfWeek(). You enter date as a parameter, and the function will return number of the day in the week. Starting from Sunday (=0), incrementing the number for each day until Saturday (=6). Each time the flow will trigger it’ll check the day and run only if it’s not equal to 0 or 6.
Using the trigger condition above, your flow scheduled to run daily will skip Saturdays and Sundays.
When you’re using scheduled flows, e.g. to send reminders, you don’t want to spam your colleagues during weekends. Some work should take place only during work days, and that’s what this post was about. Even automated flows don’t necessary need to run every day.
You can use the same approach also to schedule a flow to run only on a specific day of the week. Instead of running every day and using a condition in the flow, you can use the trigger condition and save some flow runs.