from prefect import Flow
from prefect.schedules import IntervalSchedule
schedule = IntervalSchedule(interval=timedelta(minutes=15))
with Flow("scheduled_flow", schedule=schedule) as flow:
Additionally, you can test the schedule by printing the next schedules as follows:
from prefect.schedules import IntervalSchedule
schedule = IntervalSchedule(interval=timedelta(minutes=15))
for sched in schedule.next(10):
print(sched)
Hello! Apologies if I’m missing something - I havent found an answer in any other threads. I am using Prefect 1.0 and I set an IntervalSchedule for my flow similar to the above example.
However, when I register the flow on our internal Prefect Server , the schedule only seems to generate the next 10 events.
I expected that setting IntervalSchedule(interval=timedelta(hours=1)) would make the server continue to schedule hourly events indefinitely. Is there some syntax that I am missing?
I appreciate any help.
It turned out to actually be an issue with our service configuration.
Specifically, we found an API error in the towel service logs when it tried to communicate with the HasuraClient. Towel did not have the right port configured for hasura. Once that environment variable was set and fixed, we restarted the service.
I can now see a consistent 10 upcoming runs → each time one executes, another is added by the server.