Pipelines & Deals
Pipelines & Stages

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:

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

  2. 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:

OrderStage Name
0Lead
1Proposal
2Negotiation

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

ColumnTypeDescription
iduuidPrimary key
workspace_iduuidTenant isolation
nametextPipeline name
created_attimestamptzCreated timestamp
updated_attimestamptzLast updated timestamp

Pipeline Stages

ColumnTypeDescription
iduuidPrimary key
pipeline_iduuidFK → pipelines.id (cascades on delete)
nametextStage name
order_indexintegerSort position within the pipeline
created_attimestamptzCreated timestamp