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

Schedule Schedule

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

Schedule a flow based on a cron expression

Kestra is able to trigger a flow based on a schedule. If you need to wait for another system to be ready and can't use any event mechanism, you can add one or more schedule to a flow.

The scheduler will keep the last execution date for this schedule. This allow you to change the cron expression without restarting all past executions (if backfill exists) If you changed the current id, the scheduler will think it's a new schedule and will start with a fresh date and replay all backfill dates (if backfill exists).

Examples

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

A schedule with a nickname

yaml
triggers:
  - id: schedule
    type: io.kestra.core.models.triggers.types.Schedule
    cron: "@hourly"

A schedule that run only the first monday on every month at 11 AM

yaml
triggers:
  - id: schedule
    cron: "0 11 * * 1"
    scheduleConditions:
      - id: monday
        date: "{{ trigger.date }}"
        dayOfWeek: "MONDAY"
        dayInMonth: "FIRST"

Properties

cron

  • Type: string
  • Dynamic:
  • Required: ✔️

The cron expression

A standard unix cron expression without second. Can also be a cron extension / nickname:

  • @yearly
  • @annually
  • @monthly
  • @weekly
  • @daily
  • @midnight
  • @hourly

backfill

Backfill option in order to fill missing previous past dates

Kestra could optionally handle a backfill. The concept of a backfill is to replay missing schedules when a flow is created but we need to schedule it before its creation date.

A backfill will do all schedules between a define date and the current date, then the normal schedule will be done.

conditions

  • Type: array
  • SubType: Condition
  • Dynamic:
  • Required:

List of Conditions in order to limit the flow trigger.

inputs

  • Type: object
  • Dynamic: ✔️
  • Required:

The input to pass to the triggered flow

lateMaximumDelay

  • Type: string
  • Dynamic:
  • Required:
  • Format: duration

The maximum late delay accepted

If the schedule didn't start after this delay, the execution will be skip.

scheduleConditions

List of schedule Conditions in order to limit schedule date.

timezone

  • Type: string
  • Dynamic:
  • Required:
  • Default: Etc/UTC

The time zone id to use for evaluating the cron expression. Default value is the server default zone id.

Outputs

date

  • Type: string

The date of current schedule

next

  • Type: string

The date of next schedule

previous

  • Type: string

The date of previous schedule

Definitions

ScheduleBackfill

start

  • Type: string
  • Dynamic:
  • Required:

The first start date