Slack Integration
Send messages and notifications to Slack.
Configuration
json
{
"credentials": {
"slack": {
"webhookUrl": "{{env.SLACK_WEBHOOK_URL}}",
"botToken": "{{env.SLACK_BOT_TOKEN}}"
}
}
}Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /integrations/slack/messages | Send message |
Actions (for workflows)
sendMessage
Simple text message:
json
{
"integration": "slack",
"action": "sendMessage",
"params": {
"channel": "#general",
"text": "Hello from Backflow!"
}
}sendBlocks
Rich block message:
json
{
"integration": "slack",
"action": "sendBlocks",
"params": {
"channel": "#alerts",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*New Order*\nOrder #{{input.orderId}}"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": { "type": "plain_text", "text": "View" },
"url": "https://app.example.com/orders/{{input.orderId}}"
}
]
}
]
}
}Examples
Send Message via Webhook
bash
curl -X POST http://localhost:3000/integrations/slack/messages \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"channel": "#general",
"text": "Deployment complete!"
}'Send with Formatting
bash
curl -X POST http://localhost:3000/integrations/slack/messages \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"channel": "#alerts",
"text": "*Alert:* Server CPU at 95%",
"attachments": [{
"color": "danger",
"fields": [{
"title": "Server",
"value": "prod-1",
"short": true
}]
}]
}'In Routes
json
{
"path": "/deploy",
"method": "post",
"integrations": [{
"type": "slack",
"action": "sendMessage",
"params": {
"channel": "#deployments",
"text": ":rocket: Deployed {{body.version}} to {{body.environment}}"
}
}]
}Workflow Example
json
{
"id": "notify-on-error",
"steps": [
{
"id": "notify",
"type": "integration",
"integration": "slack",
"action": "sendBlocks",
"params": {
"channel": "#alerts",
"blocks": [
{
"type": "header",
"text": { "type": "plain_text", "text": ":warning: Error Detected" }
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "{{input.errorMessage}}"
}
}
]
}
}
]
}