• /
  • EnglishEspañolFrançais日本語한국어Português
  • Log inStart now

Replace tags on a New Relic entity

|View as Markdown

Replaces a New Relic entity's entire tag set with the tags provided.

For prerequisites, see New Relic Tagging actions.

Replace tags

The action identifier is newrelic.tagging.replaceTags.

Replaces a New Relic entity's entire tag set with the tags provided. This action is destructive: it removes any existing tag not included in the tags input. To add tags without removing existing ones, use newrelic.tagging.addTags instead. Built on newrelic.nerdgraph.execute.

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 retag.

"MTIzNDU2fEFQTXxBUFBMSUNBVElPTnwxMjM0NQ"

tags

List

Required. The complete tag set the entity should end up with. Any existing tag not included here is removed.

tags:
- key: team
values: ["cookie-dev"]

selectors

List

Optional. JQ selectors to extract specific values from the response.

selectors:
- name: errors
expression: ".data.taggingReplaceTagsOnEntity.errors"

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:

{
"data": {
"taggingReplaceTagsOnEntity": {
"errors": null
}
}
}

Use selectors to extract specific fields from data.

The following example replaces an entity's entire tag set with a single team tag.

Workflow example

name: newrelic_tagging_replacetags_workflow
workflowInputs:
entityGuid:
type: String
steps:
- name: retagCheckoutApp
type: action
action: newrelic.tagging.replaceTags
version: 1
inputs:
entityGuid: ${{ .workflowInputs.entityGuid }}
tags:
- key: team
values: ["cookie-dev"]
next: end
Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.