---
title: New Relic NerdGraph actions
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/newrelic-nerdgraph
---

This page provides a comprehensive reference for new relic nerdgraph actions available in the workflow automation actions catalog. These actions enable you to execute nerdgraph queries and mutations.

## Prerequisites

Before using New Relic actions in workflow automation, ensure you have:

-   A New Relic account with appropriate permissions.
-   A New Relic license key (if sending data to a different account).
-   The necessary permissions for the specific New Relic services you plan to use.

See [License Key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys#license-key) for information on how to create and manage your New Relic Account License Key.

**Run NerdGraph request**

Executes a Graphql command against newrelic NerdGraph API. The command can either be a query or a mutation.

### Inputs

| Input         | Optionality | Type           | Description                                                                                                                                             | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------- | ----------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **graphql**   | Required    | String         | A GraphQL syntax. Use [GraphiQL](https://one.newrelic.com/nerdgraph-graphiql?state=c8579e50-f154-fec6-22b8-f9fdcfc1990a) to build and test your command |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **variables** | Required    | Map[string]any | Any key/value pair variables to use with the GraphQL statement.                                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **selectors** | Optional    | List           | The selectors to get the only specified parameters as output.                                                                                           | ```yaml steps:   - name: findingVar     type: action     action: newrelic.nerdgraph.execute     version: 1     inputs:       graphql: |         query GetEntity($entityGuid: EntityGuid!) {           actor {             entity(guid: $entityGuid) {               alertSeverity             }           }         }       variables:         entityGuid: ${{ .workflowInputs.entityGuid }}   - name: findingInline     type: action     action: newrelic.nerdgraph.execute     version: 1     inputs:       graphql: |         {           actor {             entity(guid: "${{ .workflowInputs.entityGuid }}") {               alertSeverity             }           }         }       selectors:         - name: entities           expression: '.data' ``` |

### Outputs

| Output           | Type             | Description                                              |
| ---------------- | ---------------- | -------------------------------------------------------- |
| **data**         | `Map[string]any` | Contents of the `data` property of a NerdGraph response. |
| **success**      | Boolean          | Status of the request.                                   |
| **errorMessage** | String           | Failure reason as message.                               |

### Example

| Example                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml steps:   - name: currentUserId     type: action     action: newrelic.nerdgraph.execute     version: 1     inputs:       graphql: |         query userId {           currentUser {             id           }         }    - name: logResult     type: action     action: newrelic.ingest.sendLogs     version: 1     inputs:       logs:         - message: "userId: ${{ .steps.currentUserId.outputs.data.currentUser.id }}" ``` |
