<@ULVA73B9P> I want a prefect flow to run every 5 ...
# ask-marvin
t
@Marvin I want a prefect flow to run every 5 minutes between the hours of 9am and 5pm, can I set that type of schedule using an interval schedule in my prefect.yaml file?
m
It looks like using an interval schedule directly in the
prefect.yaml
file for such specific timing (e.g., every 5 minutes between 9 AM and 5 PM) is not very straightforward with the
interval
keyword alone. However, you can accomplish this using a
cron
schedule. Here’s an example of how you can define this schedule in your
prefect.yaml
file:
Copy code
yaml
deployments:
  - name: your_deployment
    schedule:
      cron: "*/5 9-16 * * *"
    timezone: "Your/Timezone"  # Replace with your timezone, e.g., America/New_York
A quick breakdown: -
*/5
means every 5 minutes. -
9-16
restricts this to the hours from 9 AM to 4:59 PM. Here's a link to more information on Prefect schedules: Prefect Schedules Documentation If you have further questions, feel free to ask!
t
@Marvin Thanks
m
You're welcome! If you have any more questions or need further assistance, feel free to ask. Happy scheduling!