Slack Integration
Post messages to Slack channels from Flows.
Setup
Create Slack App
- Go to Slack API (opens in a new tab)
- Click Create New App → From scratch
- Name your app and select workspace
- Go to OAuth & Permissions
- Add scopes:
chat:write- Send messageschat:write.public- Send to public channels
- Install app to workspace
- Copy Bot User OAuth Token
Configure in Lux
- In Lux: Settings → Integrations → Slack
- Paste Bot User OAuth Token
- Test connection
Sending Messages
Use the Slack Message node in Flows:
{
"channel": "#alerts",
"message": "New order received!\n*Customer:* {{customer.name}}\n*Total:* ${{orderTotal}}"
}Channel Formats
"#channel-name" // By name (must have access)
"C1234567890" // By channel ID (preferred)Tip: Use channel ID for reliability. Find it in Slack: Channel Details → Copy link → Extract ID from URL
Message Formatting
Slack uses mrkdwn for formatting:
Basic Formatting
*bold*
_italic_
~strikethrough~
`code`Code Blocks
code block
Links
<https://example.com|Link Text>Mentions
<@U1234567890> // Mention user
<!channel> // @channel
<!here> // @hereRich Messages (Blocks)
For complex layouts, use blocks:
{
"channel": "#alerts",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "New Order Alert"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Customer:*\n{{customer.name}}"
},
{
"type": "mrkdwn",
"text": "*Total:*\n${{orderTotal}}"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Order"
},
"url": "{{orderUrl}}"
}
]
}
]
}Use Slack Block Kit Builder (opens in a new tab) to design blocks visually.
Common Use Cases
Alert Notifications
{
"channel": "#alerts",
"message": "🚨 *Error Alert*\n\nFlow `{{flowName}}` failed:\n```{{errorMessage}}```"
}Daily Reports
{
"channel": "#reports",
"message": "📊 *Daily Summary - {{date}}*\n\n• New users: {{newUsers}}\n• Orders: {{orderCount}}\n• Revenue: ${{revenue}}"
}Team Updates
{
"channel": "#team",
"message": "✅ *Deployment Complete*\n\nInterface `{{interfaceName}}` deployed successfully.\n<{{deployUrl}}|View Live>"
}Receiving Messages
To respond to Slack messages:
- Enable Event Subscriptions in Slack App
- Subscribe to
message.channelsevent - Set Request URL to your webhook
- Process incoming messages in Flow
Incoming payload:
{
"type": "message",
"channel": "C1234567890",
"user": "U1234567890",
"text": "Hello bot!",
"ts": "1234567890.123456"
}Best Practices
Channel Organization
- Use dedicated channels for different alert types
- Don't spam general channels
- Consider thread replies for related messages
Message Design
- Use emoji for visual scanning
- Keep messages concise
- Include actionable links
- Use blocks for complex info
Reliability
- Handle rate limits (1 msg/sec per channel)
- Log failed messages
- Use channel IDs over names
Troubleshooting
Message Not Posting
- Verify bot is in the channel
- Check OAuth scopes
- Confirm channel ID is correct
Formatting Issues
- Escape special characters
- Test in Block Kit Builder
- Verify JSON structure for blocks
Next: Custom Tools →