<@ULVA73B9P> how can i limit the number of flow ru...
# ask-marvin
s
@Marvin how can i limit the number of flow runs running simultaneously (they all belong to single deployment, but i don't more that 1 flow run to be active)
m
To limit the number of flow runs running simultaneously for a single deployment in Prefect 3.x, you can set a concurrency limit at the deployment level. Here's how you can do it: 1. Concurrency Limit: Use the
concurrency_limit
field in your deployment configuration to specify the maximum number of concurrent flow runs. In your case, you would set this to
1
. 2. Collision Strategy: You can also configure the
collision_strategy
for how new runs should be handled once the concurrency limit is reached. Options include: - `ENQUEUE`: New runs will wait for a slot to become available. - `CANCEL_NEW`: New runs will be canceled if the limit is reached. You can manage these settings via the Prefect CLI, API, or Prefect Cloud UI. For more detailed information, you can refer to the Prefect documentation on deployment configuration here. Let me know if you need further assistance!
s
@Marvin where can i read more about
collision_strategy?
m
It seems that the specific details about
collision_strategy
were not retrieved in the search results. However, in Prefect 3.x,
collision_strategy
is a configuration option used to determine the behavior of new flow runs when the concurrency limit is reached. Here are the typical options: - `ENQUEUE`: New runs will wait for a slot to become available. - `CANCEL_NEW`: New runs will be canceled if the limit is reached. For more detailed documentation, I recommend checking the Prefect 3.x deployment documentation directly or exploring the Prefect GitHub repository to see if there are more insights in the source code or issues related to
collision_strategy
. You can also visit the Prefect documentation for more comprehensive information.