If you want to limit the number of flow runs executing simultaneously, you can leverage concurrency limits.
Global task run concurrency limits
Global task run concurrency limits are based on tags that you can set within your flow.
You can set concurrency limits on as few or as many tags as you wish. The easiest way to create, list, and remove concurrency limits is by using Prefect CLI concurrency-limit commands.
prefect concurrency-limit [command] [arguments]
Command
Description
create
Create a concurrency limit by specifying a tag and limit.
delete
Delete the concurrency limit set on the specified tag.
ls
View all defined concurrency limits.
read
View details about a concurrency limit. active_slots shows a list of IDs for task runs that are currently using a concurrency slot.
For example, to set a concurrency limit of 10 on the ‘small_instance’ tag:
Prefect Cloud allows setting flow run limits based on flow run labels. You can assign a concurrency limit to a specific label — more on that, in the documentation.