---
name: journeys
description: Use when designing, editing, duplicating or publishing a notification.dev journey. Covers the graph format, every node type, the validation rules publishing enforces, and the draft-to-active lifecycle.
---

# Journeys

A journey is an automated flow: a trigger starts it for a subscriber, then
waits, branches and pushes run in order until an end node. Read
`notification-platform` first.

## Tools

| Tool                          | Permission                            | Arguments                                                          |
| ----------------------------- | ------------------------------------- | ------------------------------------------------------------------ |
| `list_journeys`               | `journeys:read`                       | `projectId`, optional `status` (`draft,active,archived`), `cursor` |
| `get_journey`                 | `journeys:read`                       | `projectId`, `journeyId`                                           |
| `get_journey_delivery_report` | `reports:read`                        | `projectId`, `journeyId`                                           |
| `create_journey_draft`        | `journeys:write`                      | `projectId`, `input: { name, graph }`                              |
| `update_journey_draft`        | `journeys:write`                      | `projectId`, `journeyId`, partial `input` (draft only)             |
| `duplicate_journey`           | `journeys:write`                      | `projectId`, `journeyId`                                           |
| `publish_journey`             | `journeys:write` + `journeys:publish` | `projectId`, `journeyId`                                           |

## Server events

App backends can POST `/v1/projects/{projectId}/events` with `events:write`,
addressing an existing user by `externalUserId` or `subscriberId`. MCP exposes
`ingest_event` with the same fields plus `projectId`. Stable `eventId` values
prevent duplicate trigger occurrences on retries. Events can start published
journeys and wake event waits. Read `transactional-push` for authentication,
provisioning server keys, and complete request examples.

Journey push nodes use saved content: event properties are stored but do not
personalize text or destinations. For an order-specific message, have the backend
supply finished content through the direct-send API. Sending directly and
triggering a journey for the same action can produce two notifications.

## Graph format

```json
{
  "nodes": [
    { "id": "start", "type": "event_trigger", "eventName": "signup_completed" },
    { "id": "wait", "type": "delay", "seconds": 86400 },
    {
      "id": "check",
      "type": "branch",
      "condition": {
        "kind": "comparison",
        "field": { "source": "tag", "key": "onboarded" },
        "operator": "eq",
        "value": true
      }
    },
    {
      "id": "nudge",
      "type": "push",
      "message": {
        "title": "Finish setting up",
        "body": "Two steps left to unlock everything."
      }
    },
    { "id": "done", "type": "end" }
  ],
  "edges": [
    { "source": "start", "target": "wait" },
    { "source": "wait", "target": "check" },
    { "source": "check", "target": "done", "outcome": "yes" },
    { "source": "check", "target": "nudge", "outcome": "no" },
    { "source": "nudge", "target": "done" }
  ]
}
```

Node `id` values are free-form strings, unique within the graph. Each node may
carry an optional `position: { x, y }` for the dashboard canvas. Limits: 1 to
500 nodes, up to 500 edges.

## Node types

For images or sender avatars in a `push` node's `message`, read `push-images`
(`skill://push-images/SKILL.md`). Its examples use the same message shape as
campaigns and direct sends, including native SDK prerequisites.

| `type`            | Fields                                                                  | Meaning                                                 |
| ----------------- | ----------------------------------------------------------------------- | ------------------------------------------------------- |
| `event_trigger`   | `eventName`                                                             | Starts when the app sends this event for a subscriber.  |
| `segment_trigger` | `segmentId`                                                             | Starts when a subscriber enters the segment.            |
| `delay`           | `seconds` (≥ 1)                                                         | Waits a fixed duration.                                 |
| `wait_until`      | `time` as `HH:MM` (24h), optional `cancelOnAppOpen`                     | Waits for recipient-local time; can cancel on app open. |
| `wait_for_event`  | `eventName`, `seconds` (1 to 315360000)                                 | Waits for the event; two exits: `event` and `timeout`.  |
| `branch`          | `condition` (segment expression)                                        | Evaluates the subscriber; two exits: `yes` and `no`.    |
| `push`            | `message` (`title`, `body`, optional `data`, `deepLink` or `placement`) | Sends a push.                                           |
| `end`             | none                                                                    | Terminates the path.                                    |

The `condition` of a branch uses the same expression grammar as segments. See
the `audience-segments` skill. A push `placement` is `{ versionId, parameters }`
from `list_placements`; see notification-platform.

For a reminder after two days of inactivity at the next 10:00 local time, use a
two-day `wait_for_event` for `notification_dev.app_opened`. Route `event` to End
and `timeout` to `{ "type": "wait_until", "time": "10:00", "cancelOnAppOpen": true }`,
then to Push. This prevents an app open during either wait from sending the
reminder. Updated SDKs emit app opens automatically.

Use `get_journey_delivery_report` for a retained journey-wide snapshot without
opening executions one by one. It separates current provider-accepted delivery
outcomes from SDK-reported tap/receipt events and groups terminal execution skip
codes such as `NO_ELIGIBLE_INSTALLATIONS`, both in total and by push node.

## Validation rules

Drafts may be incomplete, but `publish_journey` rejects a graph unless all of
these hold. Check them yourself before publishing.

- Exactly one trigger node, and it has no incoming edges.
- Every edge references existing node ids.
- No joins: a node has at most one incoming edge.
- `branch` has exactly two outgoing edges with outcomes `yes` and `no`.
- `wait_for_event` has exactly two outgoing edges with outcomes `event` and `timeout`.
- Other nodes have at most one outgoing edge and no `outcome`.
- `end` has no outgoing edges; every path reaches an `end`.
- No cycles.
- Referenced segments exist in the same project.

## Lifecycle

`draft` → `active` (after publishing) → `archived`.

- Only drafts can be edited with `update_journey_draft`.
- Publishing permanently locks the name and the graph.
- To change an active journey: `duplicate_journey` creates an independent draft
  with no execution history, edit that draft, then publish it. Tell the user the
  original stays active until they archive it in the dashboard.

## Workflow

1. Ask what should start the journey, what it should send and when it should
   stop. Confirm event names and segment ids exist (events come from the app;
   segments via `list_segments`).
2. Build the graph, validate it against the rules above, and
   `create_journey_draft`.
3. Describe the flow back to the user in plain steps and stop. Publish only when
   explicitly asked, because publishing starts real sends and locks the graph.
