CRM

CRM - Operational Workflows & State Machines

Lead-to-opportunity lifecycle, deal progression, helpdesk ticket lifecycle, and state transition tables for the CRM domain.

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

StageDescriptionKey Domain Event
CapturedLead record created from an inbound channel.LeadCaptured
EnrichedFirmographic, demographic, and behavioral data added.LeadEnriched
ScoredScoring model applied to prioritize and route.LeadScored
QualifiedLead meets qualification criteria for sales engagement.LeadQualified
DisqualifiedLead determined unsuitable; reason captured.LeadDisqualified
MaterializedContact and/or Account record created or linked.ContactMaterialized / AccountMaterialized
Opportunity OpenedDeal created against account/contact and assigned to pipeline.DealCreated

Lead Qualification Criteria

CriterionQuestionTypical Evidence
BudgetDoes the lead have approved budget?Company size, funding status, stated budget.
AuthorityCan the lead make or influence purchase decisions?Job title, persona, explicit confirmation.
NeedDoes the lead have a problem the product solves?Stated pain points, use case alignment.
TimelineIs 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

StageTypical Win ProbabilityEntry CriteriaExit Criteria
New Opportunity10%Deal created from qualified lead or account.Initial discovery scheduled.
Discovery25%Discovery call completed; needs validated.Formal proposal prepared.
Formal Proposal50%Proposal or quote delivered to buyer.Buyer feedback received.
Negotiation75%Commercial terms under discussion.Final decision reached.
Closed-Won100%Buyer signed; deal sealed.Terminal state.
Closed-Lost0%Deal lost or abandoned; reason captured.Terminal state.

Forecast Rollup

Forecast CategoryIncluded StagesReporting Purpose
PipelineNew, DiscoveryEarly funnel visibility.
Best CaseProposal, some NegotiationUpside scenario.
CommitLate NegotiationForecast expected to close.
ClosedClosed-Won / Closed-LostActual 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

StageDescriptionSLA Timer State
NewTicket received, not yet assigned.Running.
AssignedAgent or queue assigned.Running.
Awaiting First ResponseAgent has not yet responded to customer.Running; breach if target missed.
In ProgressAgent actively working on issue.Running.
Awaiting Customer ResponseAgent requested information; waiting for customer.Paused.
ResolvedAgent marked issue resolved; awaiting customer confirmation.Paused or running based on policy.
ClosedIssue confirmed resolved or auto-closed per policy.Stopped.
ReopenedCustomer indicates issue is not resolved.Running from reopen timestamp.

4. Lead State Transition Table

Current StateTrigger / EventNext StateBusiness Validation Rule
NewInbound capture event received.CapturedRequired fields (email/phone/channel) are valid.
CapturedEnrichment data applied.EnrichedEnrichment source and confidence recorded.
EnrichedScoring model executed.ScoredScore and scoring version captured.
ScoredScore meets qualification threshold; BANT/qualification confirmed.QualifiedQualification criteria satisfied; no duplicates unresolved.
ScoredScore below threshold but not disqualified.NurturingPlaced into nurture sequence; re-evaluation scheduled.
NurturingEngagement or score improves.ScoredRe-evaluated against current scoring model.
Scored or NurturingDetermined unfit for pursuit.DisqualifiedDisqualification reason code is mandatory.
DisqualifiedNew information indicates fit; requalification initiated.QualifiedNew qualification event recorded.
QualifiedContact/account materialized; deal created.ConvertedOriginal lead linked to contact, account, and deal.
ConvertedDeal reopened as new opportunity from same lead.(Remains Converted)New deal linked to existing contact/account.
Any non-Converted stateLead determined to be duplicate of existing contact/account.MergedMerge rules applied; history transferred to survivor.

5. Deal State Transition Table

Current StateTrigger / EventNext StateBusiness Validation Rule
NewQualified lead converted or manually created.DiscoveryDiscovery activity scheduled or completed.
DiscoveryNeeds validated; proposal prepared.ProposalProposal document attached or quote sent.
ProposalCustomer feedback received; terms discussed.NegotiationNegotiation activity logged.
NegotiationCustomer approves terms.Closed-WonClosure reason captured; value/date sealed.
NegotiationCustomer declines or deal abandoned.Closed-LostLoss reason code is mandatory.
Proposal or NegotiationDeal stalled beyond rotting threshold.StalledStale-deal alert triggered; re-engagement planned.
StalledCustomer re-engages.Previous open stageReason for reactivation recorded.
Closed-WonCorrection or cancellation required.(Remains Closed-Won)Compensating documents created in Sales/FMS; deal not reopened.
Closed-LostOpportunity reactivated.DiscoveryNew deal typically created instead; reactivation audited.

6. Ticket State Transition Table

Current StateTrigger / EventNext StateBusiness Validation Rule
NewTicket created via email, portal, phone, or chat.AssignedRouting rules match ticket to queue/agent.
NewNo queue match available.UnassignedTicket held in triage queue.
UnassignedAgent or queue assigned.AssignedAssignment recorded.
AssignedAgent sends first customer response.In ProgressFirst response time captured.
AssignedSLA timer approaches breach.EscalatedEscalation rule triggered.
In ProgressAgent requests customer information.Awaiting CustomerSLA timer paused.
Awaiting CustomerCustomer replies.In ProgressSLA timer resumes.
In ProgressAgent proposes solution.ResolvedResolution details recorded.
ResolvedCustomer confirms resolution.ClosedSatisfaction survey dispatched.
ResolvedCustomer indicates issue persists.ReopenedReopen reason captured; SLA recalculated.
ResolvedNo customer response within auto-close window.ClosedAuto-close policy applied.
EscalatedHigher-tier agent takes ownership.In ProgressEscalation 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

RuleInvariant
First-Touch AttributionThe first known campaign/channel is preserved as the acquisition source.
Multi-Touch TrackingSubsequent engagements are recorded in touchpoint history.
UTM IntegrityUTM parameters are captured at lead creation and not overwritten by later sessions.
Campaign CostCampaign 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

ExceptionHandling Rule
Duplicate lead during nurtureSuggested merge; if accepted, history transferred and nurture continues from surviving record.
Deal owner departureDeals reassigned to new owner; ownership change audited.
SLA breach during handoverEscalation continues regardless of shift change; new agent inherits SLA accountability.
Customer requests data deletionPseudonymize or anonymize records per privacy policy; transactional history retained in non-identifiable form.
Campaign source unknownLead 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.

Our Premium Sponsors

Obelaw is proudly open-source. Continued development, bug fixes, and community support are made possible by the generosity of our sponsors.

Sponsor Obelaw