Slack Node

The Slack Node allows a workflow to send messages to a Slack channel.

Slack Node

Node Properties

There are three main parts of configuration for this node…

Slack Node Config

Webhook URL

Slack Incoming Webhook URLs can be created in Slack’s incoming webhook integration. The URL of a configured webhook should be used as the webhook URL in the Slack Node configuration. This field can also be a string templates.

Message Configuration

When configuring the the message to be sent to Slack, the following fields are available for editing:

  • Channel Template: This is an optional field that supports string templates. If left blank, the message will be sent to the default room for the chosen Slack incoming webhook. If a specific channel is desired, remember to prefix it with the ’#’ sign.
  • Message Template: This is an optional field that supports string templates. If the message is left completely blank, the entire payload of the workflow will be sent to the Slack room.

Result Configuration

The result received from Slack has a single field available for configuration:

Slack Result: This is an optional path field at which the result of the request is stored. If this field is not set, the Slack Node can error the workflow. When set the result will always be an object with at least three keys:

  1. A success key which will either be true or false. It will be true if the message was sent successfully and false if the request resulted in an error.
  2. A sent key, which will always be the number of messages sent.
  3. An error key, which will only be added when success is false. The error object will contain the key message with the message of the failed request.

Below are examples of the result object.

Node Example

The following is an example of a successful message to a Slack channel, where the result path slackResult

{
  "slackResult": {
    "success": true,
    "sent": 1
  }
}

Node Errors

The following is an example of an unsuccessful Slack Node result, where the result path slackResult

{
  "slackResult": {
    "success": false,
    "sent": 0,
    "error": {
      "message": "no_active_hooks"
    }
  }
}

These error messages are taken directly from the Slack request, here are some of their common errors.

Was this page helpful?


Still looking for help? You can also search the WEGnology Forums or submit your question there.