<!--
Sitemap:
- [Installation](/installation)
- [Upgrading](/upgrading): Version-specific steps for upgrading an existing Bento install.
- [Concepts](/concepts)
- [Build your first pipeline](/tutorials/pipeline-args)
- [Target a specific issue or PR from a URL](/tutorials/url-targeting)
- [Keep state across runs](/tutorials/pipeline-state)
- [Fire a pipeline on a schedule or on demand](/tutorials/schedule-and-fire)
- [Configuration](/configuration)
- [Knowledge Base](/knowledge-base/)
- [Method & delivery](/knowledge-base/modes)
- [Config](/knowledge-base/config)
- [MCP](/knowledge-base/mcp)
- [Pipeline configuration reference](/pipelines/config)
- [Filters](/pipelines/filters)
- [Triggers](/triggers/)
- [GitHub Trigger](/triggers/github)
- [Linear Trigger](/triggers/linear)
- [Webhook](/triggers/webhook)
- [Schedule Trigger](/triggers/schedule)
- [Manual Trigger](/triggers/manual)
- [Traces](/pipelines/traces)
- [Slack](/integrations/slack)
- [Public Access](/public-access)
- [Context Engineering](/context-engineering)
- [Best Practices](/best-practices)
- [Troubleshooting](/troubleshooting)
- [Architecture](/architecture/vision)
- [Workspaces](/workspaces)
- [Authentication](/authentication)
- [Identity](/identity)
- [Security](/security)
- [References](/references)
- [Changelog](/changelog): Bento release history.
- [CLI Reference](/cli/)
- [Setup](/cli/setup)
- [Lifecycle](/cli/lifecycle)
- [Sandbox Image](/cli/image)
- [Observability](/cli/observability)
- [Diagnostics](/cli/diagnostics)
- [Triggers](/cli/triggers)
- [Workbench](/cli/workbench)
- [Auth](/cli/auth)
- [Knowledge](/cli/knowledge)
- [Bento](/index)
- [Runtime Wrapper](/architecture/runtime-wrapper)
- [Skill Evolve](/architecture/skill-evolve)
-->

# Slack

Post a pipeline's output to Slack. The daemon calls the Slack Web API
(`chat.postMessage`). Bots are named in config; a pipeline posts by naming one
in `output.slack`, so different pipelines can post as different Slack identities.

Outbound only — the daemon posts, it does not yet receive Slack messages.

## Setup

1. Create a Slack app at [api.slack.com/apps](https://api.slack.com/apps) → **From scratch**, and select your workspace.
2. Under **OAuth & Permissions → Scopes → Bot Token Scopes**, add `chat:write`. Add `im:write` too if you want to DM users (a `U…` target), and `chat:write.public` to post to public channels without inviting the bot.
3. **Install to Workspace** and copy the **Bot User OAuth Token** (`xoxb-…`).
4. Invite the bot to each target channel: `/invite @your-app`. Private channels always require this; public channels do too unless the bot has `chat:write.public`.

## Configuration

Name each bot under `channels.slack.bots`. The key is the name pipelines
reference; `token` is the bot's `xoxb-…` token (use `${VAR}` to read it from
the environment). Add as many bots as you have Slack app identities.

```yaml
channels:
  slack:
    bots:
      teamBot: { token: ${TEAMBOT_TOKEN} }
      alertBot:  { token: ${ALERTBOT_TOKEN} }
```

A pipeline that names a bot with no matching token logs an error and posts
nothing.

## Usage

Set `output.slack` on a pipeline, naming the `bot` to post as and the
`channel` to post to:

```yaml
deploy-notify:
  trigger:
    github:
      - deployment_status
    filter:
      when:
        deployment_status.state: success
  agent: notifier
  instructions: |
    Announce deployment of {{event.deployment.ref}} to {{event.deployment.environment}}.
  output:
    slack:
      bot: teamBot
      channel: "#deploys"
```

## Channel

The `channel` value selects where the named bot posts:

| Value | Posts to |
|---|---|
| `"#deploys"` | The named public channel. |
| `"C0123456789"` | A channel by id (public or private the bot is in). |
| `"U0123456789"` | A direct message to that user (needs the `im:write` scope). |

## See also

* [Pipeline config — `output`](/pipelines/config) — all post-back destinations.
