# Deals

Deals track sales opportunities through your pipeline. Each deal represents a potential revenue opportunity connected to a contact, a company, or both.

## Viewing Deals

Navigate to **CRM > Deals** to open your pipeline. Two view modes are available from the toolbar:

- **Pipeline** — kanban-style board organized by stage. Drag cards between columns to move stages.
- **List** — Attio-style spreadsheet with inline edit, sortable headers, drag-to-resize columns, multi-select, and a bulk-action bar.

## Pipeline Switcher

The toolbar includes a pipeline picker between the search bar and the view toggle. Pick any configured pipeline to render the kanban with that pipeline's stages (colors, order, default probability). The selection persists per browser. To create or edit pipelines, click the gear icon next to the picker or go to **Settings > Pipelines**. See [Pipelines](/help/crm/pipelines).

When you drop a deal between columns on a custom pipeline, Karmaflow.ai sends `{ pipelineId, stageId }` instead of the legacy `stage` enum so the new stage is recorded correctly.

## Saved Views

The toolbar exposes a saved-view picker. Picking a view applies its filters and sort to the list. Default views load automatically on page open. See [Saved Views](/help/crm/saved-views).

## Creating a Deal

1. Click **+ New Deal**.
2. Enter:
   - **Name** — name of the opportunity.
   - **Value** and **Probability**.
   - **Stage** — defaults to the first stage of the active pipeline.
   - **Contact** and **Company** — searchable lookups.
   - **Expected Close Date**, **Source**, **Description**.
3. Click **Save**. Field-level validation errors appear inline.

## Importing Deals

Deals import in bulk from their own page:

1. Navigate to **CRM > Deals** and click **Import** (requires the `crm:import` permission)
2. Upload a CSV or Excel file — pick the delimiter first if your CSV needs one
3. Click **Import**

Columns like `name`, `value`, `currency`, `stage`, `close date`, `probability`, `company`, `email`, `source` and `tags` are mapped automatically. Each deal is associated as it imports:

- **Company** — matched by the company's domain (a `company domain` or `website` column) first, then by an exact company-name match.
- **Contact** — matched by email address. When the row's company isn't in the CRM but the matched contact belongs to one, the contact's company fills in.
- Nothing is created by matching — an unknown company or email leaves the deal unlinked, and the result panel reports how many rows that affected.

The **Assign owner** picker sets the owner for every imported deal; left on *Unassigned*, the person running the import becomes the owner. A `stage` cell is matched against your default pipeline by stage name; a stage your pipeline doesn't have sends the deal to the first stage and is counted on the result panel. A row with the same name **and** the same company as an existing deal is skipped entirely — an import never updates deal values, so re-running a file is safe.

## Deleting a Deal

Open the deal and click **Delete** (requires the `crm:deals:edit` permission). Deals are soft-deleted: the deal moves to [Recently Deleted](/help/crm/recently-deleted), where it can be restored. To delete several at once, switch the deals page to **List** view, select the rows, and use **Delete** in the action bar.

## Deal Detail View

The deal detail page gives you the full context around an opportunity:

- **Deal Information** — value, stage, probability, expected close, contact, company, source, description.
- **Custom fields** — per-tenant attributes (text, number, date, select, AI-research).
- **Tasks** — follow-up items linked to this deal.
- **Find similar** — closest historical deals from the semantic index (won + lost). Useful to spot which playbook matches the current shape.
- **Most relevant context** — semantically closest interactions across the deal, its contact, and its company.
- **Activity log** and **Change history** — paginated history for the record. Change history is admin-only.
- **Presence avatars** — when teammates are viewing or editing the same deal, their initial chips appear in the header.

## Deal Health and Scoring

Deals carry two AI-assisted signals:

- **Health** — a nightly vector-comparator score that compares the deal's recent activity against past won and lost deals at the same stage. Surfaces a 0-100 score, risk flags, and an optional next-action suggestion.
- **Score** — a rules-engine score with an optional vector-similarity prior over your tenant's own closed-won contacts. Both the value and the contributing rules are stored on the deal so the score is explainable.

These are exposed in the deal detail view and consumed by the **Hot deals** and **Stuck deals** widgets on the CRM Dashboard.

<!-- SCREENSHOT: deals-pipeline.png — Deals pipeline kanban view -->
<!-- SCREENSHOT: deal-detail.png — Deal detail page with health + similar -->
