Build AI agents in Slack with Trigger.dev

Build AI agents that run in Slack. Your team or your customers can ask them questions and hand them work, right where they already talk.

Get started now

Example: A refund agent built with Trigger.dev

support
Thread# support
J
Jordan9:41 AM
@Refund agent can you cancel Sam Ortiz’s subscription and refund the last six months?
No replies yet
Webhook endpoint

Receive the Slack request, verify it, and start the agent.

Refund agentReady
  1. Look up customer

    Find the customer and their recent payments.

    pending
  2. Request approval

    Send Approve and Deny buttons to the Slack thread.

    pending
  3. Wait for approval

    Save the run and wait. Resume when the decision arrives.

    pending
  4. Move to the free plan

    Update the subscription once the refund is approved.

    pending
  5. Refund six months

    Return six payments to the original payment method.

    pending
  6. Reply in Slack

    Confirm the outcome in the same Slack thread.

    pending
A Slack message asks the agent to cancel a subscription and issue a refund.

Two-way, not just webhooks in

Webhooks bring Slack events in, and the connector answers back in the same place.

Slack agents

@trigger.dev/slack
Slack → your agent
  • Messages and @mentions in a DM or channel thread
  • Approve and Deny button clicks
  • Files shared in the thread
Your agent → Slack
  • Each tool call as a step in a plan, ticked off as it finishes
  • The reply, streamed as the model writes it
  • Approval buttons, and Block Kit messages

Handled for you

Verifies Slack's signing secret, answers its URL handshake, and acknowledges each event right away. Slack's stop button stops the turn.

What your agent can do

Each thread is a durable session

A DM or a channel thread becomes a Trigger.dev session. A message runs as a turn, and follow-ups in the same thread keep the context.

Status, streaming and a plan

The session shows the agent working, the reply streams into the thread as the model writes it, and each tool call appears as a task in the reply's plan, ticked off when it returns.

Approve and Deny buttons

A tool with no execute pauses the turn and posts Approve and Deny. A click resolves the tool to { approved: boolean } and resumes it. Use approval for your own buttons.

Slack's stop button

Stop aborts the running turn: the partial reply stays in the thread and the next message carries on. A stop during an approval cancels it.

Channel threads

With startOn: appMentions(), an @mention in a channel starts a session in a thread and the agent follows the rest of it. seedFromThread loads earlier replies first.

Messages while it's working

A message sent mid-reply gets 👀 straight away, then runs as the next turn in order, or is folded into the reply in progress with pending messages.

Files

Images (PNG, JPEG, GIF, WebP) and PDFs a user shares reach the model with their message. Other files arrive as a short note so the agent can say it can't open them.

Slack Connect

In a channel shared with another organization, ownWorkspaceOnly: true answers only people from your own workspace.

Answer from anywhere

Another webhook routed to the same session, or a browser chat on it, answers into the Slack thread with the same status, streaming and buttons.

Get started

  1. 1

    Set up the agent

    Copy the starter prompt into your coding agent, like Claude Code, Cursor or Codex. It creates a Trigger.dev project and writes your Slack agent. Prefer to write it yourself? Start from the example below.

  2. 2

    Create a Slack app

    At api.slack.com/apps, create an app from a manifest, with your agent's Trigger.dev URL as its request URL.

  3. 3

    Connect it

    Copy the app's signing secret into Trigger.dev, install the app in your workspace, and give your agent its bot token.

  4. 4

    Try it

    @mention the agent in Slack. You'll see it start working within a second, and the reply streams in.

Example

A Slack support agent

One endpoint for Slack's events, and an AI agent with two tools that replies in the thread. That's the whole agent.

import { webhooks } from "@trigger.dev/sdk";
import { chat } from "@trigger.dev/sdk/ai";
import { appMentions, slack, webhookSource } from "@trigger.dev/slack";
import { anthropic } from "@ai-sdk/anthropic";
const slackEvents = webhooks.endpoint.define({
id: "slack",
source: webhookSource(),
});
export const support = chat.agent({
id: "support",
channels: [
slack({
id: "slack",
endpoint: slackEvents,
token: process.env.SLACK_BOT_TOKEN!,
startOn: appMentions(),
}),
],
tools: { searchDocs, refundOrder },
run: async ({ messages, tools, signal, streamText }) =>
streamText({
model: anthropic("claude-sonnet-4-5"),
system:
"You are a support agent. Answer questions from the docs, and refund orders when a customer asks.",
messages,
tools,
abortSignal: signal,
}),
});

Related integrations

Ready to put your agent in Slack?

Declare an endpoint, run trigger dev, and paste the URL into your app's settings.

Get started for free