Slack Integration

Send transformed webhook payloads to Slack channels using Incoming Webhooks. Slack is a destination in WebhookLane — you receive events from any source and route them to Slack with a Handlebars transform that produces Block Kit JSON.

Prerequisites

  • A Slack workspace you can manage apps in
  • A Slack App with Incoming Webhooks enabled (create one at api.slack.com/apps)
  • A webhook URL for the target channel (starts with https://hooks.slack.com/services/...)

Setup

  1. Create the Incoming Webhook in Slack
    In your Slack App settings, go to Incoming Webhooks, toggle it on, and click Add New Webhook to Workspace. Select the channel and copy the webhook URL.
  2. Create a Slack destination in WebhookLane
    Go to Destinations → Create destination, choose type Slack, and paste your webhook URL.
  3. Create a route with a transform
    Go to Routes → Create route, select your source and the Slack destination. Add a Handlebars transform template that produces Slack Block Kit JSON.

Example Transform

This template sends a formatted notification to Slack when an event is received:

{
  "blocks": [
    {
      "type": "header",
      "text": {
        "type": "plain_text",
        "text": "{{slackEscape (truncate title 150)}}"
      }
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "{{slackEscape (truncate description 500)}}"
      }
    },
    {
      "type": "context",
      "elements": [
        {
          "type": "mrkdwn",
          "text": "Source: *{{slackEscape source}}* | {{formatDate createdAt}}"
        }
      ]
    }
  ]
}

Available Helpers

  • slackEscape — Escapes &, <, > for Slack
  • truncate — Truncates a string to a given length (e.g. {{truncate text 200}})
  • json — Pretty-prints a value as JSON
  • eq — Equality comparison for conditionals
  • formatDate — Formats a date as ISO string
  • formatTime — Formats a date with weekday, month, day, time (optional timezone)
  • mapJoin — Maps an array by key and joins with separator

Tips

  • WebhookLane automatically adds a text fallback field if your payload doesn't include one, preventing Slack API errors.
  • Empty blocks (sections with no text, headers with blank text, context blocks with no elements) are automatically stripped before sending.
  • Action button URLs must be absolute https:// URLs — relative URLs or non-HTTPS links are filtered out.
  • Accessory image URLs must start with http or they will be removed.
  • The payload is always sent as application/json.