💬 Slack Integration

Connect Datix xAgents to Slack to receive notifications, run queries, and collaborate with your team.

Overview

Slack Integration enables:

📦 Plan Requirement

Slack Integration is available in Growth plan and above.

Setup

1. Create Slack App

  1. Go to api.slack.com/apps
  2. Click "Create New App"
  3. Choose "From Scratch"
  4. Name: "Datix xAgents"
  5. Select your workspace

2. Configure OAuth & Permissions

Add these scopes:

Bot Token Scopes: - chat:write Send messages - chat:write.public Post to public channels - channels:read View channel list - users:read View user info - commands Enable slash commands

3. Install to Workspace

  1. Go to "Install App" section
  2. Click "Install to Workspace"
  3. Authorize the app
  4. Copy the "Bot User OAuth Token"

4. Configure in Datix xAgents

  1. Navigate to Settings → Integrations
  2. Click "Add Integration"
  3. Select "Slack"
  4. Paste Bot Token
  5. Select default channel for notifications
  6. Click "Save"
POST /api/integrations { "provider": "slack", "config": { "bot_token": "xoxb-your-bot-token", "default_channel": "#datix-alerts", "notify_query_completion": true, "notify_agent_execution": true, "notify_workflow_completion": true } }

Features

Notifications

Receive alerts for:

Notification Example

📊 Query Completed ───────────────── Query: Monthly Sales Analysis Status: ✅ Success Rows: 1,247 Duration: 3.2s ───────────────── [View Results] [Share]

Slash Commands

Run queries from Slack:

/datix query What were our top products last month? /datix status Check status of agent #123 /datix template Run monthly report template /datix help Show available commands

Interactive Buttons

Notifications include action buttons:

Configuration Options

Channel Routing

Send different notifications to different channels:

{ "channels": { "query_completion": "#data-queries", "agent_execution": "#ai-agents", "anomaly_detection": "#alerts", "errors": "#errors", "approvals": "#approvals" } }

Notification Filters

Control what gets sent to Slack:

{ "filters": { "min_query_duration": 30, "query_types": ["multi_database"], "agent_priority": ["high", "critical"], "error_level": ["critical"] } }

Message Formatting

Customize notifications:

Slash Commands Setup

1. Create Slash Command

  1. In Slack App settings, go to "Slash Commands"
  2. Click "Create New Command"
  3. Command: /datix
  4. Request URL: https://your-domain.com/api/slack/commands
  5. Description: "Run Datix xAgents queries"
  6. Usage hint: query [your question]
  7. Save

2. Available Commands

/datix query [question] Run a natural language query Example: /datix query Show top 10 customers /datix template [template_id] Execute a saved template Example: /datix template 123 /datix status [agent_id] Check agent execution status Example: /datix status 456 /datix list List your recent queries /datix help Show command help

Approval Workflows

Approve Actions in Slack

When an agent requires approval:

  1. Notification sent to approvals channel
  2. Shows action details and context
  3. Buttons: "Approve" or "Reject"
  4. Click button to respond
  5. Agent continues or stops based on response

Approval Message Example

🔔 Approval Required ───────────────────── Agent: Sales Anomaly Detector Action: Send alert email to team Reason: Detected 25% drop in sales Time: 2 hours ago ───────────────────── [Approve] [Reject] [View Details]

Query Results in Slack

Result Preview

Slack messages include data preview:

Result Formatting

📊 Query Results ───────────────── Top 5 Products: 1. Product A - $12,450 2. Product B - $11,200 3. Product C - $9,800 4. Product D - $8,600 5. Product E - $7,300 Total: 152 products ───────────────── [View All Results]

User Mentions

Notify Specific Users

Tag users in notifications:

POST /api/integrations/slack/notify { "channel": "#data-alerts", "message": "Anomaly detected in sales data", "mentions": ["@john", "@sarah"], "include_results": true }

User Mapping

Map Datix users to Slack users:

Webhooks

Incoming Webhooks

Send custom messages to Slack:

POST https://hooks.slack.com/services/YOUR/WEBHOOK/URL { "text": "Daily report completed", "attachments": [{ "color": "good", "title": "Sales Report", "text": "Revenue: $125,000 (+12%)", "fields": [ { "title": "Orders", "value": "342", "short": true }, { "title": "AOV", "value": "$365", "short": true } ] }] }

Best Practices

⚠️ Token Security

Keep your Bot Token secret. Never commit it to version control. Rotate tokens regularly.

Troubleshooting

Messages Not Appearing

Slash Commands Not Working

Common Errors

channel_not_found → Invite bot to channel not_authed → Token expired or invalid rate_limited → Too many messages, slow down invalid_payload → Check message format

Rate Limits

Slack enforces rate limits:

Permissions

To configure Slack integration: