To define a tag and use it to set task concurrency limits, you can follow these steps:
1.
Define a tag: Tags can be any arbitrary string. They are used as a mechanism for grouping related work together. You can set a tag for your tasks in Prefect.
2.
Set task concurrency limits: Task concurrency limits use task tags. You can specify an optional concurrency limit as the maximum number of concurrent task runs in a Running state for tasks with a given tag. The specified concurrency limit applies to any task to which the tag is applied. If a task has multiple tags, it will run only if all tags have available concurrency. Tags without explicit limits are considered to have unlimited concurrency.
Please note that if the concurrency limit is set to 0 for a tag, any attempt to run a task with that tag will be aborted instead of delayed. Task tag limits are checked whenever a task run attempts to enter a Running state.
For more detailed information, you can refer to the Prefect documentation on
deployments and
tasks.