<@ULVA73B9P> How do I specify the "Day Or" argumen...
# marvin-ai
j
@Marvin How do I specify the "Day Or" argument in a deployment's schedule to be OFF when using
prefect.yaml
with a CRON schedule.
m
thought for 116.0 seconds
In Prefect 3.x, you can set the Cron schedule’s
day_or
flag in
prefect.yaml
by adding
day_or: false
to the schedule entry. That turns “Day OR” OFF (i.e., requires both day-of-month and day-of-week to match when both are specified). Example
prefect.yaml
snippet:
Copy code
deployments:
  - name: my-deployment
    entrypoint: flows/my_flow.py:my_flow
    work_pool:
      name: my-pool
    schedules:
      - slug: monthly-or-monday-9am-and
        cron: "0 9 1 * MON"   # 9:00 on the 1st of the month AND Monday
        timezone: "UTC"
        day_or: false         # Turn OFF "day OR" behavior (use AND)
        active: true
Notes: -
day_or: false
only changes behavior if both the day-of-month and day-of-week fields are constrained (not
*
). For example, with
cron: "0 9 * * MON"
,
day_or
has no effect since day-of-month is
*
. - Valid keys for a Cron schedule in
prefect.yaml
include:
cron
,
timezone
,
day_or
,
active
,
parameters
, and
slug
. Docs for reference: Prefect 3.x schedules