---
title: Get an NRQL condition
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/alerts/newrelic-alerts-get-nrql-condition
---

The action identifier is `newrelic.alerts.getNrqlCondition`.

Retrieves the details of a single NRQL alert condition. Works for both static and baseline condition types.

## Inputs

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

| Input         | Type   | Description                                                     | Example                                                                                                        |
| ------------- | ------ | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| **accountId** | Int    | **Required.** The New Relic account that owns the condition.    | `123456`                                                                                                       |
| **id**        | String | **Required.** The ID of the condition to retrieve.              | `"7654321"`                                                                                                    |
| **selectors** | List   | **Optional.** JQ selectors to extract values from the response. | ```yaml selectors:   - name: conditionName     expression: ".data.actor.account.alerts.nrqlCondition.name" ``` |

## Outputs

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

| Output           | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **success**      | Boolean | `true` when the step executed without error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **errorMessage** | String  | Error message on failure. `null` on success.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **data**         | Map     | NerdGraph response. Use `selectors` to extract fields from `.data.actor.account.alerts.nrqlCondition`. Baseline conditions additionally include `baselineDirection` and `signalSeasonality`. ```json {   "data": {     "actor": {       "account": {         "alerts": {           "nrqlCondition": {             "id": "7654321",             "name": "High error rate",             "type": "STATIC",             "enabled": true,             "policyId": "2000002",             "entityGuid": "MTE5MzMzNDd8TlIxfE5SUV9DT05EQVRJT058NzY1NDMyMQ"           }         }       }     }   } } ``` |

## Example

The following example fetches a condition's current configuration.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                       |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: get_nrql_condition description: Get an NRQL alert condition steps:   - name: getCondition     type: action     action: newrelic.alerts.getNrqlCondition     version: 1     inputs:       accountId: ${{ .workflowInputs.accountId }}       id: ${{ .workflowInputs.conditionId }}       selectors:         - name: conditionName           expression: ".data.actor.account.alerts.nrqlCondition.name"     next: end ``` |
