# Sequence nodes: every node type and its exits (https://docs.opensequence.dev/docs/concepts/sequence/nodes)

Every sequence node type with its params and transitions, one example each, and which node types count as touches.

A node is one step of a sequence. Each node lists where to go next for each outcome, in `next`.

| `type` | Params | Transitions | Runs |
|---|---|---|---|
| `start` | none | `then` (required) | inline |
| `outreach` `email` `send` | `subject`, `body`, `format` (`text` or `html`), `reply_in_thread`, `name` | `sent`, `skipped`, `failed` | queue `seq_email` |
| `outreach` `sms` `send` | `body`, `name` | `sent`, `skipped`, `failed` | queue `seq_sms` |
| `outreach` `call` `agent_call` | `agent_id`, `title`, `description`, `skills`, `give_up_after`, `exit_on_connect`, `name` | `completed`, `reached`, `transferred`, `not_interested`, `wrong_number`, `do_not_call`, `not_reached`, `skipped`, `failed` | queue `seq_call`, then waits |
| `wait` | `duration` | `then` (required) | inline timer |
| `wait_for` | `events[]`, `timeout` | one per event, `timeout` | timer and signal |
| `condition` | `mode`, `rules[]` | `yes`, `no` (both required) | inline |
| `task` | `kind`, `title`, `body`, `link`, `due`, `expire`, `connected_outcomes`, `dialer`, `auto_complete` | `completed`, `no_answer`, plus `branches_by_outcome` | inline, then waits |
| `end` | `label` | none | inline |

Exact schemas, defaults and limits are generated from the registries: [Nodes and channels](/reference/nodes). An unwired transition that is taken ends the enrollment as `completed`.

## `start` [#start]

Optional. A no-op that makes the entry obvious on a canvas.

```json
"start": { "type": "start", "next": { "then": "email_intro" } }
```

## `outreach` email [#outreach-email]

```json
"email_intro": {
  "type": "outreach", "channel": "email", "action": "send",
  "params": {
    "name": "Intro",
    "subject": "Quick question, {{ contact.first_name | \"there\" }}",
    "body": "<p>Hi {{ contact.first_name | \"there\" }},</p><p>…</p><p><a href=\"{{ unsubscribe_url }}\">Unsubscribe</a></p>",
    "format": "html",
    "reply_in_thread": false
  },
  "next": { "sent": "wait_2d", "skipped": "wait_2d", "failed": "end_failed" }
}
```

Sends from the sender's mailbox over SMTP with the service's own `Message-ID`. `format: "html"` sends the body as HTML with a text alternative and HTML-escapes every rendered value; `text` (default) sends plain text. `reply_in_thread: true` replies in the thread of the previous email of this enrollment (`In-Reply-To` and `References`), which is how a follow-up shows under the first message. A body without `{{ unsubscribe_url }}` publishes with the warning `NO_UNSUBSCRIBE`.

`sent` is taken after the provider accepted the message; `skipped` after a gate refused it (no email, suppressed, channel missing or not active, country, and so on; `skipped` falls back to `sent` when unwired); `failed` after the retries ran out (five reads of the queue message), and when `failed` is unwired the enrollment pauses with `step_failed`. Caps and windows **defer** rather than skip. Limits: subject 300, body 100,000 characters.

## `outreach` sms [#outreach-sms]

```json
"sms_follow": {
  "type": "outreach", "channel": "sms", "action": "send",
  "params": { "body": "Hi {{ contact.first_name | \"there\" }}, this is {{ sender.first_name }} from Acme. Did you see my email? Reply STOP to opt out." },
  "next": { "sent": "wait_1d", "skipped": "wait_1d" }
}
```

Gates that skip: `no_consent`, `no_phone`, `country_not_allowed`, `no_timezone`, `suppressed`, `no_sms_channel`; the quiet-hours gate (08:00 to 21:00 recipient-local) defers. Over 320 characters the validator warns (`TOO_LONG`, it is more than two segments); the hard limit is 1000. An unknown send outcome is never retried: the run goes `needs_review`.

## `outreach` call [#outreach-call]

```json
"confirm_call": {
  "type": "outreach", "channel": "call", "action": "agent_call",
  "params": {
    "agent_id": "agt-…",
    "title": "Confirm the demo with {{ contact.first_name | \"them\" }}",
    "description": "Ask if Friday 10am still works. If not, offer Monday."
  },
  "next": { "reached": "end_confirmed", "not_reached": "sms_follow", "completed": "end_done" }
}
```

An Allo Outbound agent phones the contact. The step waits for the result and follows the outcome's transition; an outcome with no transition follows `completed`. `not_reached` is also taken when `give_up_after` (default `3d`) passes. The call goes out from the sender's Allo number; `allo_number` fixes another line. Gates that skip: `no_consent`, `no_phone`, `suppressed`, `no_allo_number`. `skipped` falls back to `completed` when unwired. A call that reaches the contact exits a sequence that lists `reply` in `exit_on`, unless the step sets `exit_on_connect: false`. See [Allo agent calls](/docs/modules/calls/allo).

## `wait` [#wait]

```json
"wait_2d": { "type": "wait", "params": { "duration": "2bd" }, "next": { "then": "check_stage" } }
```

A timer. `bd` counts business days in the contact's zone (the sender's when the contact has none), ending at the same time of day; the next outreach step is then pushed into the send window.

## `wait_for` [#wait_for]

```json
"wait_reply": {
  "type": "wait_for",
  "params": { "events": ["reply:email", "meeting_booked"], "timeout": "5bd" },
  "next": { "reply:email": "end_replied", "meeting_booked": "end_booked", "timeout": "call_1" }
}
```

The only event wait. Events: `reply`, `reply:email`, `reply:sms`, `call_connected`, `meeting_booked`. Each waited event needs a transition (`BAD_EVENT`); `timeout` is optional, and without one the enrollment waits forever (or until something exits it). A `reply` on any channel matches `reply` and `reply:<channel>`; a connected call matches `call_connected` and `reply`.

When an awaited event arrives, the enrollment moves on at once. When the timeout passes first, it takes `timeout`. An event that arrives while the enrollment is not waiting for it does not wake anything, but a reply still exits when `exit_on` lists `reply`.

## `condition` [#condition]

```json
"check_stage": {
  "type": "condition",
  "params": { "mode": "any", "rules": [
    { "field": "history.replied_since_enrollment", "op": "is_true" },
    { "field": "crm.deal.stage", "op": "is", "value": "Proposal" } ] },
  "next": { "yes": "end_done", "no": "sms_follow" }
}
```

`all` or `any` over 1 to 20 rules; `yes` and `no` both required. Evaluation is lazy (stops at the first decisive rule) and every value read is recorded on the run. Missing data never matches. Fields and operators: [Conditions](/docs/concepts/sequence/conditions).

## `task` [#task]

```json
"call_1": {
  "type": "task",
  "params": { "kind": "call", "title": "Call {{ contact.first_name | \"them\" }} about {{ attrs.company.name | \"their company\" }}", "body": "Last email: {{ sequence.name }}", "due": "1bd", "expire": "3bd", "dialer": true },
  "next": { "completed": "wait_3d", "no_answer": "email_2" },
  "branches_by_outcome": { "connected": "end_connected", "voicemail": "sms_follow" }
}
```

Creates a task for the sender and waits. Completing it with an outcome takes `branches_by_outcome[outcome]`, else `completed`. Expiry or cancellation takes `no_answer`.

| Param | Meaning |
|---|---|
| `kind` | Required. The task's type. `call` gets the Allo behaviour; any other kind, such as `manual`, is yours to render. LinkedIn has its own step, [`linkedin_connect`](#linkedin_connect). |
| `title`, `body`, `link` | Templates, rendered once when the task is created. |
| `due` | Required. A duration on the sender's calendar, like `2h` or `1bd`. |
| `expire` | When the task expires if nobody completes it. Default: seven days after `due`. |
| `connected_outcomes` | Outcomes that count as a reply. Default `["connected"]`. |
| `dialer` | Push the contact into the sender's Allo power dialer. Default `false`. |
| `auto_complete` | Let Allo's finished call complete a `call` task. Default `true`. |

Your app completes a task with `POST /v1/tasks/{id}/complete` and an `outcome`. A `call` task also completes by itself when the rep calls from Allo: see [Allo](/docs/modules/sms/allo#call-tasks). A task is not a touch.

## `linkedin_connect` [#linkedin_connect]

```json
"li_connect": {
  "type": "linkedin_connect",
  "params": { "note": "Hi {{ contact.first_name | \"there\" }}, happy to connect.", "expire": "5bd" },
  "next": { "completed": "wait_3d", "no_answer": "email_2", "skipped": "email_2" }
}
```

Creates a `linkedin_connect` task with the contact's profile as `link` and the rendered note as `body`, then waits. The task completes as `sent` when the sender opens it (`POST /v1/tasks/{id}/open`); expiry or cancellation takes `no_answer`; a contact without `linkedin_url` takes `skipped`. Notes are cut at 300 characters. Params and the one-click flow: [LinkedIn](/docs/modules/linkedin).

## `end` [#end]

```json
"end_connected": { "type": "end", "params": { "label": "Connected" } }
```

Ends the enrollment as `completed`. The label shows in the journey and in your canvas; several `end` nodes make the per-step analytics tell the paths apart.

## Which node types count as touches [#which-node-types-count-as-touches]

Only outreach steps (`email send`, `sms send`, `call agent_call`) are touches: they increment the enrollment's `touch_count`, set `last_touch_at` and are the denominators of the delivered rates. A task, LinkedIn requests included, is not a touch; a connected call is credited to the task's run as a reply. An agent call that reaches the contact is credited to its own run the same way.
