Chris Sankat
10/02/2024, 5:57 PMMarvin
10/02/2024, 5:57 PMserve
for flow-based deployments or deploy
for work pool-based deployments. You can also set up schedules via the interactive prefect deploy
command or by specifying schedules in a prefect.yaml
file. Check out the Prefect 3.x documentation on adding schedules.
To define different times for your flow to run, you can use cron schedules, interval schedules, or more complex rule-based schedules. Here’s an example on how you might define schedules:
#### Using the CLI
shell
prefect deployment schedule create my-flow --cron "0 9 * * *" --name "Morning Run"
prefect deployment schedule create my-flow --cron "0 17 * * *" --name "Evening Run"
#### Using a YAML configuration
yaml
deployments:
- name: my-flow-deployment
schedules:
- cron: "0 9 * * *"
timezone: America/New_York
- cron: "0 17 * * *"
timezone: America/New_York
For detailed setup, visit the Prefect scheduling documentation specific to your version linked above.
If you need further assistance, feel free to ask!