Connect Slack
to Your Pipeline
Route Slack messages, mentions, and channel activity into Expanso pipelines. Your OAuth tokens stay on your machine.
Your natural language commands flow through OpenClaw to your Expanso-managed pipeline, which reads and writes Slack via the Bot API. Credentials stay in your infrastructure.
Three steps to go live
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, channels:read, channels:history, im:read, im:history, reactions:write, users:read
1.4 Install to workspace
Click Install to Workspace and authorize. Copy the Bot User OAuth Token (xoxb-...).
1.5 Store tokens securely
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.
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:
# slack-post.yaml
# Posts structured messages to a Slack channel
input:
http_server:
path: /slack-post
allowed_verbs: [ "POST" ]
pipeline:
processors:
- mapping: |
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
expanso-cli mcp add npx @expanso/mcp-pipelines 3.2 Test the integration
Open OpenClaw and try these commands:
"Post 'Hello from OpenClaw!' to #general on Slack"
"Summarize the last 20 messages in #engineering"
"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, configure OpenClaw's built-in Slack integration:
# 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 DMs Use cases
Fetch unread emails, categorize by urgency, and post a structured summary to a Slack channel automatically.
Pull Jira sprint progress and post a formatted update to your team's channel before standup - including blockers and burndown.
Route Prometheus or Datadog alerts to Slack with AI-generated context - what went wrong and suggested next steps.
Combine calendar events, email highlights, and project status into a single morning post to your Slack DM or channel.
Route different alert types to different channels. Customer issues to #support, engineering alerts to #oncall, metrics to #finance.
Common questions
Is my Slack Bot Token safe?
Yes. Your Slack tokens are stored in environment variables on your machine. Expanso resolves them at pipeline runtime - the tokens are never sent to OpenClaw or any AI model. The AI only sees the workflow request ('post this text to #general'), not the credentials used to execute it.
Can OpenClaw read my Slack messages?
Only if you configure it to. The Slack reader pipeline gives OpenClaw access to channel history, but only for channels you explicitly grant access to via bot permissions. You control the scope through Slack's OAuth permissions.
What happens if Slack is temporarily down?
Expanso buffers outgoing messages locally (up to 10 GB by default). When Slack comes back online, buffered messages are delivered automatically. You get delivery guarantees without writing any retry logic.
Can I use this with Slack Enterprise Grid?
Yes. Expanso supports Slack's Enterprise Grid through the same OAuth flow. For organizations that need on-premise deployment, Expanso can run entirely within your VPC. See the enterprise options page.
How is this different from a regular Slack bot?
A traditional Slack bot runs on a server and has limited, pre-programmed responses. With OpenClaw + Expanso, you get an AI assistant that understands natural language and can chain multiple data sources together. Ask 'summarize my emails and post to Slack' and it builds the entire workflow on the fly.
Ready to connect Slack?
Takes about 10 minutes. No extra infrastructure required.