Schedules allow you to automatically run tasks on a recurring cadence.
To create a schedule, you must have permissions to execute the task. You can manage schedules from the individual task page:
Schedules have a name and a human-friendly description. If the task has any parameters, you can specify parameter values when creating or editing a schedule.
The recurrence schedule is defined using cron syntax, with times specified in UTC. In addition to standard cron characters, Airplane supports the following:
|L||Day of Week||5L ("last Friday of the month")|
|#||Day of Week||5#3 ("third Friday of the month")|
|W||Day of Month||1W ("nearest weekday to the 1st of the month")|
Sample cron expressions
|0 12 * * *||Daily at 12:00 UTC|
|0 17 * * 5||Every Friday at 17:00 UTC|
|0 12 * * 3#1||First Wednesday of the month at 12:00 UTC|
|*/30 12-17 * * MON-FRI||Every half hour between 12:00 UTC and 16:59 UTC on weekdays|
|0 12 15 */2 *||Every 15th of the month at 12:00 UTC, every two months (starting in January)|
Managing schedules in task definition files
Schedules can additionally be managed in the task definition file if you are deploying your task via code. Schedules managed through the task definition should not be managed via the web UI, since any changes will be overwritten on deploy. Airplane can help you migrate schedules created in the web UI to schedules in your task definition. Reach out to email@example.com and we'll help you get set up.
Schedules can be archived to temporarily or permanently prevent them from running. They may be unarchived at any time, as long as the task is also unarchived.
If a task is archived, all of its active schedules are also archived. Unarchiving a task does not automatically unarchive all of its associated schedules.
Schedules run as their creator, meaning if you schedule a task and it runs the next day, Airplane will execute the task as you (the creator). If the creator no longer has access (e.g. due to the creator leaving the Airplane team), the schedule will automatically be paused.
It is possible for schedules to become invalid; e.g., adding or changing parameters to the task, or the schedule creator losing permissions to execute it. In these cases, the schedule will be moved into a paused state, and an alert will show up next to the schedule indicating why the schedule has been automatically paused.
You can unpause a schedule by editing it in the app and re-saving it.
Schedules are designed to start a task based on a custom recurrence schedule. However, if the last execution has not yet finished, a new execution will only be started after the last execution has finished. For a given schedule, at most one execution will be in an active state at any time.
For example, a schedule that executes every five minutes will normally execute a run at 10:00, 10:05, 10:10, etc. If a run that starts at 10:15 takes 12 minutes, the next run will start at 10:27 at the earliest; the next run after that will start at either 10:30 or when the 10:27 run has finished, whichever is later.