New to Kestra?
Use blueprints to kickstart your first workflows.
Run Kestra workflows only on the first Monday of each month at 11 AM. Combine a cron Schedule trigger with a `when` expression using `isDayWeekInMonth` for precise monthly timing.
id: every-monday
namespace: company.team
triggers:
- id: first_monday_of_the_month
type: io.kestra.plugin.core.trigger.Schedule
timezone: Europe/Berlin
cron: 0 11 * * MON
when: "{{ isDayWeekInMonth(trigger.date, 'MONDAY', 'FIRST') }}"
tasks:
- id: log_trigger_or_execution_date
type: io.kestra.plugin.core.log.Log
message: "{{ trigger.date ?? execution.startDate }}"
Plain cron expressions cannot express calendar rules like "the first Monday of the month." This flow solves that gap by pairing a standard io.kestra.plugin.core.trigger.Schedule trigger with a when: "{{ isDayWeekInMonth(trigger.date, 'MONDAY', 'FIRST') }}" Pebble expression, so the workflow fires only on the first Monday of every month at 11 AM Europe/Berlin time. It is a reusable scheduling pattern for monthly reports, billing runs, kickoff jobs, and any task that must land on a specific weekday-of-month rather than a fixed calendar date.
first_monday_of_the_month trigger is a io.kestra.plugin.core.trigger.Schedule with cron: 0 11 * * MON, which evaluates every Monday at 11 AM in the Europe/Berlin timezone.when: "{{ isDayWeekInMonth(trigger.date, 'MONDAY', 'FIRST') }}" expression narrows that down further, checking trigger.date against the weekday and week-in-month, so only the first Monday actually starts an execution.log_trigger_or_execution_date task (io.kestra.plugin.core.log.Log) prints {{ trigger.date ?? execution.startDate }}, confirming the scheduled date when run by the trigger and falling back to the execution start date on manual runs.Europe/Berlin setting on the trigger.Most schedulers and cron tools only accept date or weekday patterns, not "nth weekday of the month" rules. Kestra layers declarative trigger conditions on top of cron, so calendar logic lives in readable YAML instead of brittle expressions. You also get retries, full execution history, and lineage out of the box, and the same flow can later orchestrate downstream tasks once the timing fires correctly.
timezone on the trigger if you are not in Europe/Berlin.'FIRST' argument in the when expression to 'SECOND', 'THIRD', 'FOURTH', or 'LAST' to retime the run.'MONDAY' argument to target a different weekday.Log task with real work: a report build, an export, or a downstream Subflow call.