Core Plugins and tasks Schedule

Core Plugins and tasks Schedule

Certified

Schedule a Flow with a CRON expression.

Runs a Flow on a cron schedule (5 fields by default; enable seconds with withSeconds). Tracks last scheduled date to support backfill. Changing the trigger id starts a new schedule from “now”. When timezone is not set, the cron expression is evaluated in the timezone configured on the Kestra server.

Multiple Schedule triggers can coexist on one Flow.

yaml
type: io.kestra.plugin.core.trigger.Schedule

Schedule a flow every 15 minutes.

yaml
id: scheduled_flow
namespace: company.team

tasks:
  - id: sleep_randomly
    type: io.kestra.plugin.scripts.shell.Commands
    taskRunner:
      type: io.kestra.plugin.core.runner.Process
    commands:
      - echo "{{ trigger.date ?? execution.startDate }}"
      - sleep $((RANDOM % 60 + 1))

triggers:
  - id: every_15_minutes
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "*/15 * * * *"

Schedule a flow every day at 6: 30 AM

yaml
    id: daily_flow
    namespace: company.team

    tasks:
      - id: log
        type: io.kestra.plugin.core.log.Log
        message: It's {{ trigger.date ?? taskrun.startDate | date("HH:mm") }}

    triggers:
      - id: schedule
        type: io.kestra.plugin.core.trigger.Schedule
        cron: 30 6 * * *

Schedule a flow every hour using the cron nickname @hourly.

yaml
id: scheduled_flow
namespace: company.team

tasks:
  - id: log_hello_world
    type: io.kestra.plugin.core.log.Log
    message: Hello World! 🚀

triggers:
  - id: hourly
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "@hourly"

Schedule a flow on the first Monday of the month at 11: 00 AM.

yaml
id: scheduled_flow
namespace: company.team

tasks:
  - id: log_hello_world
    type: io.kestra.plugin.core.log.Log
    message: Hello World! 🚀

triggers:
  - id: schedule
    cron: "0 11 * * 1"
    when: "{{ isDayWeekInMonth(trigger.date, 'MONDAY', 'FIRST') }}"

Schedule a flow on the last working day of the month at 6: 00 AM.

yaml
id: monthly_last_working_day
namespace: company.team

tasks:
  - id: log_hello_world
    type: io.kestra.plugin.core.log.Log
    message: Running on the last working day of the month!

triggers:
  - id: schedule
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "0 6 * * MON-FRI"
    when: "{{ isLastWorkingDay(trigger.date) }}"

Schedule a flow every day at 9: 00 AM and pause a schedule trigger after a failed execution using the stopAfter property.

yaml
id: business_critical_flow
namespace: company.team

tasks:
  - id: important_task
    type: io.kestra.plugin.core.log.Log
    message: "if this run fails, disable the schedule until the issue is fixed"

triggers:
  - id: stop_after_failed
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "0 9 * * *"
    stopAfter:
      - FAILED
Properties

The cron expression.

A standard unix cron expression with 5 fields (minutes precision). Using withSeconds: true you can switch to 6 fields and a seconds precision. Both 0 and 7 represent Sunday for the day-of-week field. Can also be a cron extension / nickname:

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

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

The inputs to pass to the scheduled flow

Formatduration

The maximum delay that is accepted

If the scheduled execution didn't start after this delay (e.g. due to infrastructure issues), the execution will be skipped.

Possible Values
LASTNONEALL

Action to take in the case of missed schedules

ALL will recover all missed schedules, LAST will only recovered the last missing one, NONE will not recover any missing schedule. The default is ALL unless a different value is configured using the global plugin configuration.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

DefaultEtc/UTC

The timezone used to evaluate the cron expression

Defaults to the timezone configured on the Kestra server. Set it explicitly so the schedule does not depend on the server configuration.

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

Defaultfalse

Whether the cron expression has seconds precision

By default, the cron expression has 5 fields. Setting this property to true allows for a 6th field to be used for seconds precision.

Formatdate-time

The date of the current schedule.

Formatdate-time

The date of the next schedule

Formatdate-time

The date of the previous schedule