I want to trigger the process on every 7th working day of the month

Hi Everyone, I want to trigger my process on 7th working day of the month, i mean we have to exclude the Saturday and Sunday. So our intention is to run the process on Working days Monday to Friday. i think orchestrator chronic expression is not enough for this logic. Need to implement any extra logic for these scenario.

Can anyone please give suggestion for these

Hi @Gopi_Krishna1

yes, you are right that CRON expression is not enough for same.

An alternative approach would be:

  1. Create custom calendar in orchestrator for weekdays per your organization’s holiday calendar, so it doesn’t have any holidays/weekends.
  2. then choose that custom calendar while creating CRON expression and specify every 7th day.

That should help you :slight_smile:

  1. to create a calendar, go to below location:

  2. Once created, select that calendar from trigger section, and provide cron expression. for example below cron expression would start process 7th day, likewise you can customize per you need(time/day etc):
    0 0 0 7 * ? *

Regards
Sonali

I’m pretty sure the result of this is if the 7th day of the month is a Saturday or Sunday, the calendar will block it from running. I don’t think the trigger combines the cron expression with the calendar to find the 7th working day on the calendar.

@Gopi_Krishna1 the simplest way to do what you want is to code into the automation to check if it’s the 7th working day of the month. If it is, continue, if it is not then stop. Then just create a trigger to run on days 1-9 of the month.

2 Likes

I dont think so.

Custom Calendar here refers to the calendar with only weekdays(no holidays/no weekends included). so now if cron expression is configured to run on 7th day of that calendar, that is essentially 7th working day.

But again, that is something, @Gopi_Krishna1 can configure, implement and confirm the results for.

That’s not how it works. There is no connection between the CRON expression and the calendar, as far as I know. It’s not parsing the CRON expression against the calendar. The CRON expression just determines when it tries to run - no different than if you manually select certain days in the trigger settings. If one of those days is not a working day according to the calendar, it just doesn’t run that day.

Hmm.. I think you may be right there.

If we were to run automations only on working days, then this approach would totally fit.

I will try to run some tests on my end as well to observe the behaviour.

Thanks.

I am also trying to set Trigger for second working day.
Just now i found this link. Orchestrator - Triggering jobs on the last day of the month. May be this will work.

@SVa

LW and FW works fine for last and first weekday of the month.

But 7W or 2W doesn’t mean 7th or 2nd working day , it means closest working day to the 7th day of the month.

@Gopi_Krishna1,

Try this approach:

  1. Have a list of the 7th working day in a file like csv or xlsx because there could be regional holiday’s or time off which we can’t calculate by the code as it’s very dynamic.
  2. Setup a trigger to run the bot everyday
  3. Add logic in bot to check if todays date is in the step one list. If yes, run the bot logic else just finish the execution.

yes. It takes closest working day.

1 Like