> ## 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` from the Node SDK (`@trycourier/courier` v7 and later, where the client is the default import). 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.
> To translate a template, write one locale at a time with `PUT /notifications/{id}/locales/{localeId}`, which merges into the existing translations. `PUT /notifications/{id}/content` and `PUT /notifications/{id}/elements/{elementId}` overwrite translations along with the content, so send each element's `id` and `locales` back, and first remove every `checksum` and any `locales` key that starts with an underscore.
> 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.

# Journey branch node

> Split a journey into paths by conditions on data, profile, tenant, or an earlier send's status. The run takes the first matching path, or the default.

Branch nodes split the journey into paths. Each path has a set of conditions. The run follows the first path whose conditions all match. If none match, it follows the **Default** path, always present as a fallback.

![An Order Confirmation journey where a Branch node sends first orders to a Delay and everything else to Exit, with the Branch panel open](https://mintcdn.com/courier-4f1f25dc/LdpdyPjJHKHJqFY9/assets/branch-node-canvas.webp?fit=max\&auto=format\&n=LdpdyPjJHKHJqFY9\&q=85\&s=621e9788a0c4ce13fafb489623ff6e11)

A branch node on the canvas with a conditional path and a Default path

## Configuring conditions

Click the branch node to open the condition editor. Each path takes one or more conditions, and each condition has three parts:

* **Field**: a value from the journey context (trigger schema, profile, or fetch response)
* **Operator**: the comparison
* **Value**: what to compare against

Every field starts with one of these roots:

| Root | Reads |
| :- | :- |
| `data.` | The trigger payload, plus anything an upstream fetch or AI node added |
| `profile.` | The recipient's profile |
| `tenant.` | The run's tenant. Only when the trigger sets one |
| `send_status.<nodeId>` | The delivery status of an earlier send node's message, compared with **was** or **was not** |

A `tenant.` field reads the tenant the trigger sets with `tenant_id`. Set it to a literal tenant ID, or to a single reference with nothing around it, such as `{{data.tenant_id}}`:

```json theme={null}
{
  "type": "trigger",
  "trigger_type": "api-invoke",
  "tenant_id": "{{data.tenant_id}}"
}
```

**Write the root on every field.** No `user.` root exists, so read a profile field as `profile.tier`, not `user.tier`. Creating or replacing a journey through the API checks every condition, on branch paths and on any node's own conditions:

| Message | Cause |
| :- | :- |
| `Condition path "user.tier" must start with data., profile., tenant., or send_status.` | The field has no valid root |
| `Condition path "data.items.#.sku": array wildcards aren't supported` | The field uses `#` to match any array index |
| `Condition path "send_status.<nodeId>" only supports the "was" and "was not" operators` | A `send_status` field uses any other operator |
| `Condition path "tenant.plan" uses tenant., but this journey's trigger doesn't set a tenant` | A `tenant.` field in a journey whose trigger sets no `tenant_id` |

**On an `api-invoke` trigger, declare every `data.` field a condition reads in its `schema`.** Runs match undeclared fields, but the journey designer flags them (`does not exist in trigger schema`) and won't publish until they're declared, including fields a fetch node adds.

![The Branch panel: an Is First Order path with data.is\_first\_order is equal true, and an Else Default path that exits the journey](https://mintcdn.com/courier-4f1f25dc/LdpdyPjJHKHJqFY9/assets/branch-config-panel.webp?fit=max\&auto=format\&n=LdpdyPjJHKHJqFY9\&q=85\&s=cd6111a6848bae3fdbf3e3fcedabd272)

Branch configuration panel showing condition groups with field, operator, and value selectors

## Multiple conditions per path

A path supports both AND and OR logic. Click **+ add** inside a condition group to add another condition. All conditions in the same group must be true (AND). Click **+ or** at the bottom to add a separate group. The path executes if any group is satisfied (OR).

For example, route to a VIP path for a first-time buyer with a high-value order, *or* a returning buyer who has spent more:

* **Group 1**: `data.is_first_order` is equal `true` AND `data.order_total` greater than `50`
* **Group 2**: `data.is_first_order` is equal `false` AND `data.order_total` greater than `200`

Click the path name in the condition editor to rename it. Defaults are "Path 1", "Path 2", and so on. The name updates on the canvas label, so "First Order" reads better than "Path 1".

## Common patterns

**Tiered notifications**: Branch on a numeric field (e.g., `data.priority`) to send urgent messages via SMS and lower-priority messages via email.

**Feature gating**: Branch on a boolean field (e.g., `data.is_premium`) to send premium users richer content.

**Fallback handling**: Use the Default path to catch unexpected values and send a generic message or skip sending entirely.

## Debugging branch decisions

When a branch takes an unexpected path, open the run in [journey logs](https://www.courier.com/docs/monitor/logs.md#read-a-run) and click the branch node. The step context shows every condition evaluated, the actual values compared, and the path selected.
