---
title: Composio notifier
description: Route notifications through the Composio toolkit — Slack, Discord, or Gmail.
---

<div style={{ display: "flex", alignItems: "center", gap: "0.75rem", margin: "0.5rem 0 1.25rem" }}>
  <Logo name="composio" size={28} />
  <span style={{ fontSize: "0.8125rem", color: "var(--color-fd-muted-foreground)" }}>
    Slot: <code>notifier</code> · Name: <code>composio</code>
  </span>
</div>

<PlatformSupport macos="full" linux="full" windows="full" />

Uses the [Composio toolkit](https://composio.dev) to deliver notifications. Handy when you already have Composio set up for other agent tooling — a single credential covers Slack, Discord, and Gmail. Discord supports a low-friction webhook mode and an advanced bot mode.

## Setup

Run the interactive Composio setup hub:

```bash
ao setup composio
```

The hub lets you choose Slack, Discord webhook, Discord bot, or Gmail. AO asks for the Composio API key, `userId`, required target details, which notification priorities the notifier should receive, then reviews the config before writing. When you run `ao setup composio`, the selected app is written to the canonical `notifiers.composio` target. You can skip the app picker with `--slack`, `--discord-webhook`, `--discord-bot`, or `--gmail`. Discord webhook mode does not need a Composio connected account; Discord bot mode uses a bot token once to create a connected account and stores only the resulting `connectedAccountId`. Gmail mode uses an existing Gmail connected account, or creates a Composio connect link from an existing Gmail auth config.

Dedicated commands use the same guided setup but write app-specific targets:

```bash
ao setup composio-slack        # writes notifiers.composio-slack
ao setup composio-discord      # writes notifiers.composio-discord
ao setup composio-discord-bot  # writes notifiers.composio-discord-bot
ao setup composio-mail         # writes notifiers.composio-mail
```

You can also run the scriptable Slack setup directly:

```bash
export COMPOSIO_API_KEY=ak_...
ao setup composio-slack --user-id aoagent --channel "#agents" --non-interactive
```

All Composio setup commands accept `--routing-preset urgent-only`,
`--routing-preset urgent-action`, or `--routing-preset all`.

If you already know the Slack connected account id, pass it directly:

```bash
ao setup composio-slack --connected-account-id ca_... --non-interactive
```

Run the Discord webhook setup when you only need channel notifications:

```bash
export COMPOSIO_API_KEY=ak_...
ao setup composio-discord --webhook-url "https://discord.com/api/webhooks/..." --non-interactive
```

Run the Discord bot setup when you need a bot identity and channel-id based delivery:

```bash
export COMPOSIO_API_KEY=ak_...
ao setup composio-discord-bot --channel-id "1234567890" --bot-token "$DISCORD_BOT_TOKEN" --non-interactive
```

The bot token is used once to create a Composio connected account. AO writes only the resulting `connectedAccountId`.

Run the Gmail setup when you want AO notifications by email:

```bash
export COMPOSIO_API_KEY=ak_...
ao setup composio-mail --email-to alerts@example.com --non-interactive
```

Connect Gmail in Composio first, or choose Gmail in `ao setup composio` and generate a connect link from an existing Gmail auth config. AO does not create Gmail OAuth/auth configs. The setup command finds an active Gmail connected account for the configured `userId` and writes its `connectedAccountId`. If multiple Gmail accounts are available, pass the one AO should use:

```bash
ao setup composio-mail --email-to alerts@example.com --connected-account-id ca_...
```

You can also ask AO to print a Composio Gmail connect URL:

```bash
ao setup composio-mail --email-to alerts@example.com --connect
```

AO uses an existing Composio Gmail auth config for that link. If you need a specific custom Gmail auth config, pass it explicitly:

```bash
ao setup composio-mail --email-to alerts@example.com --connect --auth-config-id ac_...
```

If Google blocks a Gmail connection, fix the Gmail auth config in Composio, then rerun `ao setup composio-mail`.

## Use

```yaml title="agent-orchestrator.yaml"
notifiers:
  composio:
    plugin: composio
    defaultApp: slack # slack | discord | gmail
    userId: aoagent # Composio user id
    connectedAccountId: ca_... # preferred when available
    channelName: "#agents" # Slack
    emailTo: alerts@example.com # required when defaultApp=gmail
    composioApiKey: ak_... # optional override; otherwise uses env

  composio-discord:
    plugin: composio
    defaultApp: discord
    mode: webhook
    webhookUrl: https://discord.com/api/webhooks/...
    userId: aoagent

  composio-discord-bot:
    plugin: composio
    defaultApp: discord
    mode: bot
    channelId: "1234567890"
    userId: aoagent
    connectedAccountId: ca_...

  composio-mail:
    plugin: composio
    defaultApp: gmail
    emailTo: alerts@example.com
    userId: aoagent
    connectedAccountId: ca_...

  composio-slack:
    plugin: composio
    defaultApp: slack
    userId: aoagent
    connectedAccountId: ca_...
    channelName: "#agents"
```

## Config

| Key                  | Required        | Default                | What it does                                                         |
| -------------------- | --------------- | ---------------------- | -------------------------------------------------------------------- |
| `defaultApp`         | ✓               | `slack`                | Which Composio app to target: `slack`, `discord`, or `gmail`         |
| `mode`               | Discord only    | auto                   | `webhook` uses Discord webhooks; `bot` uses bot channel messages     |
| `userId`             | optional        | `aoagent`              | Composio user id for connected-account lookup                        |
| `entityId`           | optional        | —                      | Backward-compatible alias for `userId`                               |
| `authConfigId`       | setup only      | —                      | Existing Composio Gmail auth config used by `--connect`              |
| `connectedAccountId` | Slack/Gmail/bot | —                      | Specific connected account to use; not used for Discord webhook mode |
| `channelName`        | for Slack       | —                      | Slack channel name                                                   |
| `channelId`          | Discord bot     | —                      | Discord channel id for bot mode                                      |
| `webhookUrl`         | Discord webhook | —                      | Discord webhook URL for webhook mode                                 |
| `emailTo`            | ✓ when `gmail`  | —                      | Recipient address                                                    |
| `composioApiKey`     | optional        | env `COMPOSIO_API_KEY` | Override the API key from config                                     |
| `toolVersion`        | optional        | app default            | Tool version passed to `@composio/core`                              |
| `toolVersions`       | optional        | —                      | App-specific tool versions, for example `{ slack: "20260508_00" }`   |

Slack defaults to `20260508_00`; Discord defaults to `20260429_01`; Gmail defaults to `20260506_01`. Discord uses Composio's `discordbot` toolkit for both webhook and bot modes. Webhook mode calls `DISCORDBOT_EXECUTE_WEBHOOK` with the Discord webhook id/token from `webhookUrl`, so no Composio Discord connect link is required.
If `mode` is omitted for Discord, AO uses `webhook` when `webhookUrl` is present and `bot` otherwise.

## When to use

- Your org already has Composio set up.
- You want to route notifications to Gmail as a fallback for people who don't live in Slack/Discord.
- You'd rather manage one Composio credential than three webhook URLs.
