
Core Plugins and tasks Schedule
CertifiedSchedule a Flow with a CRON expression.
Core Plugins and tasks Schedule
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.
type: io.kestra.plugin.core.trigger.ScheduleExamples
Schedule a flow every 15 minutes.
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
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.
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.
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.
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.
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:
- FAILEDProperties
cron *RequiredNon-dynamicstring
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
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
inputs object
The inputs to pass to the scheduled flow
lateMaximumDelay Non-dynamicstring
durationThe 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.
recoverMissedSchedules Non-dynamicstring
LASTNONEALLAction 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.
stopAfter Non-dynamicarray
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
timezone Non-dynamicstring
Etc/UTCThe 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.
when string
trueA 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.
withSeconds Non-dynamicboolean
falseWhether 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.
Outputs
date *Requiredstring
date-timeThe date of the current schedule.
next *Requiredstring
date-timeThe date of the next schedule
previous *Requiredstring
date-timeThe date of the previous schedule