Alex Litvinov
03/09/2024, 5:32 AMDefining a schedule via the `schedule` key in the deployment has been deprecated. It will not be available after Sep 2023. Please use `schedules` instead by renaming the `schedule` key to `schedules` and providing a list of schedule objects.
Marvin
03/09/2024, 5:32 AMschedule
in a Prefect deployment's configuration. The warning suggests that after September 2023, the schedule
key will no longer be functional, and you are advised to use schedules
instead, with a list of schedule objects.
The Prefect documentation does not explicitly mention the deprecation warning you're seeing, but it does describe how to work with schedules in Prefect generally. When configuring schedules for your flows, you should do so using the new schedules
key and ensure that you provide a list of schedule objects.
Here is what you need to know about schedules in Prefect:
- Schedules allow Prefect to automatically create new flow runs for deployments on a specified cadence.
- You can add a schedule to any flow deployment via several recommended methods, either through the Prefect UI or programmatically.
- When building your deployment, you can use parameters like cron
, interval
, or rrule
to create schedules.
For a more detailed explanation and updated best practices, you may refer to the Prefect Schedules documentation.
To fix the warning, you'll want to locate the schedule
key in your deployment configuration and rename it to schedules
. Also, wrap the current schedule configuration in a list as it now expects a list of schedule objects:
json
{
"schedules": [
{
// your existing schedule configuration here
}
]
}
Make the necessary adjustments in your deployment configuration to comply with the upcoming changes. If you already have a deployment, you may need to update it to reflect these changes before the deprecation date.