New to Kestra?
Use blueprints to kickstart your first workflows.
Combine multiple Kestra schedule conditions with the Or operator. Trigger a workflow whenever any one of several configured cron conditions is satisfied.
id: schedule-condition-or
namespace: company.team
triggers:
- id: schedule
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 11 * * *"
when: "{{ (dayOfWeek(trigger.date) == 'MONDAY') or (dayOfWeek(trigger.date) ==
'THURSDAY') }}"
tasks:
- id: hello
type: io.kestra.plugin.core.log.Log
message: Demo for Or condition
Plain cron expressions cannot say "run this only on Mondays or Thursdays" in a single, readable line. This blueprint shows how to gate a standard cron trigger with a when Pebble expression on the Schedule trigger, combining two day-of-week checks with the or operator so the flow fires when either one evaluates to true. It is a clean pattern for selective scheduling, business-calendar logic, and multi-rule time windows without writing custom date math.
io.kestra.plugin.core.trigger.Schedule trigger evaluates daily at 11am using the cron expression 0 11 * * *.when property holds the expression {{ (dayOfWeek(trigger.date) == 'MONDAY') or (dayOfWeek(trigger.date) == 'THURSDAY') }}.or calls dayOfWeek(trigger.date) and compares it against MONDAY and THURSDAY respectively.or requires only one side to be true, the flow executes at 11am on Mondays and on Thursdays, and is skipped on every other day.hello task (io.kestra.plugin.core.log.Log) runs and emits a confirmation message to the logs.{{ trigger.date }} so logic stays declarative.or inside a when expression to combine multiple independent triggering rules.A raw scheduler can only express a single cron pattern; it cannot easily combine "Mondays or Thursdays or month-end" without brittle expressions or duplicate jobs. Kestra lets you attach a single declarative when expression to one trigger and combine as many checks as you need with or (or and), all in version-controlled YAML. You also gain automatic retries, full execution lineage, and event-driven extensibility that a bare cron entry cannot provide.
This flow uses no secrets.
schedule trigger is enabled.hello task.dayOfWeek(...) comparisons chained with or, or mix in a date/time range check for time windows.or operators to and to require every check to pass.Log task with real work such as a query, an API call, or a subflow.