---
title: Add tags to a New Relic entity
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/tagging/newrelic-tagging-addtags
---

Adds one or more tags to a New Relic entity, keeping any existing tags.

For prerequisites, see [New Relic Tagging actions](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/tagging/newrelic-tagging#prerequisites).

## Add tags

The action identifier is `newrelic.tagging.addTags`.

Adds one or more tags to a New Relic entity. Adding a value to a key that already exists appends to it rather than replacing it. Built on `newrelic.nerdgraph.execute`.

### Inputs

The following table describes all available input fields for this action.

| Input          | Type   | Description                                                                                                                               | Example                                                                                       |
| -------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| **entityGuid** | String | **Required.** The GUID of the New Relic entity to tag.                                                                                    | `"MTIzNDU2fEFQTXxBUFBMSUNBVElPTnwxMjM0NQ"`                                                    |
| **tags**       | List   | **Required.** List of `{key, values}` objects to add. Adding a value to a key that already exists appends to it rather than replacing it. | ```yaml tags:   - key: team     values: ["ui"] ```                                            |
| **selectors**  | List   | **Optional.** JQ selectors to extract specific values from the response.                                                                  | ```yaml selectors:   - name: errors     expression: ".data.taggingAddTagsToEntity.errors" ``` |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                                                                                                                            |
| ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **success**      | Boolean | `true` when the step executed without error, `false` on failure. Covers both transport failures and NerdGraph business-logic errors.                                   |
| **errorMessage** | String  | Error message on failure, whether transport-level or a NerdGraph business-logic error. `null` on success.                                                              |
| **data**         | Map     | NerdGraph response: ```json {   "data": {     "taggingAddTagsToEntity": {       "errors": null     }   } } ``` Use `selectors` to extract specific fields from `data`. |

### Example

The following example adds a `team` tag to an entity.

| Workflow example                                                                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: newrelic_tagging_addtags_workflow workflowInputs:   entityGuid:     type: String steps:   - name: tagCheckoutApp     type: action     action: newrelic.tagging.addTags     version: 1     inputs:       entityGuid: ${{ .workflowInputs.entityGuid }}       tags:         - key: team           values: ["ui"]     next: end ``` |
