I Want the run bot on the 3rd business day of the month but the non-working days and business holidays comes It should take next day

Hi UiPath team,

I have a question, How i can handle the cron expression, to run the BOT on 3rd business day of the month for example this month has started on Friday (01-July-2022) as per our understanding the BOT will trigger on Sunday (03-July-2022).

My requirement is

Day 1 – July 1st

Day 2 – July 5th

Day 3 – July 6th

July 2-3rd = weekend/non-business day

July 4th = holiday/office closed

How to handle this using the cron expression.

As per my knowledge I have create the Non-working day calendar in the Orchestrator settings and added it to the trigger by taking Cron expression: 0 30 6 3 1/1 ? * But i am not sure this will work or not Can you please help

Regards
Abhiram

Hey! Welcome to community!

The above mentioned expression is working on the bellow days…

|1.|2022-08-03 Wed 06:30:00|
|2.|2022-09-03 Sat 06:30:00|
|3.|2022-10-03 Mon 06:30:00|
|4.|2022-11-03 Thu 06:30:00|
|5.|2022-12-03 Sat 06:30:00|

As per my understanding we need to run the bot with 3 days gap. Am i correct?

And could you please mention at what time do we need to trigger the bot ?

Correct me if i am wrong…

Regards,
NaNi

Hi @THIRU_NANI thanks for quick response, I feel that cron expression is wrong

My requirement is Bot should run only on 3rd of the month, if there or any weekend or business holiday it should skip 3rd and run as per the above mentioned slot that is 6th july

Hi @abhiram.devabhakthin ,

Please follow the below steps:

  1. create an asset(bot_trigger) in the orchestrator by default one “1” value.
  2. Add read asset before the actual process( Init all applications) starts.
  3. add if condition for weekends. if it is the weekend, the bot skips the process(Don’t add your actual process in the Then part). if not weekend, comes to the else part and add one more if condition.
  4. give a condition(“bot_trigger < 3”). add assign activity in then part to increment bot_trigger value by one “1” and also update the new value to orchestrator asset and In else part add your actual process.
  5. once the value matches to “3” the condition will go to the else part and your actual process will get execute.
  6. once process execution ended set orchestrator value to 1.

Note - update cron expression to run the bot from day 1 and also non-working days in the orchestrator calender.