<@ULVA73B9P> Is it possible to Schedule a Flow so ...
# ask-marvin
m
@Marvin Is it possible to Schedule a Flow so that it runs with a delay from the previous flow? I.e. start new flow 5 minutes after the previous one finished. I want to avoid to scheduled flows running at the same time.
m
Scheduling a flow in Prefect 2.x with a delay after the previous flow completes isn't explicitly documented in the excerpts retrieved. However, typically in workflow orchestration, you may want to use a callback mechanism or state handlers to achieve the desired delay. A possible strategy includes: 1. Track when a flow run finishes through an event hook or state handler. 2. Once the flow finishes, schedule a new flow run programmatically with a 5-minute delay. This could be achieved by setting a
schedule
with a single
start_time
that is 5 minutes into the future. Keep in mind that Prefect 2.x has the concept of flow concurrency where you can limit the number of concurrent flow runs, which may also help avoid overlaps without explicitly introducing a delay. Look at the Prefect documentation or community examples for more detailed guidance on implementing delays between flows. If further assistance is needed with specific implementation in Prefect 2.x, I recommend reaching out to Prefect community forums or the official Prefect Slack workspace where actual code examples and more targeted advice might be provided.