Dan Morris
12/09/2025, 12:39 PMMarvin
12/09/2025, 12:39 PMMarvin
12/09/2025, 12:42 PMprefect deployment schedule create does not have a flag to set parameter overrides for a schedule. It only accepts schedule timing options (cron/rrule/interval, timezone, etc.).
What you can do instead:
- Define schedules with parameters in prefect.yaml and deploy (recommended for CLI-driven workflows)
- Define schedules with parameters in Python (flow.serve/flow.deploy)
- Use the UI to add a schedule and specify parameters
- Use the REST API to update a schedule to include parameters
Examples
1) prefect.yaml (works with prefect deploy)
yaml
deployments:
- name: my-flow-deployment
entrypoint: flows/my_flow.py:my_flow
work_pool:
name: my-aks
schedules:
- cron: "0 8 * * *"
slug: jim-email
parameters:
to: "<mailto:jim@example.com|jim@example.com>"
- cron: "5 8 * * *"
slug: dwight-email
parameters:
to: "<mailto:dwight@example.com|dwight@example.com>"
message: "Custom message"
2) Python SDK
python
from prefect import flow
from prefect.schedules import Cron
@flow
def my_flow(to: str, message: str = "Hello"):
...
my_flow.deploy(
name="my-flow-deployment",
work_pool_name="my-aks",
schedules=[
Cron("0 8 * * *", slug="jim-email", parameters={"to": "<mailto:jim@example.com|jim@example.com>"}),
Cron("5 8 * * *", slug="dwight-email", parameters={"to": "<mailto:dwight@example.com|dwight@example.com>", "message": "Custom message"}),
],
)
3) REST API (patch an existing schedule with parameters)
PATCH /deployments/{deployment_id}/schedules/{schedule_id}
{
"parameters": {
"to": "<mailto:email@example.com|email@example.com>",
"message": "Custom message"
}
}
References
- CLI (schedule create): CLI: prefect deployment schedule create
- How-to: associate parameters with schedules (YAML and Python): Create schedules with parameters
- REST API (update deployment schedule): Update deployment schedule API
If you’d like, share your current prefect.yaml and I can help add parameterized schedules that will deploy to your AKS work pool my-aks.