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

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message`, the default import of the v7 Node SDK. Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Automation Audience Trigger

> Start an automation for every member of an audience when it changes.

## How it works

The Audience trigger starts an automation run for each user who enters or leaves a [dynamic audience](/docs/recipients/lists-and-audiences/audiences). When a user's profile changes and they newly satisfy (or no longer satisfy) the audience rules, Courier fires an individual automation run for that user.

This is useful for workflows that react to profile changes, such as:

* Sending a welcome sequence when a user upgrades to a premium tier
* Triggering a win-back flow when a user becomes inactive
* Notifying an account manager when a high-value customer changes status

## Configuration

<Frame caption="Audience trigger configuration">
  <img src="https://mintcdn.com/courier-4f1f25dc/vtbfWgZJXtOFtHNn/assets/platform/automations/audience-trigger.png?fit=max&auto=format&n=vtbfWgZJXtOFtHNn&q=85&s=12585f2a26475b1ee85529f55da1c036" alt="Audience trigger configuration showing Source, Type, and Audience fields" width="1300" height="836" data-path="assets/platform/automations/audience-trigger.png" />
</Frame>

1. Open the Automation Designer and select **Audience** as the trigger source.
2. Choose the event type:
   * **Match** fires when a user enters the audience.
   * **Unmatch** fires when a user leaves the audience.
3. Choose your audience from the dropdown.

Each time the event fires, Courier creates a separate automation run for that user.

## Run Context

When an audience trigger fires, the automation run context contains **only the user's ID** as the recipient. Stored profile fields (email, phone, custom attributes) and data are **not** automatically loaded.

| Context field | Value                                 |
| ------------- | ------------------------------------- |
| `recipient`   | The user ID that matched or unmatched |
| `profile`     | Empty                                 |
| `data`        | Empty                                 |

This differs from API-invoked and Segment-triggered automations, which pre-load profile data before the first step runs.

### Loading Profile Data

If your workflow uses profile fields (for example, in [If/Switch conditions](/docs/journeys/automations/control-flow) or template personalization), add a [GET Profile](/docs/journeys/automations/get-profile) step early in your workflow, before any step that reads profile data. The GET Profile step fetches the user's stored Courier profile and merges it into the run context.

<div style={{ display: "flex", justifyContent: "center", margin: "32px 0" }}>
  **Audience Trigger** → **[GET Profile](/docs/journeys/automations/get-profile)** → **[If/Switch](/docs/journeys/automations/control-flow)** (profile condition) → **Send**
</div>

Without the GET Profile step, profile-based conditions will evaluate against an empty object and always fall through to the default branch.

## Audience Membership Timing

Audience triggers depend on Courier's [pre-computed membership model](/docs/recipients/lists-and-audiences/audiences#how-it-works). A trigger fires when membership changes, not on a fixed schedule. Keep in mind:

* **Profile updates drive membership.** A trigger fires only when a profile change causes a user to enter or leave the audience.
* **Rule changes trigger rebuilds.** If you update an audience's filter rules, Courier rebuilds the membership list. This can take several minutes for large audiences, and triggers may fire as members are re-evaluated.
* **Each match is a separate run.** If you update audience rules and many users match at once, each user gets their own automation run.
