New to Kestra?
Use blueprints to kickstart your first workflows.
Run Kestra flows on specific days of the week using the DayWeek condition. Automate weekday or weekend-restricted workflows with precise scheduling control.
id: schedule-condition-dayweek
namespace: company.team
tasks:
- id: hello
type: io.kestra.plugin.core.log.Log
message: Demo for DayWeek condition
triggers:
- id: schedule
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 11 * * *"
conditions:
- type: io.kestra.plugin.core.condition.DayWeek
date: "{{ trigger.date }}"
dayOfWeek: "MONDAY"
Run a Kestra flow on a recurring cron schedule, then gate each execution so it only proceeds on a specific weekday. This blueprint pairs the io.kestra.plugin.core.trigger.Schedule trigger with the io.kestra.plugin.core.condition.DayWeek condition to fire at 11am every day, while only allowing the run to continue when the trigger date is a Monday. It solves the common scheduling problem where a single cron expression cannot express calendar-aware rules like "run only on Mondays" without brittle workarounds, giving you precise, declarative control over which days a workflow actually executes.
schedule trigger of type io.kestra.plugin.core.trigger.Schedule evaluates the cron expression 0 11 * * *, which marks every day at 11am as a candidate execution time.conditions. The io.kestra.plugin.core.condition.DayWeek condition compares {{ trigger.date }} against dayOfWeek: MONDAY.hello task of type io.kestra.plugin.core.log.Log writes a demo message confirming the DayWeek condition matched.A raw cron scheduler can express "every day at 11am" but cannot cleanly say "only when that day is a Monday" without encoding it into the cron string itself, which quickly becomes unreadable for multi-weekday or exclusion rules. Kestra separates the schedule from the condition, so the cadence and the calendar rule each stay legible. On top of that you get event-driven triggers, automatic retries, full execution lineage, and a declarative YAML definition that lives in version control. The DayWeek condition fills the gap a tool's own scheduler leaves open: readable, composable day-of-week logic layered on a standard cron schedule.
This blueprint references no secrets.
schedule trigger evaluates daily at 11am.hello task logs its message.dayOfWeek to any weekday, for example FRIDAY, to shift the allowed day.DayWeek conditions or combine with other conditions to allow a set of weekdays.hello Log task with real work such as a data load, API call, or notification.