OpenClaw Slack Integration
Connect OpenClaw to Slack using Expanso pipelines. Post messages, triage channels, run automated workflows - all while keeping your Slack tokens safely on your own machine.
Prerequisites
You need OpenClaw installed (install guide), a free Expanso Cloud account (sign up), and a Slack workspace where you can create apps.
Why use Expanso for Slack integration?
OpenClaw can connect to Slack directly through its built-in Slack channel, but adding Expanso unlocks a powerful pipeline layer between your AI assistant and Slack:
Credential isolation
Your Slack Bot Token and App Token stay in environment variables on your machine. Expanso resolves them at runtime - the AI never sees them.
Data transformation
Filter, enrich, and format data before posting to Slack. Aggregate metrics, strip PII, or convert raw API responses into clean summaries.
Multi-source workflows
Combine data from Gmail, Jira, databases, and APIs into a single Slack message. Expanso handles the orchestration.
Reliability
Expanso buffers messages locally if Slack is temporarily unreachable. Built-in retry logic and delivery guarantees.
Create a Slack App
You need a Slack app with the right permissions to send and read messages.
1.1 Create the app
Go to api.slack.com/apps and click Create New App. Choose "From scratch" and pick your workspace.
1.2 Enable Socket Mode
Under Settings > Socket Mode, toggle it on. This generates an App-Level Token (xapp-...) with the connections:write scope. Save this token.
1.3 Add bot permissions
Under OAuth & Permissions > Bot Token Scopes, add:
chat:write- Post messageschannels:read- List channelschannels:history- Read channel messagesim:readandim:history- Read DMsreactions:write- Add emoji reactionsusers:read- Resolve user names
1.4 Install to workspace
Click Install to Workspace and authorize. Copy the Bot User OAuth Token (xoxb-...).
1.5 Store tokens securely
Save both tokens as environment variables on your machine:
# Add to your .env or shell profile
export SLACK_BOT_TOKEN="xoxb-your-bot-token"
export SLACK_APP_TOKEN="xapp-your-app-token"Deploy the Slack Pipeline in Expanso
Create an Expanso pipeline that connects to Slack. You can build this in the Cloud dashboard or with YAML.
2.1 Set up Expanso (if you haven't already)
Follow the Expanso setup guide to create your free account and install the CLI.
2.2 Create a Slack output pipeline
Open cloud.expanso.io, click New Pipeline, and paste this YAML:
# slack-post.yaml
# Posts structured messages to a Slack channel
input:
http_server:
path: /slack-post
allowed_verbs: [ "POST" ]
pipeline:
processors:
- mapping: |
# Format the incoming data as a Slack message
root.channel = this.channel.or("#general")
root.text = this.text
root.blocks = this.blocks.or(null)
output:
http_client:
url: "https://slack.com/api/chat.postMessage"
verb: POST
headers:
Authorization: "Bearer ${SLACK_BOT_TOKEN}"
Content-Type: "application/json; charset=utf-8"2.3 Create a Slack reader pipeline
For reading and summarizing channel history:
# slack-read.yaml
# Reads recent messages from a Slack channel
input:
http_server:
path: /slack-read
allowed_verbs: [ "POST" ]
pipeline:
processors:
- http:
url: "https://slack.com/api/conversations.history"
verb: GET
headers:
Authorization: "Bearer ${SLACK_BOT_TOKEN}"
rate_limit: ""
- mapping: |
root.messages = this.messages.map_each(msg -> {
"user": msg.user,
"text": msg.text,
"ts": msg.ts
})
output:
sync_response: {}2.4 Deploy
Click Deploy in the Expanso Cloud dashboard. Your pipeline runs on your connected edge node with local credential resolution.
Connect to OpenClaw
Register the Expanso MCP server so OpenClaw can invoke your Slack pipelines.
3.1 Register the Expanso MCP server
# Register Expanso pipelines with OpenClaw
expanso-cli mcp add npx @expanso/mcp-pipelines3.2 Test the integration
Open OpenClaw and try these commands:
# Post a message to Slack
"Post 'Hello from OpenClaw!' to #general on Slack"
# Summarize a channel
"Summarize the last 20 messages in #engineering"
# Cross-platform workflow
"Check my unread emails and post a summary to #daily-digest on Slack"3.3 Configure OpenClaw's native Slack channel (optional)
For two-way interaction (talking to OpenClaw through Slack), configure OpenClaw's built-in Slack integration alongside the Expanso pipeline:
# In your OpenClaw config
channels:
slack:
app_token: "${SLACK_APP_TOKEN}"
bot_token: "${SLACK_BOT_TOKEN}"
default_channel_policy: "mention" # Respond when @mentioned
dm_policy: "open" # Always respond in DMsThis gives you the best of both worlds: talk to OpenClaw through Slack, and OpenClaw uses Expanso pipelines for reliable data processing behind the scenes.
Common Slack workflows
Here are popular ways teams use OpenClaw + Expanso with Slack:
📧 Email-to-Slack triage
Automatically fetch unread emails, categorize them by urgency, and post a structured summary to a Slack channel. OpenClaw reads your Gmail through an Expanso pipeline, applies AI categorization, then posts the digest via the Slack pipeline.
📋 Jira sprint updates
Pull sprint progress from Jira at the start of each standup and post a formatted update to your team's Slack channel. Includes completed stories, blockers, and burndown metrics.
🖥️ DevOps alerts
Monitor Prometheus or Datadog metrics through Expanso and route alerts to Slack with context enrichment. Instead of raw metric data, OpenClaw summarizes what went wrong and suggests next steps.
☀️ Morning briefing
Combine calendar events, email highlights, and project status into a single morning briefing posted to your Slack DM. All data flows through Expanso pipelines - credentials stay local.
📢 Multi-channel routing
Route different types of alerts to different Slack channels. Customer-facing issues go to #support, engineering alerts go to #oncall, and revenue metrics go to #finance. Expanso handles the routing logic.
Frequently asked questions
Is my Slack Bot Token safe?
Can OpenClaw read my Slack messages?
What happens if Slack is temporarily down?
Can I use this with Slack Enterprise Grid?
How is this different from a regular Slack bot?
Start connecting Slack
Get your OpenClaw wired up to Slack in under 10 minutes.
