Skip to main content

Multiple Self-Hosted Agents

This is done via TAGS.

An agent will only run tasks from connections whose tags field matches the TAGS environment variable of the agent.

If an agent is deployed with an environment variable like TAGS=prod, then all targets whose field tags match the value prod are executed by that agent. Multiple targets can have the same tags.

However, an agent MUST have unique TAGS across the organization. This means that only one agent can be deployed with TAGS=prod.

If a second agent tries to start with the same tags, the API will return an error and the agent will exit.

If you already have an agent deployed with TAGS=prod, then another agent can be deployed with a different TAGS, for instance, TAGS=dev. Then, only targets whose tags field matches the value dev will be executed by that agent.

  • TAGS can be any value that makes sense to the organization.
  • One agent can be deployed without TAGS, and it will run only tasks from targets whose tags field is null.