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

  1. Go to https://api.slack.com/apps
  2. Select your Better Acquisitions app
  3. Go to Settings → Basic Information
  4. Scroll to App Credentials section
  5. Copy the Signing Secret
  6. 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.txt

Step 2: Start Webhook Server

cd /home/opsadmin/.openclaw/workspace/scripts
node gateway-slack-webhook.js 18791

Expected 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 numbered

Verify access:

curl http://YOUR_SERVER_IP:18791/api/slack/health

Should return:

{
  "status": "ok",
  "service": "slack-webhook",
  "timestamp": "2026-02-19T..."
}

Step 4: Enable Interactivity in Slack App

  1. Go to https://api.slack.com/apps

  2. Select your Better Acquisitions app

  3. Go to Features → Interactivity & Shortcuts

  4. Toggle Interactivity to On

  5. Set Request URL:

    http://YOUR_SERVER_IP:18791/api/slack/interactions
    

    Or if using Tailscale/VPN:

    http://your-tailscale-hostname:18791/api/slack/interactions
    
  6. 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

  1. Post a test message with buttons:
node /home/opsadmin/.openclaw/workspace/scripts/test-slack-interactive.js
  1. Click a button in Slack
  2. Check server logs:
tail -f /var/log/slack-webhook.log

Should 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 54223789480

This will:

  1. Validate deal #54223789480
  2. Find missing contacts
  3. Extract suggestions from Gmail/SalesMessage
  4. Post interactive message to atlas-build
  5. 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.js works standalone:
    node /home/opsadmin/.openclaw/workspace/scripts/add-contact-to-deal.js \
      54223789480 "test@example.com" "Test Contact" EB
  • Check HubSpot API logs
  • 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