<@ULVA73B9P> is it possible to have 2 cron schedul...
# ask-marvin
a
@Marvin is it possible to have 2 cron schedules for a prefect deployment as such:
Copy code
- name: x
  schedules:
    - cron: "*/5 4-23 * * *"
      timezone:
    - cron: "*/5 0-1 * * *"
      timezone:
m
thought for 27.0 seconds
Yes, it's absolutely possible to have multiple cron schedules for a single deployment, and your YAML structure is almost correct. Here's the proper syntax:
Copy code
yaml
- name: x
  schedules:
    - cron: "*/5 4-23 * * *"
      timezone: "UTC"  # You should specify a timezone
    - cron: "*/5 0-1 * * *"
      timezone: "UTC"  # You should specify a timezone
The only adjustment needed in your example is to specify the timezone values. It's recommended to explicitly set the timezone (e.g., "UTC", "America/New_York", etc.) to ensure your schedules run at the intended times. This configuration will run your deployment: - Every 5 minutes between 4:00 and 23:59 - Every 5 minutes between 0:00 and 1:59 This is particularly useful when you need different scheduling patterns during different times of the day, exactly as you're trying to achieve. You can verify your schedules are set correctly by checking the deployment details in the Prefect UI after creation, or by using the
prefect deployment inspect
command. For more details on schedule configuration options, you can refer to the Prefect documentation on creating schedules.
a
@Marvin how would this look in the prefect UI?
m
thought for 44.7 seconds
In the Prefect UI, your deployment with multiple schedules would be displayed in the following way: 1. In the main Deployments view, you'll see your deployment listed as "x" 2. When you click into the deployment details, you'll find a "Schedules" section that lists both of your cron schedules separately: - One entry showing:
*/5 4-23 * * *
(runs every 5 minutes from 400 2359) - Another entry showing:
*/5 0-1 * * *
(runs every 5 minutes from 0000 159) 3. For each schedule, the UI will display: - The cron expression - The timezone setting - The next scheduled run time based on that particular schedule The UI makes it easy to verify that both schedules are active and working as expected. You can also add, modify, or remove schedules directly through the UI if needed. For active schedules, you can also see the pattern of flow runs they create in the "Flow Runs" tab, where runs will be automatically created according to both scheduling patterns. Would you like me to research any specific aspect of the UI display in more detail?