Hi prefect community! Is there any way to lock the...
# ask-community
d
Hi prefect community! Is there any way to lock the flow when its running? My use case is, when specific flow is in running state ,that same flow should not run again parallely. When someone trigger the flow again, it should start running only when first run completes. Is there any simple way to achieve this?
n
Hi @Dhiraj Golhar - check out flow concurrency! You can set a specific label on a flow and set its concurrency to 1 to prevent it from being run at the same time. You can find the flow concurrency page by visiting the “Team” tab at the top nav bar :)
Note: this is a Cloud- only feature.
d
Thanks @nicholas , i will check this.
👍 1
a
Hi @nicholas, as a follow-up to this question about limiting concurrency on a specific flow: • Do we need a label for each of these types of flows where we wish to prevent an overlapping run on the flow but not restrict overall concurrency across flows? • Would each of these labels need to be added to the agent?
n
Hi @Alex Papanicolaou - yes; if you want to restrict concurrency on just 1 flow but not others, you'll need to have labels for just that flow. To submit work, an agent must have all labels that a flow has.