<@ULVA73B9P> why do the deployments need to keep p...
# ask-marvin
a
@Marvin why do the deployments need to keep polling for scheduled runs? Can’t they just run when the time comes?
m
In Prefect, the scheduling mechanism is designed to be asynchronous and decoupled. This means that the scheduler creates flow runs and places them in a "Scheduled" state, but it does not directly execute them. This separation allows for greater flexibility and scalability in managing flow executions. The need for polling arises because the scheduler service is responsible for creating new runs based on the schedule, but it doesn't trigger their execution. The polling mechanism checks for scheduled runs and transitions them to a state where they can be executed, typically by agents that are continuously checking for work to do. This ensures that the system can manage concurrency, handle updates to schedules, and adapt to changes without needing to maintain a constant direct connection between scheduling and execution. For more details, you can refer to the Prefect documentation on scheduling.