DRAGOPS
DRAGOPS
DocumentationIntegrationsSlack

Slack

Send formatted messages to Slack channels and receive Slack events in your patterns.

Slack integrations in DRAGOPS follow the same pattern as every other service: outbound messages use HTTP Request, inbound events use On Webhook, and data transformation uses the standard JSON and object nodes. You can send simple text notifications, rich Block Kit messages, and respond to Slack events — all with nodes you already know.

Send messages to Slack

The simplest way to send a message to a Slack channel is through an Incoming Webhook URL. Slack provides this URL when you create a Slack app with the Incoming Webhooks feature enabled.

Set up a Slack Incoming Webhook

  1. Go to api.slack.com/apps and create a new Slack app (or select an existing one).
  2. Under Features, select Incoming Webhooks and toggle it on.
  3. Select Add New Webhook to Workspace and choose the channel where messages should post.
  4. Copy the webhook URL. It looks like: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

Send a simple text message

  1. Add a Set Property node. Set the Key to text and wire a String literal with your message to the Value input pin.
  2. Add a JSON Stringify node and wire Set Property's Object output to its Object input pin.
  3. Add a Set Property node for headers. Set the Key to Content-Type and the value to application/json.
  4. Add an HTTP Request node. Set the Method to POST and the URL to your Slack webhook URL.
  5. Wire the JSON string to HTTP Request's Body input pin and the headers object to the Headers input pin.

The Slack Incoming Webhook URL acts as both the endpoint and the authentication. You do not need to add an Authorization header.

Build dynamic messages

Use Format and Get Property nodes to build messages from incoming data:

Slack supports basic Markdown in the text field: *bold*, _italic_, ~strikethrough~, `code`, and > for block quotes.

Rich message formatting with Block Kit

For structured messages with sections, fields, buttons, and dividers, use Slack's Block Kit JSON format. You build the blocks as a JSON object and send it in the request body.

Block Kit message structure

A Block Kit message uses a blocks array instead of (or in addition to) the text field:

{
  "blocks": [
    {
      "type": "header",
      "text": {
        "type": "plain_text",
        "text": "Deployment notification"
      }
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Service:*\napi-gateway"
        },
        {
          "type": "mrkdwn",
          "text": "*Environment:*\nproduction"
        }
      ]
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Status:*\nSucceeded"
        },
        {
          "type": "mrkdwn",
          "text": "*Duration:*\n2m 34s"
        }
      ]
    },
    {
      "type": "divider"
    },
    {
      "type": "context",
      "elements": [
        {
          "type": "mrkdwn",
          "text": "Triggered by *octocat* at 2026-03-05 14:30 UTC"
        }
      ]
    }
  ]
}

Build Block Kit messages in a pattern

You can build the blocks object using multiple Set Property nodes, or assemble the JSON string directly with Format nodes. For complex Block Kit layouts, the Format approach is often more readable:

  1. Use a Format node with the Block Kit JSON as the template, using {0}, {1}, etc. for dynamic values.
  2. Wire the dynamic values (service name, status, timestamp) to the Format node's input pins.
  3. The Format node's output is a JSON string ready to send as the HTTP Request body.

Sending to the Slack Web API

For more control (posting to different channels, threading, updating messages), use the Slack Web API instead of Incoming Webhooks. The Web API requires a Bot Token for authentication.

  1. In your Slack app settings, go to OAuth & Permissions and add the chat:write scope.
  2. Install the app to your workspace and copy the Bot User OAuth Token (starts with xoxb-).
  3. Store the token in a DRAGOPS connection or secret.

To post a message via the Web API:

Receive Slack events

Slack can send events to your DRAGOPS pattern when messages are posted, reactions are added, channels are created, and more. This uses Slack's Events API.

Set up Slack event subscriptions

  1. In your Slack app settings, go to Event Subscriptions and toggle it on.
  2. Paste your DRAGOPS pattern's webhook URL in the Request URL field.
  3. Slack sends a verification challenge to confirm the URL is valid. Your pattern must respond with the challenge value (see below).
  4. Under Subscribe to bot events, add the events you want to receive (for example, message.channels, reaction_added, app_mention).
  5. Reinstall the app to your workspace if prompted.

Handle the URL verification challenge

When you first enter the webhook URL, Slack sends a POST request with a verification challenge:

{
  "type": "url_verification",
  "challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P",
  "token": "Jhj5dZrVaK7ZwHHjRyZWjbDl"
}

Your pattern must return the challenge value in the response body. Use Respond To Webhook to handle this:

Once Slack verifies the URL, it sends actual events to the same endpoint. Your pattern handles both the one-time verification and ongoing events.

Parse incoming Slack events

Slack wraps the actual event inside an event property in the request body:

{
  "type": "event_callback",
  "event": {
    "type": "message",
    "channel": "C0123456789",
    "user": "U0123456789",
    "text": "Hello, DRAGOPS!",
    "ts": "1709654400.000100"
  },
  "team_id": "T0123456789",
  "event_id": "Ev0123456789"
}

Extract the event details in your pattern:

Complete example: Send a formatted notification on webhook trigger

This pattern receives an incoming webhook with deployment data and sends a formatted Slack notification.

Incoming webhook payload

{
  "service": "api-gateway",
  "environment": "production",
  "status": "succeeded",
  "duration": "2m 34s",
  "triggered_by": "octocat"
}

Pattern layout

Step-by-step

  1. On Webhook receives the deployment data. The Body output pin provides the parsed object.
  2. Five Get Property nodes extract service, environment, status, duration, and triggered_by.
  3. Format builds the message string:
    :rocket: *Deployment {0}*
    *Service:* {1}
    *Environment:* {2}
    *Duration:* {3}
    *Triggered by:* {4}
    This produces: :rocket: *Deployment succeeded*\n*Service:* api-gateway\n*Environment:* production\n*Duration:* 2m 34s\n*Triggered by:* octocat
  4. Set Property (Key: "text") creates the Slack message payload object.
  5. JSON Stringify converts it to a JSON string.
  6. Set Property (Key: "Content-Type", Value: "application/json") builds the request headers.
  7. HTTP Request sends the POST to the Slack Incoming Webhook URL.
  8. Branch checks the response status code.
  9. Log records the result.

Test the pattern

  1. Select Run in the toolbar.
  2. Enter test event data:
{
  "body": {
    "service": "api-gateway",
    "environment": "production",
    "status": "succeeded",
    "duration": "2m 34s",
    "triggered_by": "octocat"
  },
  "headers": {
    "content-type": "application/json"
  },
  "query": {},
  "method": "POST"
}
  1. Verify the execution log shows the Format node producing the expected message string and the HTTP Request node sending the POST.

Test with curl

Once deployed, send a test request:

curl -X POST https://your-dragops-webhook-url \
  -H "Content-Type: application/json" \
  -d '{
    "service": "api-gateway",
    "environment": "production",
    "status": "succeeded",
    "duration": "2m 34s",
    "triggered_by": "octocat"
  }'

Tips

  • Store Slack webhook URLs in secrets. Incoming Webhook URLs are sensitive — anyone with the URL can post to your channel. Store the URL in a DRAGOPS secret rather than hardcoding it in the pattern.
  • Use Block Kit Builder. Slack provides a visual Block Kit Builder where you can design your message layout and copy the JSON. Use this to prototype your message format, then replicate it in your pattern with Set Property or Format nodes.
  • Handle Slack's 3-second timeout. When receiving Slack events, Slack expects a response within 3 seconds. If your pattern takes longer to process, use Respond To Webhook to send an immediate 200 response, then continue processing. Slack retries unacknowledged events, which can cause duplicate processing.
  • Avoid message loops. If your pattern listens for Slack messages and also posts to Slack, make sure it does not respond to its own messages. Check the event.bot_id field and skip processing when it matches your app's bot ID.
  • Rate limits apply. Slack's Web API has rate limits (typically 1 request per second per method per workspace). For high-volume patterns, add delays or queue mechanisms to stay within limits.

On this page