> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modulex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# New Relic Integration for AI Agents & Workflows

> Integrate New Relic into workflows. Run NRQL queries, search monitored entities, fetch entity details, and record deployment change events via the NerdGraph GraphQL API.

{/* Self-hosted logo — build-time vendored from modulex.json / Iconify (see scripts/lib/logo.js). */}

<img src="https://mintcdn.com/modulexaillc/df8MOr-hXotYLTh5/logos/placeholder.svg?fit=max&auto=format&n=df8MOr-hXotYLTh5&q=85&s=a4046f9cd6d738c81259050e9833913c" alt="New Relic logo" width="72" height="72" data-path="logos/placeholder.svg" />

## Overview

Add **New Relic** to any ModuleX agent or workflow. Query observability data and record deployments in New Relic. Run NRQL queries, search monitored entities, fetch entity details, and create deployment change events through New Relic's NerdGraph GraphQL API (`api.newrelic.com/graphql`, or `api.eu.newrelic.com/graphql` for the EU region).

<Info>
  **Categories**: Monitoring & Observability · Monitoring · Observability · **Auth**: API Key · **Actions**: 4
</Info>

## Authentication

### API Key Authentication

Authenticate using your New Relic user API key

<Steps>
  <Step title="Step 1">
    Sign in to New Relic at [https://one.newrelic.com](https://one.newrelic.com)
  </Step>

  <Step title="Step 2">
    Open the user menu and go to 'API keys'
  </Step>

  <Step title="Step 3">
    Create a new 'User' key (its value starts with 'NRAK-')
  </Step>

  <Step title="Step 4">
    Paste the API key below
  </Step>
</Steps>

#### Required Credentials

| Field                  | Description                                       | Required | Format                 |
| ---------------------- | ------------------------------------------------- | -------- | ---------------------- |
| New Relic User API Key | Your New Relic user API key (starts with 'NRAK-') | Yes      | `NRAK-<your-user-key>` |

## Available Actions

<AccordionGroup>
  <Accordion title="nrql_query — Run a NRQL query against a New Relic account using NerdGraph.">
    ### Parameters

    <ResponseField name="account_id" type="integer" required>
      New Relic account ID to query
    </ResponseField>

    <ResponseField name="nrql" type="string" required>
      NRQL query to execute
    </ResponseField>

    <ResponseField name="region" type="string">
      New Relic data center region: 'us' (default) or 'eu' (Default: `us`)
    </ResponseField>

    <ResponseField name="timeout" type="integer">
      Optional query timeout in seconds
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "results": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": "Results",
          "type": "array"
        },
        "result_count": {
          "default": 0,
          "title": "Result Count",
          "type": "integer"
        }
      },
      "required": [
        "success"
      ],
      "title": "NrqlQueryOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="search_entities — Search New Relic entities by name, GUID, domain type, tags, or reporting state.">
    ### Parameters

    <ResponseField name="query" type="string" required>
      Entity search query, e.g. name like "api" or domainType = "APM-APPLICATION"
    </ResponseField>

    <ResponseField name="region" type="string">
      New Relic data center region: 'us' (default) or 'eu' (Default: `us`)
    </ResponseField>

    <ResponseField name="cursor" type="string">
      Pagination cursor from a previous entity search
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "Entity": {
          "additionalProperties": false,
          "description": "A single monitored New Relic entity (guid, name, entityType).",
          "properties": {
            "guid": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Guid"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "entity_type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Entity Type"
            }
          },
          "title": "Entity",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "count": {
          "default": 0,
          "title": "Count",
          "type": "integer"
        },
        "query": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Query"
        },
        "entities": {
          "items": {
            "$ref": "#/$defs/Entity"
          },
          "title": "Entities",
          "type": "array"
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Next Cursor"
        }
      },
      "required": [
        "success"
      ],
      "title": "SearchEntitiesOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_entity — Fetch a New Relic entity by GUID.">
    ### Parameters

    <ResponseField name="guid" type="string" required>
      Entity GUID
    </ResponseField>

    <ResponseField name="region" type="string">
      New Relic data center region: 'us' (default) or 'eu' (Default: `us`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "Entity": {
          "additionalProperties": false,
          "description": "A single monitored New Relic entity (guid, name, entityType).",
          "properties": {
            "guid": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Guid"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "entity_type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Entity Type"
            }
          },
          "title": "Entity",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "entity": {
          "anyOf": [
            {
              "$ref": "#/$defs/Entity"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "success"
      ],
      "title": "GetEntityOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="create_deployment_event — Record a deployment change event in New Relic change tracking.">
    ### Parameters

    <ResponseField name="entity_guid" type="string" required>
      GUID of the entity associated with the deployment
    </ResponseField>

    <ResponseField name="version" type="string" required>
      Deployment version, release name, or commit SHA
    </ResponseField>

    <ResponseField name="region" type="string">
      New Relic data center region: 'us' (default) or 'eu' (Default: `us`)
    </ResponseField>

    <ResponseField name="short_description" type="string">
      Short description of the deployment
    </ResponseField>

    <ResponseField name="description" type="string">
      Longer deployment description
    </ResponseField>

    <ResponseField name="changelog" type="string">
      Deployment changelog text or URL
    </ResponseField>

    <ResponseField name="commit" type="string">
      Commit SHA or identifier associated with the deployment
    </ResponseField>

    <ResponseField name="deep_link" type="string">
      URL to the deployment, build, or release details
    </ResponseField>

    <ResponseField name="user" type="string">
      User or automation that performed the deployment
    </ResponseField>

    <ResponseField name="group_id" type="string">
      Optional group ID to correlate related changes
    </ResponseField>

    <ResponseField name="custom_attributes" type="object">
      Custom change event metadata as key-value pairs with string, number, or boolean values
    </ResponseField>

    <ResponseField name="deployment_type" type="string">
      Deployment type: 'basic', 'blue green', 'canary', 'rolling', or 'shadow' (Default: `basic`)
    </ResponseField>

    <ResponseField name="timestamp" type="integer">
      Event timestamp in milliseconds since Unix epoch
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "ChangeTrackingEntity": {
          "additionalProperties": false,
          "description": "The entity a change tracking event is associated with.",
          "properties": {
            "guid": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Guid"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            }
          },
          "title": "ChangeTrackingEntity",
          "type": "object"
        },
        "ChangeTrackingEvent": {
          "additionalProperties": false,
          "description": "A created New Relic change tracking (deployment) event.",
          "properties": {
            "category": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Category"
            },
            "category_and_type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Category And Type"
            },
            "change_tracking_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Change Tracking Id"
            },
            "custom_attributes": {
              "anyOf": [
                {
                  "additionalProperties": true,
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Custom Attributes"
            },
            "description": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Description"
            },
            "group_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Group Id"
            },
            "short_description": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Short Description"
            },
            "timestamp": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Timestamp"
            },
            "type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Type"
            },
            "user": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "User"
            },
            "entity": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ChangeTrackingEntity"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            }
          },
          "title": "ChangeTrackingEvent",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "event": {
          "anyOf": [
            {
              "$ref": "#/$defs/ChangeTrackingEvent"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "messages": {
          "items": {
            "type": "string"
          },
          "title": "Messages",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "CreateDeploymentEventOutput",
      "type": "object"
    }
    ```
  </Accordion>
</AccordionGroup>

## Limits & Quotas

* All actions hit the NerdGraph GraphQL endpoint; New Relic enforces
  account-level NerdGraph rate limits (per-minute request and query-cost
  budgets). Heavy or unbounded NRQL queries may be throttled or time out.
* `nrql_query` accepts an optional `timeout` (seconds) forwarded to
  NerdGraph; the HTTP client itself caps each call at 90 seconds.
* `create_deployment_event` custom attribute names must be letters,
  numbers, and underscores (not starting with a number), must not contain
  `.`, and must avoid New Relic's reserved NRQL keywords; invalid names are
  rejected before the call. A supplied `timestamp` must be within one day
  of the current time per New Relic's change tracking rules.
* **Error model**: non-2xx responses, GraphQL `errors`, and timeouts are
  caught and returned as `success=False` + `error` rather than raising.

## Related integrations

<CardGroup cols={3}>
  <Card title="Grafana" href="/integrations/tools/grafana" />

  <Card title="Sentry" href="/integrations/tools/sentry" />

  <Card title="CrowdStrike" href="/integrations/tools/crowdstrike" />
</CardGroup>

## Links

* [New Relic](https://newrelic.com)
