I have a process in the orchestrator that needs to run exactly every 28 days on Monday.
I’m trying it with the cron expression but can’t get it right.
When I make the trigger every 28 days, it is default always on a saturday:
I tried changing the last ‘?’ to MON or 2 to specify it running on monday, but that gives an error.
Is it possible to somehow get this running on monday?
The solution to running a process in UiPath Orchestrator exactly every 28 days on a Monday is not inherently simple with a single cron expression due to the 28-day cycle misaligning with weeks, causing variations in the weekday.
You can solve this by using a combination approach where you:
Create a simpler schedule, such as running every Monday.
Implement logic within the process to check if it has been 28 days since the last run.
This way, even though the process may trigger every Monday, actual execution will occur only when the 28-day condition is met. You can maintain a record of the last run date in a persistent storage mechanism like a database or a file, and check this date whenever the process is triggered.
Hi @Wout
Can you try using this -
0 0 * * 1 [ $(($(date +%s) / 604800 % 4)) -eq 0 ]
Here’s a breakdown of the expression:
0 0 * * 1: This part schedules the task to run at midnight (00:00) every Monday.
[ $(($(date +\%s) / 604800 \% 4)) -eq 0 ]: This condition ensures that the task runs only every 4 weeks. It calculates the number of weeks since the Unix epoch and checks if it is divisible by 4.
Let me know, if this was helpful by marking the response as solution.
Cheers.