Using OpenClaw with Slack and Microsoft Teams

Clawpedia · For Humans

Deploy your OpenClaw agent in workplace communication tools for team productivity and automation.

Overview

Slack and Microsoft Teams are the dominant messaging platforms in the enterprise world. This article shows the complete integration of OpenClaw into both platforms — from app creation to message handling, slash commands, and interactive components.

Slack Integration

Step 1: Create a Slack App


display_information:
  name: OpenClaw
  description: Your AI assistant
  background_color: "#1a1a2e"
features:
  bot_user:
    display_name: OpenClaw
    always_online: true
  slash_commands:
    - command: /ask
      url: https://your-server.com/slack/commands
      description: Ask OpenClaw a question
      usage_hint: "[your question]"
oauth_config:
  scopes:
    bot:
      - chat:write
      - channels:history
      - groups:history
      - im:history
      - im:write
      - app_mentions:read
      - commands
      - files:read
      - reactions:write
settings:
  event_subscriptions:
    request_url: https://your-server.com/slack/events
    bot_events:
      - app_mention
      - message.im
  socket_mode:
    enabled: true
  org_deploy_enabled: false

Step 2: Install and Get Tokens

Step 3: Configure OpenClaw


platforms:
  slack:
    enabled: true
    bot_token: "xoxb-..."
    app_token: "xapp-..."        # Required for Socket Mode
    signing_secret: "abc123..."  # From Basic Information
    mode: socket                 # socket | webhook
    respond_to:
      - mentions                 # @OpenClaw in channels
      - direct_messages          # DMs to the bot
      - slash_commands           # /ask command
    default_channel: C0123456789 # Optional: channel for notifications

openclaw restart
openclaw doctor --platforms

Socket Mode vs. Webhook Mode

FeatureSocket ModeWebhook Mode
Requires public URL❌✅
Setup complexityLowMedium
Latency~100ms~50ms
ReliabilityGoodExcellent
Firewall friendly✅Requires open port

Recommendation: Use Socket Mode for development and small teams. Use webhooks for production.

Slack Features

FeatureSupported
Channel messages✅
Direct messages✅
Threads✅ (replies in-thread)
Slash commands✅
File uploads✅
Reactions (emoji)✅
Block Kit messages✅
Modals✅

Rich Responses with Block Kit

Home tab⚠️ Planned

OpenClaw automatically converts Markdown responses to Slack's Block Kit format:


User:   @OpenClaw What's the project status?
OpenClaw:
┌──────────────────────────────┐
│ 📊 Project Status            │
│                              │
│ • Backend:  ✅ On track      │
│ • Frontend: ⚠️ 2 days behind │
│ • Testing:  🔄 In progress   │
│                              │
│ [View Details] [Update]      │
└──────────────────────────────┘

You can enable or disable rich formatting:


platforms:
  slack:
    formatting:
      use_blocks: true          # Rich Block Kit formatting
      thread_replies: true      # Reply in thread by default
      add_reaction: true        # React with 👀 when processing

Microsoft Teams Integration

Step 1: Create a Teams App

Step 2: Register a Bot

Step 3: Configure OpenClaw


platforms:
  teams:
    enabled: true
    app_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    app_secret: "your-client-secret"
    tenant_id: "common"         # "common" for multi-tenant, or specific tenant ID
    endpoint: https://your-server.com/api/teams
    respond_to:
      - mentions
      - direct_messages
      - channel_messages         # Optional: respond to all channel messages

Step 4: Set the Messaging Endpoint

In the Azure Bot Service configuration, set the Messaging endpoint to:


https://your-server.com/api/teams/messages

Step 5: Deploy to Your Organization

Teams Features

FeatureSupported
Channel messages✅
Direct messages✅
Group chats✅
Adaptive Cards✅
File attachments✅
Message actions⚠️ Basic
Tabs❌

Adaptive Cards

Meeting extensions❌

Teams uses Adaptive Cards for rich responses. OpenClaw auto-generates them from Markdown:


platforms:
  teams:
    formatting:
      use_adaptive_cards: true
      card_style: default        # default | compact | detailed

Comparison: Slack vs. Teams

FeatureSlackTeams
Bot setup difficultyEasyMedium
AuthenticationOAuth tokensAzure AD
Rich messagesBlock KitAdaptive Cards
Socket mode✅❌
Slash commands✅✅ (message extensions)
File accessEasyRequires Graph API
Rate limitsGenerousStricter

Enterprise Security

Free tier✅✅

For enterprise deployments, configure strict access controls:


platforms:
  slack:
    security:
      allowed_channels:
        - C0ENGINEERING
        - C0SUPPORT
      blocked_channels:
        - C0GENERAL            # Don't respond in #general
      allowed_users:
        - U0ADMIN1
        - U0ADMIN2
      admin_only_commands:
        - /ask-admin

  teams:
    security:
      allowed_teams:
        - "Engineering"
      require_admin_approval: true
      audit_log: true

Troubleshooting

Slack: Bot Appears Online but Doesn't Respond

Teams: "Could Not Reach Bot" Error

Messages Are Truncated

Slack has a 3,000-character limit per message block. Teams has similar limits. OpenClaw auto-splits long messages, but if formatting breaks:


platforms:
  slack:
    max_message_length: 2500    # Split before the hard limit
  teams:
    max_message_length: 2500

Next Steps

Related Articles