---
title: Create a muting rule
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/alerts/newrelic-alerts-create-muting-rule
---

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

Creates a new muting rule to suppress alert notifications for violations matching a condition. Optionally schedules the rule as a recurring or one-time maintenance window.

## Inputs

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

| Input                             | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Example                                                                                                                                                                     |
| --------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **accountId**                     | Int     | **Required.** The New Relic account in which to create the muting rule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | `123456`                                                                                                                                                                    |
| **name**                          | String  | **Required.** The name of the muting rule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | `"Deploy window - checkout service"`                                                                                                                                        |
| **enabled**                       | Boolean | **Required.** Whether the muting rule is active.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | `true`                                                                                                                                                                      |
| **condition**                     | Map     | **Required.** The condition group that defines which violations to mute. Requires `operator` (`AND` or `OR`) and `conditions` — a list of `{attribute, operator, values}` entries. `attribute` can be `accountId`, `conditionId`, `conditionName`, `conditionType`, `entity.guid`, `nrqlEventType`, `nrqlQuery`, `policyId`, `policyName`, `product`, `tags.<NAME>`, `targetId`, or `targetName`. `operator` for each entry is one of `ANY`, `CONTAINS`, `ENDS_WITH`, `EQUALS`, `IN`, `IS_BLANK`, `IS_NOT_BLANK`, `NOT_CONTAINS`, `NOT_ENDS_WITH`, `NOT_EQUALS`, `NOT_IN`, `NOT_STARTS_WITH`, or `STARTS_WITH`. | `{"operator": "AND", "conditions": [{"attribute": "policyName", "operator": "EQUALS", "values": ["Checkout Service"]}]}`                                                    |
| **description**                   | String  | **Optional.** Free-text description of the muting rule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | `"Suppresses notifications during the weekly maintenance window."`                                                                                                          |
| **actionOnMutingRuleWindowEnded** | String  | **Optional.** What happens to open issues when the muting window ends or the rule is disabled. One of `CLOSE_ISSUES_ON_INACTIVE` or `DO_NOTHING`.                                                                                                                                                                                                                                                                                                                                                                                                                                                               | `"DO_NOTHING"`                                                                                                                                                              |
| **schedule**                      | Map     | **Optional.** The time window during which the rule actively mutes violations. Omit for an always-on rule. Fields: `startTime` and `endTime` (local ISO 8601 without offset, e.g. `2026-09-01T02:00:00`), `timeZone` (IANA zone, e.g. `America/Los_Angeles`), `repeat` (`DAILY`, `WEEKLY`, or `MONTHLY`; omit for one-time), `weeklyRepeatDays` (required when `repeat` is `WEEKLY`), and one of `repeatCount` or `endRepeat` to bound the recurrence.                                                                                                                                                          | `{"startTime": "2026-09-01T02:00:00", "endTime": "2026-09-01T04:00:00", "timeZone": "America/Los_Angeles", "repeat": "WEEKLY", "weeklyRepeatDays": ["SATURDAY", "SUNDAY"]}` |
| **selectors**                     | List    | **Optional.** JQ selectors to extract values from the response.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | ```yaml selectors:   - name: mutingRuleId     expression: ".data.alertsMutingRuleCreate.id" ```                                                                             |

## 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 `id`, `name`, `enabled`, `status`, or `accountId` from `data`. ```json {   "data": {     "alertsMutingRuleCreate": {       "id": "7654321",       "name": "Deploy window - checkout service",       "enabled": true,       "status": "ACTIVE",       "accountId": 123456     }   } } ``` |

## Example

The following example creates a muting rule that suppresses alerts for a policy during recurring weekend maintenance windows.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: create_muting_rule description: Create a muting rule for a maintenance window steps:   - name: createMutingRule     type: action     action: newrelic.alerts.createMutingRule     version: 1     inputs:       accountId: ${{ .workflowInputs.accountId }}       name: "Deploy window - checkout service"       enabled: true       condition:         operator: "AND"         conditions:           - attribute: "policyName"             operator: "EQUALS"             values:               - "Checkout Service"       schedule:         startTime: "2026-09-01T02:00:00"         endTime: "2026-09-01T04:00:00"         timeZone: "America/Los_Angeles"         repeat: "WEEKLY"         weeklyRepeatDays:           - "SATURDAY"           - "SUNDAY"       selectors:         - name: mutingRuleId           expression: ".data.alertsMutingRuleCreate.id"     next: end ``` |
