---
title: Wait for notification status
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/notification/newrelic-notification-waitforstatus
---

The action identifier is `newrelic.notification.waitForStatus`.

Polls for the delivery outcome of a notification sent by a prior `newrelic.notification.send` step. Given a `sessionId`, this action polls `NrNotificationsEvent` until the notification reaches a terminal status (`SUCCESS` or `FAIL`) or the specified `timeout` elapses. For Slack destinations, also returns the `thread_ts` value needed to reply into the thread the notification created.

## Inputs

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

| Input         | Type    | Description                                                                                                                                               | Example                                                                |
| ------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| **sessionId** | String  | **Required.** The `sessionId` returned by a prior `newrelic.notification.send` step.                                                                      | `"${{ .steps.sendNotification.outputs.sessionId }}"`                   |
| **accountId** | Integer | **Optional.** The New Relic account ID to query for the notification event. Defaults to the workflow's own account when omitted.                          | `12345678`                                                             |
| **timeout**   | Integer | **Optional.** Number of seconds to wait before returning a `TIMEOUT` status. Default: `15`. Minimum: `5`, maximum: `30`.                                  | `15`                                                                   |
| **selectors** | List    | **Optional.** JQ selectors to extract specific fields from the output. For example, `.notificationStatus.threadTs` to capture the Slack thread timestamp. | `[{"name": "threadTs", "expression": ".notificationStatus.threadTs"}]` |

## Outputs

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

| Output               | Type    | Example                                                                                                                                                                                                                                                                                                                                                                              |
| -------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `success`            | Boolean | `true` for all terminal outcomes (`SUCCESS`, `FAIL`, `TIMEOUT`). `false` only if the action itself errored.                                                                                                                                                                                                                                                                          |
| `errorMessage`       | String  | Present only when `success` is `false`. Contains the action-level failure reason.                                                                                                                                                                                                                                                                                                    |
| `notificationStatus` | Object  | ```yaml {   "status": "SUCCESS",   "errorMessage": "Delivery failed: channel not found",   "threadTs": "1234567890.123456" } ``` `status` is one of `SUCCESS`, `FAIL`, or `TIMEOUT`. `errorMessage` is only present when `status` is `FAIL`. `threadTs` is only present for Slack destinations and contains the Slack thread timestamp needed to reply into the notification thread. |

## Example

| Workflow example: send a Slack notification and wait for delivery confirmation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: notify_and_wait description: Send a Slack notification then wait for its delivery status steps:   - name: sendNotification     type: action     action: newrelic.notification.send     version: 1     inputs:       type: slack       destinationId: "your-destination-id"       parameters:         channel: "your-slack-channel"         text: "Deployment finished"       selectors:         - name: sessionId           expression: ".response.sessionId"     next: waitForStatus    - name: waitForStatus     type: action     action: newrelic.notification.waitForStatus     version: 1     inputs:       sessionId: ${{ .steps.sendNotification.outputs.sessionId }}       timeout: 15       selectors:         - name: deliveryStatus           expression: ".notificationStatus.status"         - name: threadTs           expression: ".notificationStatus.threadTs"     next: end ``` |
