Schedule icon
Log icon

Executes flow on schedule trigger with Weekend condition

Restrict Kestra workflow executions to weekends with the Weekend schedule condition. Run a daily cron that only fires on Saturdays and Sundays, declaratively in YAML.

Categories
Core
id: schedule-condition-weekend
namespace: company.team

triggers:
  - id: schedule
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "0 11 * * *"
    when: "{{ isWeekend(trigger.date) }}"

tasks:
  - id: hello
    type: io.kestra.plugin.core.log.Log
    message: Demo for Weekend condition

Some jobs should only run on weekends: heavy batch reprocessing, weekly rollup reports, maintenance windows, or cleanup tasks that would compete with weekday production traffic. This blueprint shows how to schedule a flow with a daily cron and then gate it with the io.kestra.plugin.core.condition.Weekend condition so it executes only on Saturdays and Sundays. You get weekend-only scheduling without writing custom date logic, branching, or calendar checks inside your tasks.

How it works

  1. A io.kestra.plugin.core.trigger.Schedule trigger named schedule fires every day at 11:00 with the cron expression 0 11 * * *.
  2. The trigger carries a conditions list containing a single io.kestra.plugin.core.condition.Weekend condition. On each cron tick Kestra evaluates the condition against the trigger date.
  3. If the date falls on a Saturday or Sunday, the condition passes and the execution starts. On weekdays the condition fails and no execution is created.
  4. When an execution does start, the hello task (io.kestra.plugin.core.log.Log) writes a message confirming the weekend run.

What you get

  • A daily cron that effectively runs only twice a week, on the weekend.
  • No custom date arithmetic: the Weekend condition handles day-of-week logic for you.
  • A clean, declarative pattern you can drop in front of any task chain.
  • Predictable, observable runs visible in the Kestra execution UI.

Who it's for

  • Data engineers scheduling weekend-only batch jobs and backfills.
  • Platform and SRE teams running maintenance or cleanup during low-traffic windows.
  • Analysts producing weekly reports that should only generate on the weekend.

Why orchestrate this with Kestra

A plain cron daemon can express a time of day, but layering business rules like "only weekends" on top of a single readable schedule usually means scattering date checks across scripts. Kestra keeps the schedule and the rule together: the cron defines cadence, the Weekend condition defines eligibility, and both live in version-controlled declarative YAML. You also gain retries, event-driven triggers, full execution lineage, and a UI that shows exactly when and why each run fired, none of which a bare crontab provides.

Prerequisites

  • A running Kestra instance.

Secrets

This flow references no secrets.

Quick start

  1. Add this flow to a namespace in your Kestra instance.
  2. Save and enable it. The schedule trigger activates automatically.
  3. Wait for the next Saturday or Sunday at 11:00, or adjust the cron for a quicker test.
  4. Open the Executions view to confirm the run fired only on the weekend.

How to extend

  • Replace the hello Log task with your real workload (batch SQL, file processing, report generation).
  • Change the cron 0 11 * * * to a different weekend run time.
  • Combine the Weekend condition with other conditions (for example a DayWeek or time-window condition) to narrow eligibility further.
  • Invert the pattern with a weekday condition for jobs that must skip the weekend.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.