pseco
12/30/2025, 12:58 PMMarvin
12/30/2025, 12:58 PMMarvin
12/30/2025, 1:02 PMtimezone.
Option 1 — Add the schedule in code when creating the deployment
from prefect import flow
from prefect.schedules import Cron
@flow
def my_flow():
...
if __name__ == "__main__":
my_flow.deploy(
name="daily-20h",
work_pool_name="my-work-pool",
schedule=Cron("0 20 * * *", timezone="UTC") # change to your TZ, e.g. "America/New_York"
)
Option 2 — Add a schedule via CLI to an existing deployment
prefect deployment schedule create my-flow/daily-20h --cron "0 20 * * *" --timezone "UTC"
Option 3 — Configuration-as-code in prefect.yaml
deployments:
- name: daily-20h
entrypoint: flows.py:my_flow
work_pool:
name: my-work-pool
schedules:
- cron: "0 20 * * *"
timezone: "UTC" # or your local timezone
active: true
Helpful docs:
- Create deployment schedules
- Schedule concepts
Quick check: should that 20:00 be in UTC or a specific timezone (e.g., America/New_York)? If you share your timezone, I can tailor the exact snippet.pseco
12/30/2025, 1:11 PMMarvin
12/30/2025, 1:11 PMMarvin
12/30/2025, 1:12 PMfrom prefect.schedules import Cron
schedule = Cron("0 20 * * *", timezone="Europe/Madrid")
Or via CLI:
prefect deployment schedule create my-flow/my-deployment --cron "0 20 * * *" --timezone "Europe/Madrid"
- If you must use UTC only, note:
- Winter (CET): 20:00 Madrid = 19:00 UTC
- Summer (CEST): 20:00 Madrid = 18:00 UTC
A fixed UTC cron won’t match 20:00 Madrid across DST changes.
Docs: Create deployment schedulespseco
12/30/2025, 2:21 PMMarvin
12/30/2025, 2:22 PMMarvin
12/30/2025, 2:22 PMcron parameter on deploy(), but it will schedule in UTC. If you want 20:00 local Madrid time year‑round, use a schedule with a timezone (or the CLI with --timezone).
- Using cron (UTC) — NOT 20:00 Madrid:
my_flow.deploy(
name="daily-20h",
work_pool_name="my-work-pool",
cron="0 20 * * *" # runs at 20:00 UTC (21:00/22:00 in Madrid depending on DST)
)
- Correct (20:00 Europe/Madrid):
from prefect.schedules import Cron
my_flow.deploy(
name="daily-20h-madrid",
work_pool_name="my-work-pool",
schedule=Cron("0 20 * * *", timezone="Europe/Madrid"),
)
- Or via CLI:
prefect deployment schedule create my-flow/daily-20h-madrid --cron "0 20 * * *" --timezone "Europe/Madrid"
Docs: Create deployment schedules | Schedule concepts
If you share your deployment name, I can give you a ready-to-run command.