> ## 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.
> 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 the run data, with a default path.

export const AppLink = ({href, children, name, bare}) => {
  const label = children || name || "Open in Courier";
  if (bare) {
    return <a href={href} target="_blank" rel="noreferrer">{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="app" href={href} target="_blank" rel="noreferrer">
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method" aria-hidden="true">↗</span>
    </a>;
};

export const Doc = ({href, children, name, bare}) => {
  const label = children || name || href;
  if (bare) {
    return <a href={href}>{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="doc" href={href}>
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method">DOC</span>
    </a>;
};

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.

<Frame caption="A branch node on the canvas with a conditional path and a Default path">
  <img src="https://mintcdn.com/courier-4f1f25dc/LdpdyPjJHKHJqFY9/assets/branch-node-canvas.webp?fit=max&auto=format&n=LdpdyPjJHKHJqFY9&q=85&s=621e9788a0c4ce13fafb489623ff6e11" width="3454" height="1820" data-path="assets/branch-node-canvas.webp" />
</Frame>

## 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

<Frame caption="Branch configuration panel showing condition groups with field, operator, and value selectors">
  <img src="https://mintcdn.com/courier-4f1f25dc/LdpdyPjJHKHJqFY9/assets/branch-config-panel.webp?fit=max&auto=format&n=LdpdyPjJHKHJqFY9&q=85&s=cd6111a6848bae3fdbf3e3fcedabd272" width="1530" height="1152" data-path="assets/branch-config-panel.webp" />
</Frame>

## 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 <Doc href="/docs/monitor/journey-metrics">Run Inspection</Doc> and click the branch node. The step context shows every condition evaluated, the actual values compared, and the path selected.
