← Back to Expanso + OpenClaw
💬 Integration Guide

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.

How it works
👤You
🤖OpenClaw
Expanso
💬Slack
OpenClaw sends the workflow request to Expanso. Expanso resolves your Slack credentials locally and executes the pipeline. The AI never sees your tokens.

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.

Step-by-step setup

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 messages
  • channels:read - List channels
  • channels:history - Read channel messages
  • im:read and im:history - Read DMs
  • reactions:write - Add emoji reactions
  • users: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"
Security: These tokens stay on your machine. Expanso reads them from your environment at pipeline runtime. The AI never sees them.

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.

Pre-built option: Check the Skills Catalog for ready-made Slack pipelines you can deploy with one click.

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-pipelines

3.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 DMs

This 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?
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.

Start connecting Slack

Get your OpenClaw wired up to Slack in under 10 minutes.

Related guides