Slack App Interactive Components Setup
Goal: Enable button/dropdown interactions in Slack messages
Date: 2026-02-19
Status: Pending configuration
Prerequisites
- Slack app already created (Better Acquisitions workspace)
- Bot token configured in OpenClaw (already done)
- OpenClaw gateway running and accessible
Step 1: Get Slack Signing Secret
- Go to https://api.slack.com/apps
- Select your Better Acquisitions app
- Go to Settings → Basic Information
- Scroll to App Credentials section
- Copy the Signing Secret
- Save it to server:
echo "YOUR_SIGNING_SECRET_HERE" > /home/opsadmin/.openclaw/workspace/data/slack-signing-secret.txt
chmod 600 /home/opsadmin/.openclaw/workspace/data/slack-signing-secret.txtStep 2: Start Webhook Server
cd /home/opsadmin/.openclaw/workspace/scripts
node gateway-slack-webhook.js 18791Expected output:
[SLACK] Webhook server listening on port 18791
[SLACK] Endpoint: http://localhost:18791/api/slack/interactions
Keep this running in a tmux/screen session or add to systemd.
Step 3: Configure Firewall
sudo ufw allow 18791/tcp comment "Slack webhook"
sudo ufw status numberedVerify access:
curl http://YOUR_SERVER_IP:18791/api/slack/healthShould return:
{
"status": "ok",
"service": "slack-webhook",
"timestamp": "2026-02-19T..."
}Step 4: Enable Interactivity in Slack App
-
Select your Better Acquisitions app
-
Go to Features → Interactivity & Shortcuts
-
Toggle Interactivity to On
-
Set Request URL:
http://YOUR_SERVER_IP:18791/api/slack/interactionsOr if using Tailscale/VPN:
http://your-tailscale-hostname:18791/api/slack/interactions -
Click Save Changes
Slack will verify the endpoint immediately. If it fails:
- Check firewall rules
- Verify webhook server is running
- Check server logs for errors
Step 5: Verify Required Scopes
Go to OAuth & Permissions and confirm these scopes are enabled:
Bot Token Scopes:
chat:write(already have)chat:write.public(add if missing)channels:read(already have)users:read(already have)
If you add new scopes, reinstall the app to your workspace.
Step 6: Test End-to-End
Option A: Manual Test
- Post a test message with buttons:
node /home/opsadmin/.openclaw/workspace/scripts/test-slack-interactive.js- Click a button in Slack
- Check server logs:
tail -f /var/log/slack-webhook.logShould see:
[SLACK] Interaction received: { type: 'block_actions', action: 'add_contact_...', ... }
Option B: Real Deal Test
node /home/opsadmin/.openclaw/workspace/scripts/send-contact-suggestion-slack.js 54223789480This will:
- Validate deal #54223789480
- Find missing contacts
- Extract suggestions from Gmail/SalesMessage
- Post interactive message to atlas-build
- You can click buttons to add contacts
Step 7: Deploy to Production Cron
Once tested, update the 6 AM compliance cron to use interactive messages:
# Edit cron job
openclaw cron update --id 4075e471-4190-4b16-841e-d0e68bf32b10 \
--payload '{"kind":"agentTurn","message":"Run daily contact compliance check and post interactive Slack messages for any blocking deals"}'Troubleshooting
Buttons Don’t Respond
- Check webhook server is running:
curl http://localhost:18791/api/slack/health - Check Slack app Request URL is correct
- Check firewall allows port 18791
- Check server logs for errors
”Invalid Signature” Error
- Verify signing secret is correct
- Check file permissions:
ls -l /home/opsadmin/.openclaw/workspace/data/slack-signing-secret.txt - Restart webhook server after updating secret
Contact Not Added to HubSpot
- Check HubSpot PAT is valid
- Verify
add-contact-to-deal.jsworks standalone:node /home/opsadmin/.openclaw/workspace/scripts/add-contact-to-deal.js \ 54223789480 "test@example.com" "Test Contact" EB - Check HubSpot API logs
Dropdowns Don’t Show Selected Value
- This is a Slack UI quirk - selections are captured in
state.values - Handler correctly extracts selected values
- Confirmation message will show what was selected
Architecture Diagram
Slack App
↓ (user clicks button)
Slack API
↓ (POST /api/slack/interactions)
Webhook Server (port 18791)
↓ (verifies signature)
slack-interaction-handler.js
↓ (parses payload, extracts selections)
add-contact-to-deal.js
↓ (creates/associates contact)
HubSpot API
↓ (updates deal)
validate-deal-v3.js
↓ (re-checks requirements)
Slack Thread Reply
↓ (confirmation message)
User sees result
Security Notes
- Signing secret verification prevents unauthorized requests
- Timestamp validation prevents replay attacks (5-minute window)
- Bot token never exposed to client
- HTTPS recommended for production (use nginx reverse proxy)
Production Deployment Checklist
- Signing secret saved securely
- Webhook server running (systemd service)
- Firewall configured
- Slack app Request URL set
- End-to-end test passed
- Cron job updated
- Monitoring/alerting configured
- Backup webhook server (optional)
Last updated: 2026-02-19 01:00 AM UTC
Next steps: Test with real deal data, deploy to cron