🚀 New! Kestra raises $3 million to grow Learn more

yaml
type: "io.kestra.core.models.triggers.types.Schedule"

Kestra is able to trigger flows based on a Schedule (aka the time). If you need to wait for another system to be ready and cannot use any event mechanism, you can schedule one or more time the current flow.

Example

A schedule that runs every quarter of an hour.

yaml
triggers:
  - id: schedule
    type: io.kestra.core.models.triggers.types.Schedule
    cron: "*/15 * * * *"

A schedule that runs only the first monday of every month at 11 AM.

yaml
triggers:
  - id: schedule
    type: io.kestra.core.models.triggers.types.Schedule
    cron: "0 11 * * 1"
    scheduleConditions:
      - type: io.kestra.core.models.conditions.types.DayWeekInMonthCondition
        date: "{{ trigger.date }}"
        dayOfWeek: "MONDAY"
        dayInMonth: "FIRST"

Backfill

Kestra will optionally handle schedule backfills. The concept of a backfill is the replay of a missed schedule because a flow was created after it should have been scheduled.

Backfills will perform all the schedules between the defined and current dates and will start after the normal schedule.

A schedule with a backfill.

yaml
triggers:
  - id: schedule
    type: io.kestra.core.models.triggers.types.Schedule
    cron: "*/15 * * * *"
    backfill:
      start: 2020-06-25T14:00:00Z

Variables

When the flow is scheduled, some context variables are injected to allow flow customization (such as filename, where clause in SQL query, etc.).

ParameterDescription
{{ trigger.date }}the date of the current schedule.
{{ trigger.next }}the date of the next schedule.
{{ trigger.previous }}the date of the previous schedule.

Schedule Conditions

When the cron is not sufficient to determine the date you want to schedule your flow, you can use scheduleConditions to add some additional conditions, (for example, only the first day of the month, only the weekend, ...). You must use the {{ trigger.date }} expression on the property date of the current schedule. This condition will be evaluated and {{ trigger.previous }} and {{ trigger.next }} will reflect the date with the conditions applied.

The list of core conditions that can be used are:

    Properties and Outputs

    Check the Schedule task documentation for the list of the task properties and outputs.