UiPath Orchestrator Triggers - Cron Expression For specific day of month or next working day if not a working day

I’ve currently got this Cron expression that I’m using to trigger a process in UiPath Orchestrator:

0 0 15 21W * ? *

Runs on the closest working day to the 21st of each month at 3pm.

However I need it to run on the next working day at 3pm if the 21st is a non working day.

Tried searching for an answer and nothing quite fit the brief.

I used this website to build my expression (which is a great tool) but it only had an option for ‘nearest day’ and not next working day given a specific day of month: Free Online Cron Expression Generator and Describer - FreeFormatter.com

Hi @scott.newbould,

I don’t think you will be able to achieve this with raw CRON unfortunatelly.
However, you could build a script that would run say once a month (on 1st) and update/create all the dynamic CRONs that you need (e.g. via the Orchestrator API) for the month

so the script would know that is has to schedule your job for the first working day after 20th, it would calculate what’s the date for the current month (say 23rd because 21st was a saturday) and it would create a one-off trigger for that process for the current month only.

Not perfect and certainly not as easy to implement and maintain as a neat one-liner of a CRON expression but would get the job done :slight_smile:

Thanks - Yeah pitched this to Stackoverflow as well and more or less same conclusions. Appreciate the comments