Skip to main content

How can we schedule a Bot on last working day of every month. If last day of month is 30 and is Sat or Sun or Holiday we want Bot to run on Friday which is a last working day of month.

@saumya.patni One possible way is to use a scheduler bot that runs daily. It can check for date-specific events stored in a database and fire off other bots based on those events. Using this method, you would only have to update the last working day of the month once a year. 

The database table could look something like this:

id (auto-increment)

eventName (varchar 255)

startDate (date)

botName (varchar 255)


@Aaron.Gleason Aaron Do you have any example of how this can be done . How to trigger events from automation anywhere database ?
Instead of database can we also use excels and connect it as database ? 

 


How can we schedule a Bot on last working day of every month. If last day of month is 30 and is Sat or Sun or Holiday we want Bot to run on Friday which is a last working day of month.

In triggers use the  cron expression 


@saumya.patni Another possibility is to use an external enterprise scheduler. They often have much more possibilities to set up a schedule.

We have a bot running on the third last working day each month. The bot is started by a file trigger. The file which starts the bot is created by a task in our enterprise scheduler.

If you use an external scheduler, you could also start the bot via API.


@Aaron.Gleason Aaron Do you have any example of how this can be done . How to trigger events from automation anywhere database ?
Instead of database can we also use excels and connect it as database ? 

 

@saumya.patni First, Excel is not a database. I’m not going on my rant today, but Google “Excel is not a database” to find out why. If you’re going to use a not-database, use Access.  😂

Anyway, what I was describing was kind of what ​@Stefanie was talking about, but home-made. Stefanie mentioned using an Enterprise Scheduling application that can fire bots off using APIs. That’s the paid, elegant solution.

The “scheduler bot” I was imagining runs once a day (at least), then queries a database based on today’s date. It then finds matching records for the date and fires off the bots based on the name/ID in the database either via API or directly from the scheduler.

You do not trigger events from a database. You trigger them from a schedule, as you only want to run on a specific day.


Hi ​@saumya.patni,

 

The last working day can be checked easily through Python ( since it can vary based on the region’s Public holiday calender). So, basically, a Bot that runs this script which to be scheduled on a daily basis and according to its output, you can call your actual bot.


Schedule bot for the last calendar day of each month (28th–31st).

 

Inside the bot: Check if today is the last working day of the month: Find the last calendar day of current month.

If last day falls on weekend/holiday, move backward to the closest working day.

 

Compare with today's date.


Reply