Setting a recurrence interval for schedules
Set recurring schedules for bot runs that need to run frequently, so you don't spend time manually creating new schedules each time. Scheduled runs can occur either once, daily, weekly, monthly, or according to a cron expression that you define. On this topic, you learn details about the recurrence options available when scheduling bots.
Does not repeat
You can choose this option if you want your schedule to run once based on the time previously set on the Starts on field. Keep in mind that the schedule will still be available after it stops running. See the following example:
- After creating or editing a schedule, in the Starts on field, enter the date and time that the bot will start.
- In Recurrence, select the Does not repeat option.
- Click Next.
- In Name, enter a unique name to the schedule.
- Optional: In Description, enter a description for your schedule.
- Click Next.
- On the Summary tab, check whether all the information is correct and click Create.
Daily
You can choose this option if you want your schedule to run daily, or every other day.
For this option, the Every field sets the interval of days that the schedule will run, and the Ending field can set an specific date to end the schedule, or set the schedule to stop after an amount runs. If you don't want to set an end date, then the schedule will run until it is deactivated, deleted, or if any of its parent items, such as projects and bots, are deactivated or deleted.
As an example, to run the schedule every five days, and end it after ten occurrences, see the following procedure:
- After creating or editing a schedule, in the Starts on field, enter the date and time that the bot will run.
- In the Recurrence field, select the Daily option.
- In the Every field, select the 5 day(s) option.
- In the Ending field, select the After option, and select the 10 option.
- Click Next.
- In Name, enter a unique name to the schedule.
- Optional: In Description, enter a description for your schedule.
- Click Next.
- On the Summary tab, check whether all the information is correct and click Create.
Weekly
You can choose this option if you want your schedule to run weekly, run on an interval of weeks, or run on specific days of the week in a week interval.
For this option, the Every field sets the interval of weeks that the schedule will run. Now, you can select which weekday the schedule will run on. On the Ending field you can set an specific date, or set the schedule to stop after an amount of bot runs. You don't need to set an end date, which means that the schedule will run until it is deactivated, deleted, or if any of its parent items, such as projects and bots, are deactivated or deleted.
As an example, to run the schedule on Wednesdays every two weeks, with a specified end date, see the following procedure:
- After creating or editing a schedule, in the Starts on field, enter the date and time that the bot will run.
- In the Recurrence field, select the Weekly option.
- In the Every field, select the 2 week(s) option.
- Select the Wednesday checkbox.
- In the Ending field, select the On this day option, and select the date.
- Click Next.
- In Name, enter a unique name to the schedule.
- Optional: In Description, enter a description for your schedule.
- Click Next.
- On the Summary tab, check whether all the information is correct and click Create.
Monthly
You can choose this option if you want your schedule to run monthly, run on an interval of months, run on a specific day of each month, or run on the first weekday of the month.
For this option, the Every field sets the interval of months that the schedule will run. Here you can select which day of the month that the schedule will run on, or choose a specific weekday of the month, such as the third Wednesday of the month, for example.
On the Ending field you can set an specific date, or set the schedule to stop after an amount of bot runs. If you don't set an end date, then the schedule will run until it is deactivated, deleted, or if any of its parent items, such as projects and bots, are deactivated or deleted.
As an example, to run the schedule on every second Friday of every month, and end it on a specific date, see the following procedure:
- After creating or editing a schedule, in the Starts on field, enter the date and time that the bot will run.
- In the Recurrence field, select the Monthly option.
- In the Every field, select the 1 month(s) option.
- In the On field, select the following options: Second and Friday.
- In the Ending field, select the On this day option, and select the date.
- Click Next.
- In Name, enter a unique name to the schedule.
- Optional: In Description, enter a description for your schedule.
- Click Next.
- On the Summary tab, check whether all the information is correct and click Create.
Custom recurrence
If none of the preset options fit your needs, you can use a cron expression to define custom recurrence options for your bot runs. A cron expression is a string comprised of 6 or 7 fields separated by white space that follows the cron expression syntax. Fields can contain any of the allowed values, along with various combinations of the allowed special characters for that field.
Cron syntax
The cron expression syntax is Minute Hour DayOfMonth Month DayOfWeek [Year]
, where Year
is entirely optional. Use the following table to build your cron expression in order to work.
Field name | Required | Accepted values | Accepted special characters |
---|---|---|---|
Minute | Required | 0-59 | , - * / |
Hour | Required | 0-23 | , - * / |
Day of month | Required | 1-31 | , - * ? / L W |
Month | Required | 1-12 or JAN-DEC | , - * / |
Day of week | Required | 1-7 or SUN-SAT | , - * ? / L # |
Year | Optional | empty, 1970-2099 | , - * / |
Special characters
Characters | Description | Examples |
---|---|---|
* |
Used to select all values in a field. | * in the Minute field corresponds with every minute.For example, the following cron expression would make the schedule run every minute: * * * * * . |
? |
Used to specify something in one of the two fields in which the character is allowed, but not the other, mainly used for days of the week. | If you want your schedule to run on a particular day of the month, but you don't care what day of the week that happens to be, you can put the specific day in the Day of the month field and use ? in the
Day of week field. For example, for the schedule to run every hour on day 10 of the current month, the expression would be the following: 0 * 10 * * |
- |
Used to specify ranges. | 10-12 in the Hour field means the hours 10, 11 and 12. |
, |
Used to specify additional values. | WED,THU,FRI in the Day of week field means "the days Wednesday, Thursday, and Friday". You can also refer to the days as numbers, starting with Sunday being number 1. |
/ |
Used to specify increments. | 1/3 in the Day of month field means to schedule every 3 days starting on the first day of the month. |
L |
The character is short-hand for "Last", but it has different meanings on each of the two fields: Day of month and Day of week. When using the L option, it is important not to specify
lists, or ranges of values, because you may get unexpected results,In the Day of month field it means "the last day of the month". You can also specify an offset from the last day of the month, such as “L-3” which would mean the third to last day of the calendar month. In the Day of week field it means L , 7 , or SAT , which is the last day of the week in the cron expression.
But if used in the Day of week field after another value, it means “the last nth day of the month”. |
The following cron expression schedules a bot to run every hour, on the last day of the month: 0 * L * * . If you want to use an offset, for example, to make the schedule run 5 days before the last day of the month, you can
use L-5 intead of L in the Day of month field.For the Day of week field, the following cron expression schedules a bot to run every minute, on the last Friday of the month: * * * * L5 |
W |
Used to specify the nearest weekday (Monday to Friday) to the given day. | If the 15th is a Saturday, 15W in the value for the Day of month field means that the bot will run on Friday the 14th. |
# |
Used to specify the nth weekday of the month. | 6#3 in the Day of the week field means “the third Friday of the month” (day 5 = Friday and “#3” = the 3rd one in the month). |
Example Cron Expressions
Here are a few more examples of cron expressions:
Expression | Description |
---|---|
0,5 * ? * * |
Run every 5 minutes. |
0 0/2 * * ? |
Run every hour. |
00 02 * * ? 2024 |
Run at 2:00 AM every day during the year 2024. |
0 0 ? * 2#2 |
Run once a month on the 2nd Monday of January. |
0 0 5 10 ? |
Run once a year at midnight of October 5th. |
15 10 ? * 6L |
Run at 10:15 AM on the last Friday of every month. |