Pipelines & Stages
Pipelines define the structure of your sales process. Each pipeline contains an ordered set of stages that deals move through from initial contact to close.
Pipeline Landing Page
The /deals page serves as the entry point for the deals module. It displays two sections:
-
Pipeline Cards — A responsive grid of all pipelines in the workspace. Each card shows the pipeline name, creation date, and a footer listing the pipeline's stages in order (e.g. "Lead • Proposal • Negotiation"). Clicking a card opens its Kanban board.
-
All Deals Table — A filterable, paginated table of every deal across all pipelines (covered in the Deals page).
Creating a Pipeline
Click the New Pipeline button (visible to Admins and Owners only) to open the creation dialog. Only a Pipeline Name is required.
When a pipeline is created, three default stages are automatically added:
| Order | Stage Name |
|---|---|
| 0 | Lead |
| 1 | Proposal |
| 2 | Negotiation |
These defaults can be renamed, reordered, or removed after creation.
Managing Stages
From the Kanban board, Admins can click the Manage button to open the pipeline management dialog. This dialog allows:
Renaming the Pipeline
Update the pipeline name and click Save.
Managing Stages
The dialog displays all stages in their current order. For each stage you can:
- Rename — Edit the stage name inline.
- Reorder — Use the up/down arrow buttons to change the stage's position.
- Delete — Remove a stage from the pipeline.
Adding a Stage
Click Add Stage to append a new stage at the end of the pipeline. The new stage is automatically
assigned the next order_index value.
Stage Ordering
Stages are ordered by an order_index integer. The reorderStages server action accepts an ordered
array of stage IDs and bulk-updates each stage's order_index to match the new sequence.
Deleting a Pipeline
From the Manage dialog, click Delete Pipeline. A confirmation dialog appears before the delete
is executed. Deleting a pipeline cascades to all its stages (via ON DELETE CASCADE), and any deals
on those stages will lose their stage reference.
Important: Pipeline deletion is restricted to Admin and Owner roles.
Database Schema
Pipelines
| Column | Type | Description |
|---|---|---|
id | uuid | Primary key |
workspace_id | uuid | Tenant isolation |
name | text | Pipeline name |
created_at | timestamptz | Created timestamp |
updated_at | timestamptz | Last updated timestamp |
Pipeline Stages
| Column | Type | Description |
|---|---|---|
id | uuid | Primary key |
pipeline_id | uuid | FK → pipelines.id (cascades on delete) |
name | text | Stage name |
order_index | integer | Sort position within the pipeline |
created_at | timestamptz | Created timestamp |