Hi, I've what is probably a fairly basic question,...
# prefect-community
Hi, I've what is probably a fairly basic question, but I can't find the right sequence of words to get an answer in the docs. Say I have a flow that takes 23 hours to run, and I kick it off at Midnight each night. Is it possible to block today's run if yesterdays is still running?
https://docs.prefect.io/orchestration/flow-runs/concurrency-limits.html#flow-run-limits This probably achieves what you want, but sadly is a cloud only feature. Otherwise, you can add an initial task to query the prefect server api, and check if a flow from the previous day is stil running, and
if you want to block.
That works perfectly. In my initial reading I'd assumed that it was more to do with limiting the number of flows on an agent, rather than limiting the number of instances of a flow. Had forgotten that labels can be used in lots of places. Thanks for the clarification
There is a code snippet here to limit flow run concurrency by querying like that emre is suggesting if you are not on a paid tier of Cloud
💯 1
Thanks @Anna Geller
👍 1