CRON expression for the bot to run monthly once, according to a logic

Hello everyone,

I need to schedule my bot to run monthly once on Orchestrator, using CRON expression. And the date on which it should run should be,
i.e, fourth Friday of the week plus 4th working day from the 4th Friday, at 2pm PST

for eg., taking the current month, 4th Friday of April- 26th
4th working days from 4th Friday (adding 29, 30, 01)- 2nd May

So, Bot is required to run on 2nd May next
Also, if this day is holiday, it should run on nearest weekday.

I am able to get the logic for last friday, 2pm, " 0 0 14 ? * 6L * ", not sure how to modify it for 4th Friday and additional 4 working day to it.
I would appreciate any suggestions.

Thankyou so much in advance!! :slightly_smiling_face:

That would be a strange schedule based on the example. You mentioned it needs to run monthly, but based on current month example, the run will happen on next month already basically skipping current month. Maybe give more context as to the basis of the scheduled run (why it has to happen on the fourth working day after the fourth friday) because there are certain cron limitations so it might be possible to be done like 1st week of the month or last week of the month based logic

hi @RPA_Saviour ,

i dont think cron will be able to handle this complex logic. What you can try is either create an excel with the all the dates the bot is supposed to run at, trigger you job every weekday and the first step of your process should reference the excel file and based on that should end or continue processing.

or

Create another process which calculates the next execution date based on your requirements updates an asset with the calculated date and in your process check that asset as the first step of your process based on that you either continue processing or end execution

2 Likes

the requested schedule is not within the nature of a cron expression concept

we would suggest to have a look on an approach where the next schedule is calculated and set (e.g. via REST API) and/or a queueitem is representing a process start event

1 Like