Roger Sousa
09/24/2025, 8:56 PMMarvin
09/24/2025, 8:56 PMMarvin
09/24/2025, 9:03 PMprivate
and philanthropic
schedules you passed deployment_ids
instead of list_schools
. Your flow signature is my_flow(list_schools, max_run_time, url_base)
, so those runs would not receive list_schools
unless you fix that key.
- In Prefect 3.x, schedule parameters are stored on the schedule and copied onto each created flow run. They’re not dynamically read from your code at trigger time.
What to do now
1) Fix the parameter key and re-serve
schedules = [
Cron(
"0 9,17 * * *",
slug="private",
timezone="America/Sao_Paulo",
parameters={
"list_schools": private_schools, # <-- fix
"max_run_time": 480,
"url_base": URL_BASE,
},
),
Cron(
"0 9,12,15,18,21,23 * * *",
slug="philanthropic",
timezone="America/Sao_Paulo",
parameters={
"list_schools": philanthropic_schools, # <-- fix
"max_run_time": 180,
"url_base": URL_BASE,
},
),
]
my_flow.serve(name="Flow escolas", schedules=schedules, version="1.0.1", tags=["escolas"], pause_on_shutdown=False)
2) Clear or cancel any pre-created runs that still hold the old parameters
- In the UI: go to your deployment → Scheduled tab → cancel/delete the old future runs.
- Via CLI:
- List scheduled runs:
prefect flow-run ls --flow-name "my_flow" --state SCHEDULED --limit 200
- Cancel or delete each affected run:
prefect flow-run cancel <RUN_ID>
or
prefect flow-run delete <RUN_ID>
- You can inspect a run to confirm its parameters:
prefect flow-run inspect <RUN_ID>
3) Optionally, reset the schedules to avoid confusion
- List schedules on the deployment and grab the schedule IDs:
prefect deployment schedule ls "Flow escolas"
- Pause or delete the old schedule (e.g., the “private” one), then re-serve (or create a new schedule with a new slug like private-v2
):
prefect deployment schedule pause "Flow escolas" <SCHEDULE_ID>
or
prefect deployment schedule delete "Flow escolas" <SCHEDULE_ID>
Tips to avoid this next time
- After changing schedule parameters, either change the schedule slug (to force a fresh schedule) or cancel/delete any pre-created “Scheduled” runs so only new runs (with updated parameters) remain.
- Keep enforce_parameter_schema=True
(the default for serve
) so typos like deployment_ids
vs list_schools
are caught early.
Docs for reference:
- Schedules (Prefect 3)
- Python schedule API