> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack

> Deploy your agent to Slack workspaces with auto-engage, file processing, and conversation starters

You can add your AI Agents to your Slack workspace as slack bots that can be prompted through DMs or @mentioned in channels.

Once set up, you can:

* Route your prompts to any AI Agent created on Xpander
* Define conditions for the bot to jump into a conversation on its own
* Have agents process long conversation histories, files, links and media

Pre-requisites:

* a [**Personal Agent**](/guides/quickstart)
* or, a [**Custom Agent**](/guides/agents/agent-configuration)

## Create a Slack Agent

To connect your Xpander agent to Slack, you create a **Slack agent**. A Slack agent is a wrapper that holds a Slack workspace's OAuth tokens and channel settings, then routes incoming messages to your Xpander agent for processing. Think of it as the bridge: the Slack agent handles the Slack side (authentication, channels, rate limits), and your Xpander agent handles the thinking.

Each Slack workspace needs its own Slack agent with its own tokens, but you can connect multiple Slack agents to the same Xpander agent, so one agent can serve several workspaces.

<Steps>
  <Step title="Open the Slack Agents page">
    Go to the [Slack Agents page](https://app.xpander.ai/slack_agents/) in Xpander and click <kbd>Create new Slack agent</kbd>. This opens the setup page where you'll provide a name and Slack tokens.

    <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/guide/deployment-slack-agent.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=6c42e77180b0b0cbdd5e242113fb1d65" alt="New Slack agent setup page with name, token fields, and Connect agent section" width="3644" height="2190" data-path="images/guide/deployment-slack-agent.png" />
  </Step>

  <Step title="Get your Slack tokens">
    Go to [api.slack.com/apps](https://api.slack.com/apps). Under **Your App Configuration Tokens**, click <kbd>Generate Token</kbd>.

    <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/guide/deployment-slack-1.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=c260f96f7ab91fb04e92666f63edff39" alt="Slack API Your Apps page with Generate Token button" width="2950" height="1976" data-path="images/guide/deployment-slack-1.png" />

    Select the workspace you want from the dropdown and click <kbd>Generate</kbd>.

    <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/guide/deployment-slack-2.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=4ef854c3fa142032f1aada122d616d13" alt="Generate Your App Configuration Token dialog with workspace selection" width="2950" height="1976" data-path="images/guide/deployment-slack-2.png" />

    Copy both the **Access Token** and **Refresh Token**.

    <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/guide/deployment-slack-3.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=3fdb91304d0bc12e2f22f8a4b392235d" alt="Slack API tokens page showing Access Token and Refresh Token with Copy buttons" width="2950" height="1976" data-path="images/guide/deployment-slack-3.png" />
  </Step>

  <Step title="Authorize the workspace">
    Back on the Xpander setup page, enter a **Slack agent name**, paste the **Access Token** and **Refresh Token**, then click <kbd>Connect to Slack</kbd>.

    Slack will prompt you to review permissions. Click <kbd>Allow</kbd>.

    <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/guide/deployment-slack-4.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=0143a2ca1172e192ce63065c810e3b0c" alt="Slack OAuth permissions page requesting access to channels and conversations" width="2950" height="1976" data-path="images/guide/deployment-slack-4.png" />
  </Step>

  <Step title="Add channels">
    Once connected, add the Slack channels the bot should be active in and click <kbd>Add to channels</kbd>.

    <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/guide/deployment-slack-5.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=3bdfed9376f275e616858bf924c63d62" alt="Successfully connected Slack agent page with channel selection and Connect agent section" width="3132" height="2032" data-path="images/guide/deployment-slack-5.png" />
  </Step>

  <Step title="Choose and connect Xpander agents">
    On the same page, select the Xpander agent (or agents) you want this Slack agent to route messages to and click <kbd>Connect agent</kbd>. The Slack agent will now hand off conversations to the connected Xpander agents.
  </Step>
</Steps>

## Configure Your Slack Agent

Once connected, manage all your Slack agents from the [Slack Agents page](https://app.xpander.ai/slack_agents/). Each Slack agent has four configuration tabs.

### Edit Agent Details

Change the Slack agent name, description, and which Xpander agent or workflow it's connected to. You can swap the underlying agent at any time without recreating the Slack integration.

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/guide/deployment-slack-6.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=70a72d20f37b7b7959a873831b241db2" alt="Slack agent details tab showing name, description, and connected AI agent" width="2026" height="1226" data-path="images/guide/deployment-slack-6.png" />
</Frame>

### Toggle Capabilities

When a user sends a message with attached files, these toggles control whether the bot automatically processes them before the agent starts thinking. All are enabled by default.

| Capability                         | What it does                                                                                                                                     |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Auto OCR from images**           | Automatically extracts text from every attached image (jpg, jpeg, png, gif, bmp, tiff, webp, heic, avif) and injects it into the agent's context |
| **Auto transcribe audio messages** | Automatically transcribes attached audio into text so the agent can process spoken content                                                       |
| **Auto OCR from PDF**              | Automatically extracts text from attached PDF files                                                                                              |
| **Auto crawl links**               | Automatically crawls the first page of any link in the message and feeds the content to the agent                                                |
| **Stream task progress**           | Show tool calls and plan updates in Slack while the agent works. Turn off for a quieter, prose-only reply.                                       |

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/U8IZJVU7JcxODXST/images/image.png?fit=max&auto=format&n=U8IZJVU7JcxODXST&q=85&s=e2085de3f49714a666adb698d63688ee" alt="Image" width="1534" height="834" data-path="images/image.png" />
</Frame>

### Set Up Auto-Engage

Add the Slack channels the bot is active in, and define auto-engage conditions. Auto-engage conditions are natural language rules like "When user is asking about stock price" - when a message in the channel matches a condition, the bot responds automatically without being @mentioned.

Click <kbd>+ Add to channel</kbd> to add channels, and <kbd>+ Add condition</kbd> to create auto-engage rules.

Write conditions as specific intent descriptions, not keyword lists. "When a user asks about deployment status or CI failures" works better than "deployment, CI, failure". Describe the scenario you want the bot to respond to.

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/guide/deployment-slack-8.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=6fad60781912db365eb234092a4070de" alt="Channels and auto-engage tab with channel list and condition builder" width="2014" height="1226" data-path="images/guide/deployment-slack-8.png" />
</Frame>

### Add Conversation Starters

Add suggested prompts that appear on the first interaction in every new DM conversation. These help users understand what the agent can do.

Click <kbd>+ Add conversation starter</kbd> to create prompts like "Summarize today's tickets" or "What's the deployment status?"

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/guide/deployment-slack-9.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=9da471eb6dd59147549c90323fed0758" alt="Conversation starters tab with Add conversation starter button" width="2014" height="1216" data-path="images/guide/deployment-slack-9.png" />
</Frame>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Bot doesn't respond to messages">
    Check that the bot is added to the channel (Channels tab in the Slack agent config). Verify the connected Xpander agent is published and not stopped.
  </Accordion>

  <Accordion title="OAuth connection fails">
    Slack configuration tokens expire. Go to api.slack.com/apps, regenerate your Access Token and Refresh Token, and paste the new values.
  </Accordion>

  <Accordion title="Bot responds when it shouldn't">
    Review your auto-engage conditions. Overly broad conditions like "when someone asks a question" will trigger on most messages. Make conditions more specific.
  </Accordion>
</AccordionGroup>

## Remove a Slack Agent

To disconnect and delete a Slack agent, go to the [Slack Agents page](https://app.xpander.ai/slack_agents/), select the agent, and click <kbd>Delete</kbd>. This revokes the bot's access to the Slack workspace and removes it from all channels. The underlying Xpander agent is not affected, only the Slack connection is removed.

## Next Steps

<CardGroup cols={2}>
  <Card title="Chat Widget" icon="browser" href="/guides/deploy/chat-widget">
    Share a chat URL or embed in your website
  </Card>

  <Card title="Webhooks" icon="webhook" href="/guides/deploy/webhooks">
    Trigger agents from external systems
  </Card>

  <Card title="Monitor Runs" icon="chart-line" href="/guides/observability/threads">
    Trace execution, debug failures, and review AI performance
  </Card>
</CardGroup>
