# Send Slack notifications from your AI agent > Post to a Slack channel whenever a conversation touches a topic your team needs to know about The **Slack** Action lets your QwryAI agent post a message to a Slack channel when a customer mentions a topic you want to hear about. The message names the topic and links straight to the conversation in QwryAI, so your team can open it from Slack. It runs in the background: the customer sees nothing, and the agent carries on with the conversation. **Best for:** alerting your team to things worth a person's attention, such as late orders, churn risk or bug reports, without handing over the conversation. **Common use cases:** * Flagging a complaint or a late order to the support channel * Telling sales when a customer asks about enterprise pricing * Letting your team know about a reported bug as soon as it comes up > [!NOTE] > > **Prerequisite:** connect Slack to your agent under **Integrations** before you add this Action. See [Slack](/docs/user-guides/integrations/slack). ## How it works 1. A customer mentions one of the topics listed in your **When to use** instructions. 2. The agent calls the Action and fills in the topic and the channel name from your instructions. 3. QwryAI posts the message to that channel in your connected Slack workspace. 4. Nothing appears in the chat for it. The agent keeps handling the conversation. There's no channel picker in the Action: the agent takes the channel name from **When to use**, and a leading `#` is ignored. If the channel is public and the QwryAI app isn't in it yet, QwryAI joins it before posting. > [!WARNING] > > Write the exact channel name in **When to use**. If no channel by that name exists, nothing is posted: the Action fails with *Slack channel was not found.* A private channel only works once you've invited the QwryAI app to it. ### What the notification looks like Each notification has a fixed format: ```text Topic: late order has been mentioned in chat View conversation ``` The agent fills in the topic, here `late order`. **View conversation** links to the conversation in your QwryAI **Inbox**. Nothing else from the conversation is included, and the format can't be changed. ## How to create the Action **1. Connect Slack** Go to **Integrations**, find **Slack** and select **Connect**. You're sent to Slack to choose a workspace and allow access, then back to QwryAI. ![The Integrations page filtered to Slack, with the pointer on the Connect button of the Slack card.](annotated/04-integrations.webp "Integrations › Slack › Connect.") **2. Open Create Action** Go to **Build › Actions** and select the **Create Action** tab. Type `Slack` in **Search** to find the card. ![The Create Action tab with Slack typed in Search, showing the Slack card.](annotated/00-search.webp "Search Create Action for Slack.") Select the **Slack** card. If Slack is connected, select **Start customizing**. If it isn't, the dialog shows **Connect Slack** and a **Connect** button instead. ![The Create Action gallery with the pointer on the Slack card, which sends notifications and updates to your Slack channels.](annotated/01-gallery.webp "Create Action › Slack.") ![The Connect Slack dialog explaining you'll be redirected to Slack to authorize access, with a Connect button.](annotated/01-gallery--open.webp "Connect Slack first.") **3. Choose your workspace** The editor opens as **Slack notify**. Under **General**, pick your connected workspace from **Slack Workspace**. **4. Name the Action and write When to use** Give the Action a descriptive **Action name**, such as `notify_late_orders`. **When to use** starts with a template: replace `` with the exact Slack channel name and `` with the topics that should trigger a message. See [Examples](#examples). To run the Action only from a [Procedure](/docs/user-guides/chatbot/procedures/procedures-overview) step, turn on [**Only use in Procedures**](/docs/user-guides/chatbot/actions/actions-overview#only-use-in-procedures). **When to use** is then hidden. **5. Invite the app to private channels** Public channels need nothing more: QwryAI joins them when it first posts. For a private channel, invite the QwryAI app to it in Slack first. **6. Choose channels** Select **Continue** to open **Channels**. The Slack Action works on every channel your agent talks on, including Phone. Turn it on or off for each configured channel. See [Channels](/docs/user-guides/chatbot/actions/actions-overview#channels). **7. Save and publish** Select **Save** to enable the Action, then **Publish** in the top-right corner. See [Drafts and publishing](/docs/user-guides/chatbot/drafts-and-publishing). > [!TIP] > > Send a test message from the **Preview** beside the editor that mentions one of your topics, and check that the notification arrives in the channel you named. ## Examples A **When to use** that names both the channel and the trigger topics: ```text Call this tool to send a message in slack to the channel named: support-alerts whenever the user mentions any of the following topics: late order, damaged item ``` ![A customer on the Chat bubble says their order is late; the agent replies as usual while a QwryAI message reading Topic: late order has been mentioned in chat, with a View conversation link, appears in the support-alerts Slack channel.](walkthroughs/slack-notify.gif) When a customer mentions a late order, a message lands in `support-alerts` with a **View conversation** link to that chat. ## Limitations * **Fixed message.** The notification can't @mention people, use `@here`, or include more of the conversation. * **One workspace.** The Action posts to the Slack workspace connected to the agent. * **Disconnecting Slack deletes the Action.** If you disconnect Slack, create the Action again after reconnecting. ## Best practices > [card] Name the channel exactly | /docs/user-guides/integrations/slack | Type the channel name exactly as it appears in Slack, without spaces, so the notification finds it. > [card] List the trigger topics | /docs/user-guides/chatbot/actions/actions-overview | Spell out the topics that should fire a notification. Vague instructions produce noise or silence. > [card] Notify, don't escalate | /docs/user-guides/chatbot/actions/escalate-to-human | Slack tells your team something happened but doesn't hand over the conversation. For that, use Escalations or QwryAI live chat. > [card] Test before going live | /docs/user-guides/chatbot/playground | Send a test message from the **Preview** and confirm it arrives in the right channel before you publish. ## Frequently asked questions > [accordion] How do I choose which Slack channel gets the notification? > > Name the channel in **When to use**. There's no channel selector, only the **Slack Workspace** dropdown. > [accordion] Why didn't a notification arrive? > > The channel name in **When to use** didn't match a channel in your workspace, or it's a private channel the QwryAI app hasn't been invited to. Check the spelling and invite the app. > [accordion] Can I post to a private channel? > > Yes, once you invite the QwryAI app to it. > [accordion] Can the notification @mention someone or use @here? > > No. The 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 nothing shows in the chat. ## Next steps > [card] Slack integration | /docs/user-guides/integrations/slack | Connect Slack and chat with your agent from your workspace. > [card] Escalations | /docs/user-guides/chatbot/actions/escalate-to-human | Hand customers to your team with a ticket. > [card] Actions overview | /docs/user-guides/chatbot/actions/actions-overview | Every Action your agent can use, and how channels work.