Log icon
Schedule icon
Not icon
DayWeek icon

Executes flow on schedule trigger with Not condition

Invert schedule conditions in Kestra with the Not operator. Run a flow daily at 11am on every day except Monday using a declarative DayWeek check.

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

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

triggers:
  - id: schedule
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "0 11 * * *"
    conditions:
      - type: io.kestra.plugin.core.condition.Not
        conditions:
          - type: io.kestra.plugin.core.condition.DayWeek
            date: "{{ trigger.date }}"
            dayOfWeek: MONDAY

Schedule a flow to run daily while excluding specific days, using the Kestra Not schedule condition to invert a DayWeek check. This blueprint fires every day at 11am and skips Mondays, giving you a clean, declarative way to build "run on all days except X" calendars without writing extra cron expressions or guard logic inside your tasks.

How it works

  1. A io.kestra.plugin.core.trigger.Schedule trigger uses the cron expression 0 11 * * * to evaluate the flow at 11am every day.
  2. The trigger carries a io.kestra.plugin.core.condition.Not condition, which negates whatever conditions it wraps.
  3. Inside Not, a io.kestra.plugin.core.condition.DayWeek condition checks whether {{ trigger.date }} falls on MONDAY.
  4. Because the day check is wrapped in Not, the schedule fires on every day the inner condition is false. The flow runs Tuesday through Sunday and is skipped on Monday.
  5. When the conditions pass, the hello task (io.kestra.plugin.core.log.Log) writes a confirmation message to the execution logs.

What you get

  • A daily schedule that automatically skips a chosen weekday.
  • A reusable pattern for inverting any schedule condition, not just day of week.
  • Logs that confirm exactly when the flow ran and when it was skipped.

Who it's for

  • Data engineers who need reports or batches to run on most days but pause on a fixed day.
  • Platform teams encoding business calendars (weekends off, no-deploy days) into orchestration.
  • Anyone replacing brittle "if today is Monday, exit" checks with declarative conditions.

Why orchestrate this with Kestra

Cron alone can express "every day at 11am," but it cannot cleanly express "every day except Monday" without awkward multi-line expressions. Kestra solves this declaratively: event triggers evaluate conditions, the Not operator inverts any condition, and the entire schedule is versioned YAML you can review and diff. You also get automatic retries, full execution lineage, and visibility into both runs and skipped evaluations, capabilities a raw scheduler does not provide.

Prerequisites

  • A running Kestra instance.

Secrets

This blueprint references no secrets.

Quick start

  1. Add this flow to your Kestra instance.
  2. Confirm the schedule trigger is enabled.
  3. Watch executions: the flow runs daily at 11am and is skipped each Monday.

How to extend

  • Swap DayWeek inside Not for other conditions to exclude weekends, specific dates, or time windows.
  • Nest multiple conditions under Not to invert a combined rule.
  • Replace the Log task with your real workload (ingestion, transformation, notifications).
  • Apply the same Not condition to a io.kestra.plugin.core.trigger.Flow trigger to skip downstream runs on matching days.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.