---
title: Send a Slack message
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/notification/newrelic-notification-sendslack
---

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

Sends a Slack message to a channel, integrated with destinations.

## Inputs

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

| Input             | Type   | Description                                                                                                                                                                                                                                                                                                                                                                       | Example                                                                             |
| ----------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| **destinationId** | String | **Required.** DestinationId associated with the New Relic destination. See [NerdGraph tutorial: Alerts destinations](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-destinations/) to configure a destination and retrieve its ID, and [Destinations](https://docs.newrelic.com/docs/alerts/get-notified/destinations/) for more information. | `123e4567-e89b-12d3-a456-426614174000`                                              |
| **text**          | String | **Optional.** Text message to send. Provide either `text` or `blocks`, but not both.                                                                                                                                                                                                                                                                                              | `Hello from Workflow Automation`                                                    |
| **blocks**        | List   | **Optional.** JSON array of Slack Block Kit elements. See [Supported block types](#supported-block-types). Provide either `text` or `blocks`, but not both.                                                                                                                                                                                                                       | `[{"type":"section","text":{"type":"mrkdwn","text":"*Hello*"}},{"type":"divider"}]` |
| **channel**       | String | **Required.** Channel name to send the message to.                                                                                                                                                                                                                                                                                                                                | `help-nomad`                                                                        |
| **threadTs**      | String | **Optional.** Timestamp of the parent message, used to post a reply in a thread.                                                                                                                                                                                                                                                                                                  | `1770206770.789949`                                                                 |
| **selectors**     | List   | **Optional.** Selectors to extract specific fields from the output.                                                                                                                                                                                                                                                                                                               | `[{"name": "success", "expression": ".success"}]`                                   |

### Supported block types [#supported-block-types]

The `sendSlack` action supports only two block types and rejects any others during validation.

| Block type | Description                                                                                                                                       | Allowed keys   | Example                                                                        |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | ------------------------------------------------------------------------------ |
| `section`  | The only block type that renders text. The `text` object's `type` must be either `mrkdwn` or `plain_text`, and `text` must be a non-blank string. | `type`, `text` | `{"type":"section","text":{"type":"mrkdwn","text":"*Service:* checkout-api"}}` |
| `divider`  | Renders a visual horizontal line.                                                                                                                 | `type`         | `{"type":"divider"}`                                                           |

For more information, see the [Slack Block Kit reference](https://api.slack.com/block-kit) and the [Slack Block Kit Builder](https://app.slack.com/block-kit-builder).

## Outputs

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

| Output         | Type    | Example                                                  |
| -------------- | ------- | -------------------------------------------------------- |
| `success`      | Boolean | `true/false`                                             |
| `sessionId`    | String  | `"sessionId": "7fa97f26-3791-492e-a39b-53793163dfb9"`    |
| `errorMessage` | String  | `"Channel is a required field in the notification send"` |

## Example

| Workflow example: text message                                                                                                                                                                                                                                                                                                                                                                                              |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: slack_notification_workflow description: This is a test workflow to test slack notification send action steps:   - name: SendMessageUsingSlackChannel     type: action     action: newrelic.notification.sendSlack     version: 1     inputs:       destinationId: xxxx-ed6f-xxxx-bc7d-b7ea982xxxx       text: Hi , Testing notifcation api using slack channel name       channel: test-channel-workflow ``` |

| Workflow example: Block Kit blocks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ```yaml name: slack_notification_workflow description: This is a test workflow to test slack notification send action steps:   - name: sendSlackBlocks     type: action     action: newrelic.notification.sendSlack     version: '1'     inputs:       destinationId: xxxx-ed6f-xxxx-bc7d-b7ea982xxxx       channel: test-channel-workflow       blocks:       - type: section         text:           type: mrkdwn           text: "Investigation complete"       - type: divider       - type: section         text:           type: plain_text           text: "All systems normal" ``` |
