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

# Send Slack notifications from your AI agent

> Notify a Slack channel whenever a conversation touches a topic your team needs to know about

The Slack Action lets your Chatbase AI agent post a message to a Slack channel whenever a customer mentions a topic you want to be notified about. The notification names the topic and links straight to the conversation, so your team can open it from Slack. It runs in the background: the customer sees nothing, and the AI agent keeps handling the conversation.

> [card] Best for:
>
> Alerting your team to issues worth a human's attention (late orders, churn risk, bug reports) without escalating the conversation itself.

**Common Use Cases:**

* Flagging a complaint or a late order to the support channel
* Notifying sales when a customer asks about enterprise pricing
* Telling your team about a reported bug as soon as it comes up

> [!NOTE]
>
> **Prerequisite:** Before using the Slack Action, [connect Slack to Chatbase](https://chatbase.co/docs/user-guides/integrations/slack.md). The Slack integration needs a paid plan.

## How it works

1. A customer mentions one of the topics listed in your **When to use** instructions.
2. The AI agent calls the Action, filling in the topic and the channel name from your instructions.
3. Chatbase posts a message to that channel as **Chatbase**, with the Chatbase icon.
4. The Action runs in the background, so the customer sees nothing for it in the chat.

There's no channel picker in the Action. The AI agent takes the channel name from your **When to use** text, and a leading `#` is removed.

> [!WARNING]
>
> Enter the exact channel name in **When to use**. If the channel name is missing, misspelled, or a channel the Chatbase app can't see, the notification goes to the first channel in your workspace's channel list instead.

### What the notification looks like

Each notification has this fixed format:

```text theme={null}
Topic: *late order* has been mentioned in chat
<link to the conversation>
```

The AI agent fills in the topic (here, `late order`). The link opens the conversation in your Chatbase dashboard. If Chatbase can't build the link, the message shows "Conversation ID: " followed by the conversation's ID instead. Nothing else from the conversation is included, and the format can't be changed.

## How to create the Action

**1. Navigate to Actions**

Go to your [Chatbase dashboard](https://www.chatbase.co/dashboard/) and select your AI agent. Click **Build > Actions** in the left sidebar.

**2. Create the Action**

Click **Create Action** and select **Slack**. If Slack is connected, click **Start customizing**. If it isn't, the dialog shows **Connect Slack** instead.

**3. Choose your workspace**

Select the Slack workspace you want connected to this Action from the **Slack Workspace** dropdown.

![Selecting the Slack workspace for the Action](https://mintcdn.com/chatbase/DIWSTyTSabxfVW3B/user-guides/chatbot/images/actions/actions-2.png?fit=max\&auto=format\&n=DIWSTyTSabxfVW3B\&q=85\&s=f3c0cdfc3186ecb5cc5e1bab5e4e1a27)

**4. Configure General Settings**

**When to use:** Provide a detailed description explaining when the AI agent should use this Action. Include the exact name of the channel to post to and the topics that should trigger it. See [Examples](#examples) below.

To restrict the Action to [Procedure](https://chatbase.co/docs/user-guides/chatbot/procedures/procedures-overview.md) steps only, turn on [**Only use in Procedures**](https://chatbase.co/docs/user-guides/chatbot/actions/actions-overview.md#only-use-in-procedures). When it's on, the **When to use** field is hidden, because the AI agent no longer decides when to call the Action.

![The When to use field for the Slack Action](https://mintcdn.com/chatbase/DIWSTyTSabxfVW3B/user-guides/chatbot/images/actions/actions-3.png?fit=max\&auto=format\&n=DIWSTyTSabxfVW3B\&q=85\&s=3fd9d1001247d0de1b613023b5bc0660)

**5. Invite the app to the channel**

In Slack, invite the Chatbase app to the channel you named. Chatbase doesn't join channels on its own, so the app may not be able to post to a channel it isn't a member of. Private channels work the same way once the app is invited.

**6. Choose Channels**

This Action is compatible with every channel. Toggle it on or off for each configured channel. See [Channels](https://chatbase.co/docs/user-guides/chatbot/actions/actions-overview.md#channels) for what configured, unconfigured, and incompatible mean.

**7. Enable and Test**

Click **Enable** so the AI agent can post to your Slack channel.

![Enabling the Slack Action](https://mintcdn.com/chatbase/DIWSTyTSabxfVW3B/user-guides/chatbot/images/actions/actions-4.png?fit=max\&auto=format\&n=DIWSTyTSabxfVW3B\&q=85\&s=99ea878ee3197bfd683ecd99cfc7856d)

> [!TIP]
>
> Test the Action in the **Preview** panel of the Action editor, and confirm the notification arrives in the channel you named, not in another one.

## Examples

A **When to use** description that names both the channel and the trigger topics:

```text theme={null}
Call this tool to send a message in slack to the channel named: ai-actions-slack
whenever the user mentions any of the following topics: late order
```

![The AI agent triggering a Slack notification in chat](https://mintcdn.com/chatbase/fuaTVXjARv0sH-Me/user-guides/chatbot/images/actions/slack-example.gif?s=2d0b04e374ca4ebf19fd0a871961d498)

Once the customer mentions an issue with a late order, a Slack notification is sent to the `ai-actions-slack` channel, with a direct link to that conversation:

![A Chatbase notification in a Slack channel, linking back to the conversation](https://mintcdn.com/chatbase/dnbnfsfDM4KPXR1z/user-guides/chatbot/images/actions/Slack/slack-channel-notifications.png?fit=max\&auto=format\&n=dnbnfsfDM4KPXR1z\&q=85\&s=df4ee124e4cbd7672bc5e736e4ec65a6)

## Limitations

* **Fixed message.** The notification can't @mention people, use `@here`, or include more of the conversation.
* **Disconnecting Slack deletes the Action.** If you disconnect Slack from Chatbase, create the Action again after reconnecting.

## Best Practices

> [card] Name the Channel Exactly
>
> Type the channel name exactly as it appears in Slack, so notifications don't fall back to the first channel in the workspace.

> [card] List the Trigger Topics
>
> Spell out the topics that should fire a notification. Vague instructions produce either noise or silence.

> [card] Notify, Don't Escalate
>
> Slack tells your team something happened, but it doesn't hand over the conversation. For that, use [Escalations](https://chatbase.co/docs/user-guides/chatbot/actions/escalate-to-human.md) or [Chatbase live chat](https://chatbase.co/docs/user-guides/chatbot/actions/chatbase-live-chat.md).

> [card] Test Before Enabling
>
> Send a test message from the **Preview** panel and confirm it arrives in the right channel before you turn the Action on.

## Frequently asked questions

> [accordion] How do I choose which Slack channel gets the notification?
>
> Name the channel in the **When to use** field. There's no channel selector, only a **Slack Workspace** dropdown. If the name is wrong or missing, the message goes to the first channel in the workspace.

> [accordion] Why did the notification land in the wrong channel?
>
> The channel name in **When to use** didn't match a channel the Chatbase app can see, so Chatbase posted to the first channel in the workspace. Check the spelling, and invite the Chatbase app to the channel.

> [accordion] Can I post to a private channel?
>
> Yes, once you invite the Chatbase app to it.

> [accordion] Can the notification @mention someone or use @here?
>
> No. The message format is fixed: the topic and a link to the conversation.

> [accordion] Does the customer see anything when the notification is sent?
>
> No. The Action runs in the background, and the chat shows nothing for it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.