New to Kestra?
Use blueprints to kickstart your first workflows.
Schedule a Kestra flow to run on the last Saturday of every month with the DayWeekInMonth condition on a Schedule trigger, for calendar rules cron cannot express.
id: schedule-condition-dayweekinmonth
namespace: company.team
tasks:
- id: hello
type: io.kestra.plugin.core.log.Log
message: Demo for DayWeekInMonth condition
triggers:
- id: schedule
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 11 * * *"
conditions:
- type: io.kestra.plugin.core.condition.DayWeekInMonth
date: "{{ trigger.date }}"
dayOfWeek: SATURDAY
dayInMonth: LAST
Plain cron expressions cannot express calendar rules like "the last Saturday of every month" or "the second Tuesday." This blueprint shows how Kestra solves that with a daily io.kestra.plugin.core.trigger.Schedule trigger combined with the io.kestra.plugin.core.condition.DayWeekInMonth condition, so the flow evaluates every day at 11am but only actually runs when the trigger date lands on the last Saturday of the month. It is the canonical pattern for monthly, position-based scheduling (week-of-month plus day-of-week) that raw cron syntax simply does not support.
schedule trigger uses cron 0 11 * * *, which fires the evaluation every day at 11am.conditions entry of type io.kestra.plugin.core.condition.DayWeekInMonth inspects {{ trigger.date }}.dayOfWeek: SATURDAY and dayInMonth: LAST, so it returns true only on the last Saturday of the month.hello task (io.kestra.plugin.core.log.Log) runs and logs a demo message. On every other day the condition is false and no execution is created.A standard scheduler can fire on a day of the month, but it cannot natively express "the last Saturday" or "the first Monday." Kestra closes that gap with declarative YAML conditions on top of the Schedule trigger, and adds retries, backfills, full execution lineage, and event-driven triggers around the same flow. You get position-based calendar logic plus production-grade orchestration in one place.
This flow uses no secrets. The hello task only logs a message, so no credentials are required.
dayOfWeek (for example MONDAY) and dayInMonth (FIRST, SECOND, THIRD, FOURTH, LAST) for other calendar rules.hello Log task with your real workload: a database job, an export, or a downstream subflow.conditions to further narrow when the flow runs.