Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Slack

Slack is the leading workplace communication platform used by millions of teams. The Slack sink delivers your outbox messages as formatted notifications to Slack channels using incoming webhooks. This enables real-time operational alerts, business event notifications, and workflow triggers delivered directly to the channels where your team collaborates.

When to Use This Sink

Choose the Slack sink when you want your team to be notified immediately when important business events occur — new high-value orders, system errors, deployment completions, or compliance-relevant actions. The Slack sink formats messages using Slack's Block Kit for rich, readable notifications.

Configuration

SELECT tide.relay_set_outbox(
    'alerts-to-slack',
    'alerts',
    'slack-relay',
    '{
        "sink_type": "slack",
        "webhook_url": "${env:SLACK_WEBHOOK_URL}",
        "channel": "#ops-alerts",
        "username": "pg_tide",
        "icon_emoji": ":database:"
    }'::jsonb
);

Configuration Reference

ParameterTypeDefaultDescription
sink_typestringMust be "slack"
webhook_urlstringSlack incoming webhook URL
channelstringnullOverride channel (must be allowed by webhook config)
usernamestring"pg_tide"Display name for the bot
icon_emojistringnullEmoji icon for the bot
templatestringnullCustom Block Kit template for message formatting

Rate Limits

Slack imposes rate limits on incoming webhooks (approximately 1 message per second per webhook). For high-volume outboxes, use the rate limiter to stay within limits:

{
    "sink_type": "slack",
    "webhook_url": "${env:SLACK_WEBHOOK_URL}",
    "rate_limit": {"messages_per_second": 1}
}

Troubleshooting

  • "Invalid webhook URL" — Webhook URLs expire if the app is uninstalled; regenerate in Slack app settings
  • "Channel not found" — The webhook's default channel was deleted; set channel explicitly
  • HTTP 429 — Rate limited; add rate limiting to the pipeline configuration

Further Reading

  • Discord — Similar notification sink for Discord
  • PagerDuty — For incident management alerting
  • HTTP Webhook — For custom HTTP endpoints