Operational Workflows & State Machines
The CRM domain executes commercial relationship processes through clearly defined workflows and state transitions. Leads, deals, and tickets each follow controlled lifecycles that enforce business invariants and provide full traceability.
1. Prospect-to-Opportunity Lifecycle
The following diagram illustrates how an inbound prospect progresses through capture, enrichment, scoring, qualification, and conversion into a contact/account and opportunity.
flowchart TD
A[Inbound Prospect<br/>Website / Campaign / Event / Referral] --> B[Lead Captured]
B --> C[Lead Enrichment]
C --> D[Lead Scoring]
D --> E{Score & Qualification}
E -->|Qualified| F[Contact / Account Materialized]
E -->|Not Ready| G[Nurture Sequence]
G --> D
E -->|Disqualified| H[Disqualified<br/>Reason Required]
F --> I[Deal Opened]
I --> J[Pipeline Engagement]
Lifecycle Stage Descriptions
| Stage | Description | Key Domain Event |
|---|
| Captured | Lead record created from an inbound channel. | LeadCaptured |
| Enriched | Firmographic, demographic, and behavioral data added. | LeadEnriched |
| Scored | Scoring model applied to prioritize and route. | LeadScored |
| Qualified | Lead meets qualification criteria for sales engagement. | LeadQualified |
| Disqualified | Lead determined unsuitable; reason captured. | LeadDisqualified |
| Materialized | Contact and/or Account record created or linked. | ContactMaterialized / AccountMaterialized |
| Opportunity Opened | Deal created against account/contact and assigned to pipeline. | DealCreated |
Lead Qualification Criteria
| Criterion | Question | Typical Evidence |
|---|
| Budget | Does the lead have approved budget? | Company size, funding status, stated budget. |
| Authority | Can the lead make or influence purchase decisions? | Job title, persona, explicit confirmation. |
| Need | Does the lead have a problem the product solves? | Stated pain points, use case alignment. |
| Timeline | Is there a defined purchase timeframe? | Stated go-live date, project urgency. |
2. Deal Progression Lifecycle
The following diagram illustrates the standard opportunity pipeline from creation through closure.
flowchart TD
A[New Opportunity] --> B[Discovery]
B --> C[Formal Proposal]
C --> D[Negotiation]
D --> E{Decision}
E -->|Won| F[Closed-Won<br/>Sealed & Irreversible]
E -->|Lost| G[Closed-Lost<br/>Reason Required]
E -->|Stalled| H[Stalled / On Hold]
H --> D
Deal Stage Definitions
| Stage | Typical Win Probability | Entry Criteria | Exit Criteria |
|---|
| New Opportunity | 10% | Deal created from qualified lead or account. | Initial discovery scheduled. |
| Discovery | 25% | Discovery call completed; needs validated. | Formal proposal prepared. |
| Formal Proposal | 50% | Proposal or quote delivered to buyer. | Buyer feedback received. |
| Negotiation | 75% | Commercial terms under discussion. | Final decision reached. |
| Closed-Won | 100% | Buyer signed; deal sealed. | Terminal state. |
| Closed-Lost | 0% | Deal lost or abandoned; reason captured. | Terminal state. |
Forecast Rollup
| Forecast Category | Included Stages | Reporting Purpose |
|---|
| Pipeline | New, Discovery | Early funnel visibility. |
| Best Case | Proposal, some Negotiation | Upside scenario. |
| Commit | Late Negotiation | Forecast expected to close. |
| Closed | Closed-Won / Closed-Lost | Actual performance. |
3. Helpdesk Ticket Lifecycle
The following diagram illustrates the support desk workflow from ticket creation through resolution and customer confirmation.
flowchart TD
A[Ticket Created] --> B[SLA Timer Armed]
B --> C{Auto-Routing}
C -->|Queue Match| D[Agent Assigned]
C -->|No Match| E[Unassigned Queue]
D --> F[First Response]
E --> D
F --> G[Investigation & Diagnosis]
G --> H[Resolution Attempt]
H --> I{Customer Confirmation}
I -->|Resolved| J[Ticket Resolved]
I -->|Not Resolved| G
I -->|No Reply| K[Auto-Close after Policy]
J --> L{Satisfaction / Reopen}
L -->|Reopen| G
L -->|Closed| M[Ticket Closed]
Ticket Stage Definitions
| Stage | Description | SLA Timer State |
|---|
| New | Ticket received, not yet assigned. | Running. |
| Assigned | Agent or queue assigned. | Running. |
| Awaiting First Response | Agent has not yet responded to customer. | Running; breach if target missed. |
| In Progress | Agent actively working on issue. | Running. |
| Awaiting Customer Response | Agent requested information; waiting for customer. | Paused. |
| Resolved | Agent marked issue resolved; awaiting customer confirmation. | Paused or running based on policy. |
| Closed | Issue confirmed resolved or auto-closed per policy. | Stopped. |
| Reopened | Customer indicates issue is not resolved. | Running from reopen timestamp. |
4. Lead State Transition Table
| Current State | Trigger / Event | Next State | Business Validation Rule |
|---|
| New | Inbound capture event received. | Captured | Required fields (email/phone/channel) are valid. |
| Captured | Enrichment data applied. | Enriched | Enrichment source and confidence recorded. |
| Enriched | Scoring model executed. | Scored | Score and scoring version captured. |
| Scored | Score meets qualification threshold; BANT/qualification confirmed. | Qualified | Qualification criteria satisfied; no duplicates unresolved. |
| Scored | Score below threshold but not disqualified. | Nurturing | Placed into nurture sequence; re-evaluation scheduled. |
| Nurturing | Engagement or score improves. | Scored | Re-evaluated against current scoring model. |
| Scored or Nurturing | Determined unfit for pursuit. | Disqualified | Disqualification reason code is mandatory. |
| Disqualified | New information indicates fit; requalification initiated. | Qualified | New qualification event recorded. |
| Qualified | Contact/account materialized; deal created. | Converted | Original lead linked to contact, account, and deal. |
| Converted | Deal reopened as new opportunity from same lead. | (Remains Converted) | New deal linked to existing contact/account. |
| Any non-Converted state | Lead determined to be duplicate of existing contact/account. | Merged | Merge rules applied; history transferred to survivor. |
5. Deal State Transition Table
| Current State | Trigger / Event | Next State | Business Validation Rule |
|---|
| New | Qualified lead converted or manually created. | Discovery | Discovery activity scheduled or completed. |
| Discovery | Needs validated; proposal prepared. | Proposal | Proposal document attached or quote sent. |
| Proposal | Customer feedback received; terms discussed. | Negotiation | Negotiation activity logged. |
| Negotiation | Customer approves terms. | Closed-Won | Closure reason captured; value/date sealed. |
| Negotiation | Customer declines or deal abandoned. | Closed-Lost | Loss reason code is mandatory. |
| Proposal or Negotiation | Deal stalled beyond rotting threshold. | Stalled | Stale-deal alert triggered; re-engagement planned. |
| Stalled | Customer re-engages. | Previous open stage | Reason for reactivation recorded. |
| Closed-Won | Correction or cancellation required. | (Remains Closed-Won) | Compensating documents created in Sales/FMS; deal not reopened. |
| Closed-Lost | Opportunity reactivated. | Discovery | New deal typically created instead; reactivation audited. |
6. Ticket State Transition Table
| Current State | Trigger / Event | Next State | Business Validation Rule |
|---|
| New | Ticket created via email, portal, phone, or chat. | Assigned | Routing rules match ticket to queue/agent. |
| New | No queue match available. | Unassigned | Ticket held in triage queue. |
| Unassigned | Agent or queue assigned. | Assigned | Assignment recorded. |
| Assigned | Agent sends first customer response. | In Progress | First response time captured. |
| Assigned | SLA timer approaches breach. | Escalated | Escalation rule triggered. |
| In Progress | Agent requests customer information. | Awaiting Customer | SLA timer paused. |
| Awaiting Customer | Customer replies. | In Progress | SLA timer resumes. |
| In Progress | Agent proposes solution. | Resolved | Resolution details recorded. |
| Resolved | Customer confirms resolution. | Closed | Satisfaction survey dispatched. |
| Resolved | Customer indicates issue persists. | Reopened | Reopen reason captured; SLA recalculated. |
| Resolved | No customer response within auto-close window. | Closed | Auto-close policy applied. |
| Escalated | Higher-tier agent takes ownership. | In Progress | Escalation chain recorded. |
7. Marketing Attribution Workflow
Campaign attribution connects inbound leads and engagement to marketing initiatives.
flowchart LR
A[Campaign Launched] --> B[UTM Links Distributed]
B --> C[Prospect Clicks / Engages]
C --> D[Lead Captured with Attribution]
D --> E[Lead Scored & Qualified]
E --> F[Deal Created with Attribution]
F --> G[Closed-Won]
G --> H[CAC Calculated]
Attribution Rules
| Rule | Invariant |
|---|
| First-Touch Attribution | The first known campaign/channel is preserved as the acquisition source. |
| Multi-Touch Tracking | Subsequent engagements are recorded in touchpoint history. |
| UTM Integrity | UTM parameters are captured at lead creation and not overwritten by later sessions. |
| Campaign Cost | Campaign spend is captured to enable CAC and ROI calculations. |
Customer Acquisition Cost
$$
\text{CAC} = \frac{\text{Total Campaign Spend}}{\text{Number of Customers Acquired}}
$$
A “customer” is defined as a lead that converted to a Closed-Won deal within the attribution window.
8. Exception Handling
| Exception | Handling Rule |
|---|
| Duplicate lead during nurture | Suggested merge; if accepted, history transferred and nurture continues from surviving record. |
| Deal owner departure | Deals reassigned to new owner; ownership change audited. |
| SLA breach during handover | Escalation continues regardless of shift change; new agent inherits SLA accountability. |
| Customer requests data deletion | Pseudonymize or anonymize records per privacy policy; transactional history retained in non-identifiable form. |
| Campaign source unknown | Lead attributed to “Direct / Unknown” channel; attribution can be updated manually with audit reason. |
These workflows and state machines ensure that every commercial relationship is acquired, developed, and supported through a consistent, auditable, and invariant-preserving process.