Skip to main content
Use task tags to limit how many tasks can run at the same time. This is useful when tasks interact with shared resources like databases or external APIs.
For more details on how tag-based concurrency limits work, see the tag-based concurrency limits concept page.
As of Prefect 3.4.19, tag-based concurrency limits are backed by global concurrency limits. When you create a tag-based limit, you’ll see a corresponding global concurrency limit with the name tag:{tag_name}.

Set concurrency limits on tags

Tags without concurrency limits allow unlimited concurrent runs. Once you set a limit, only that many tasks with the tag can run simultaneously.

Apply multiple tags to a task

When a task has multiple tags, it must have available concurrency slots for all tags to run.

Configure concurrency limits

You can configure limits using the CLI, Python client, API, Terraform, or the Prefect UI.

CLI

Python client

API

Terraform

Configure globally

When a task is delayed due to a concurrency limit, it will wait for a set wait time before retrying. You can set the wait time for when tasks are delayed due to concurrency limits:
Note: this setting needs to be set on the Prefect server, not the Prefect client.