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

# Journeys

> Multi-step flows that run once per user when triggered, with sends, delays, and branches, and when to pick a journey over a single Send API call.

A journey is a graph of nodes that runs once per user when triggered.

![An onboarding journey on the canvas: an API Invoke trigger, a welcome email, a two-day delay, an AI node, then a branch whose two paths send and rejoin at Exit](https://mintcdn.com/courier-4f1f25dc/9rcgucLA9fBnJt_U/assets/journey-onboarding-canvas.webp?fit=max\&auto=format\&n=9rcgucLA9fBnJt_U\&q=85\&s=6a6f39c793bb144d382a54d954d65cd1)

You build it visually, publish it, and invoke it from your app or a Segment event. Courier runs the nodes in order, taking branches, waiting on delays, and sending messages until the run ends.

A journey combines the other pieces: a trigger that starts it, [nodes](https://www.courier.com/docs/journeys/nodes.md) that decide what happens between sends, and content written the way a [Template](https://www.courier.com/docs/design/templates/overview.md) is written. Each recipient is a [user](https://www.courier.com/docs/recipients/overview.md) whose profile the run reads once at invoke.

## Which one to use

Most notifications don't need a journey, and the difference is whether the messaging spans steps and time.

| | Send API | Journeys |
| - | - | - |
| Shape | Single call | Multi-step workflow |
| Timing | Immediate (or a delay parameter) | Built-in delays and scheduling |
| Logic | In your code | Built-in branching |
| Debugging | Message logs | Step-by-step run inspection |
| Best for | Transactional messages | Complex messaging experiences |

Use the [Send API](https://www.courier.com/docs/send/overview.md) when one call can say everything. Use a journey when the messaging unfolds over time, with branching, enrichment, or rate limiting between steps.

## How it works

### Trigger, then nodes

Every journey starts with a **trigger** that decides how users enter it:

* **API invoke**: your code calls the invoke endpoint.
* **Segment**: Courier starts the journey when a matching Segment event arrives.
* **Inbound webhook**: an external system posts an event to a Courier webhook URL.
* **Audience**: a user joins an audience.

Nodes then run in sequence: `send`, `delay`, `branch`, `fetch` (pull external data), `ai`, `throttle`, `batch`, `add-to-digest`, and `exit`, plus a Cancel node you add in the designer. A branch splits the flow into conditional paths. The run continues until every path reaches an end.

### A run works from a snapshot of its data

On invoke, Courier loads the recipient's profile once and stores the run's `{ data, profile }` as a snapshot. Every node reads from that snapshot. Editing a user's stored profile or an audience **after** the run starts doesn't re-evaluate the run or update its data. Nodes inside the journey can change a run's context mid-flight, such as a `fetch` node that pulls new data or an AI node that writes `data.ai_result`. Branch on data you pass at invoke or fetch during the run, not on edits made elsewhere.

### Delays

A `delay` node waits before continuing, in two modes:

* **Duration** (relative): wait a span, like 3 days.
* **Until** (absolute): wait for a timestamp, which can come from your data, like an `appointment_time` field.

Keep each delay to **90 days** or less, and chain delays for a longer total gap.

### Idempotency

Invoking is safe to retry. Send an `Idempotency-Key` header on the invoke request. For a repeated key, Courier returns the stored result instead of starting a second run, so a network retry doesn't double-send. Without the key, each invoke starts a new run.

### Canceling a run

To stop runs, cancel them. The cancel endpoint takes either a `cancelation_token` (set in the journey's settings and stamped on each run as it starts, cancels every run sharing it) or a single `run_id`. Only active runs are affected. A run that already finished, errored, or was canceled is left as-is. Inside a journey, a Cancel node cancels every active run sharing its token. See [Invoke a Journey](https://www.courier.com/docs/journeys/invoke.md).

## Journey Templates

A send node's content is a **Journey Template**: created inline in the send node, scoped to that Journey, and versioned with it. They are separate from the workspace [Templates](https://www.courier.com/docs/design/templates/overview.md) used with the Send API. You can't reference one from a regular send, or import an existing Template into a Journey.

Journey Templates reference the Journey's data with double-brace syntax:

* `{{order_id}}` for a trigger schema field
* `{{first_name}}` for a Profile field
* a field from an upstream fetch node

Publishing the Journey doesn't publish its Templates. A run sends each Template's published version, so publish each Template, then publish the Journey. Editing a Template after publishing creates a new draft that needs its own publish to take effect.

## FAQ

> [accordion] What is the difference between Journeys and Automations?
>
> Journeys is the current v3 surface (visual editor, data contracts, run inspection) on the same engine as the older Automations product. Automations are superseded. Build new workflows as journeys.
