> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Sequences

> List, create, view, and manage automated follow-up sequence templates — enrollment counts, completion rates, step builder, and analytics.

The Sequences page at `/ce/sequences` lists all automated follow-up sequence templates for the organization, showing each sequence's active status, enrollment count, and completion rate.

## Overview

Navigating to `/ce/sequences` loads `SequencesPage`, gated by `ce.sequences.view`. The page shows a table of sequences with columns: Name (link to detail page), Status, Enrolled count, and Completion percentage. The **Create Sequence** button (visible with `ce.sequences.create`) navigates to `/ce/sequences/new`. An empty state with a create action is shown when no sequences exist.

## Who it's for

Permission required: `ce.sequences.view`. Creating sequences requires `ce.sequences.create`.

## Before you start

* An organization context must be selected.
* Sequences must be created before they can be enrolled to leads.

## Steps

<Steps>
  <Step title="Open Sequences">
    Navigate to `/ce/sequences` from the CE sidebar.
  </Step>

  <Step title="Review sequence list">
    The table shows each sequence's name, active/inactive status, number of enrolled leads, and completion percentage.
  </Step>

  <Step title="Open a sequence">
    Click the sequence name link to navigate to its detail page at `/ce/sequences/{id}`.
  </Step>

  <Step title="Create a sequence">
    Click **Create Sequence** (requires `ce.sequences.create`) to navigate to `/ce/sequences/new` where you define a new sequence. Alternatively, use the Sequence Wizard at `/ce/sequences/wizard` for a guided experience.
  </Step>
</Steps>

## Key concepts

* **Completion percentage** — Calculated as `total_completed / total_enrolled × 100`, rounded to the nearest whole number.
* **Active / Inactive** — Shown in the Status column; inactive sequences do not enroll new leads.

## Creating a sequence

The New Sequence screen renders the `SequenceDetailPage` component in create mode. It is accessible at `/ce/sequences/new`. Required permission: `ce.sequences.create` (route-level gate).

In create mode, the screen renders a `SequenceForm` with fields for: name, description, business hours only toggle, auto-enroll toggle, enrollment criteria (JSON), exit on reply, exit on call, and exit on conversion. After submitting, `createSequence` is called and on success the user is navigated to `/ce/sequences/:id` for the new sequence. The sequence is created with `is_active: true` by default. If `enrollment_criteria` cannot be parsed as valid JSON, a toast error is shown and submission is blocked.

The full wizard-based alternative for sequence creation is available at `/ce/sequences/wizard` (requires `ce.admin`).

**Before you start:** You need the `ce.sequences.create` permission. Your organization must be active. If using enrollment criteria, prepare valid JSON before submitting.

**Steps to create a sequence:**

1. Navigate to `/ce/sequences/new` from the Sequences list or click Create Sequence.
2. Enter sequence name and description — provide a descriptive name and optional description for the sequence.
3. Configure behavior settings — toggle business hours only, auto-enroll, exit on reply, exit on call, and exit on conversion as appropriate.
4. Set enrollment criteria (optional) — enter valid JSON in the enrollment criteria field if automatic enrollment rules are needed.
5. Submit — click the submit button. On success you are navigated to the new sequence's detail page to add steps.

**Enrollment criteria** — JSON-based rules that determine which leads are automatically enrolled; must be valid JSON.

**Auto-enroll** — when enabled, leads matching enrollment criteria are enrolled without manual action.

**Exit conditions** — `exit_on_reply`, `exit_on_call`, `exit_on_conversion` determine when a lead is automatically removed from the sequence.

## Viewing a sequence

The Sequence Details page at `/ce/sequences/:id` is the full management interface for a single automated follow-up sequence, providing tabs for steps, enrollments, analytics, and settings. The route is gated by `ce.sequences.view`.

Navigating to `/ce/sequences/:id` loads `SequenceDetailPage`. For existing sequences, the page shows the sequence name, active/inactive badge, and a tab set: **Steps**, **Enrollments**, **Analytics**, and **Settings**. Header actions include Activate/Deactivate (requires `ce.sequences.edit`), Clone (requires `ce.sequences.create`), and Delete (requires `ce.sequences.delete`).

**Steps to work a sequence detail:**

1. From the Sequences list (`/ce/sequences`), click a sequence name link to navigate to `/ce/sequences/{id}`.
2. Edit the sequence form (Steps tab) — in the **Steps** tab, update the sequence name, description, business-hours-only flag, auto-enroll setting, enrollment criteria (JSON), and exit conditions. Save with the form's submit action.
3. Manage sequence steps — use the `SequenceStepBuilder` in the **Steps** tab to add, edit, reorder, or delete individual steps in the sequence.
4. Review enrollments — switch to the **Enrollments** tab to see leads currently enrolled in this sequence and their enrollment status.
5. Analyze performance — switch to the **Analytics** tab to view enrollment and completion metrics via `SequenceAnalyticsTab`.
6. Configure settings — switch to the **Settings** tab for organization-level sequence configuration via `SequenceSettingsTab`.
7. Activate, deactivate, clone, or delete — use the header action buttons to change the sequence's active state, clone it to a new sequence, or permanently delete it.

**Active / Inactive** — Only active sequences enroll new leads. Toggling deactivates without deleting.

**Business hours only** — When enabled, step sends are gated to business hours only.

## Related

<Columns cols={2}>
  <Card title="Community Engagement" icon="bullhorn" href="/ce/overview">
    Community Engagement core overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index" />
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/ce.tsx
  * src/cores/ce/pages/SequencesPage.tsx
  * src/cores/ce/pages/SequenceDetailPage.tsx
  * src/cores/ce/hooks/useSequenceList.ts
  * src/cores/ce/hooks/useEnrollmentList.ts
  * src/cores/ce/hooks/useSequenceDetail.ts
  * src/cores/ce/hooks/useSequenceMutation.ts
  * src/cores/ce/components/sequences/SequenceStepBuilder.tsx
</Accordion>
