Back to Playbooks

Signal-Driven Lead Lifecycle Engine

Build
~2 days (typically 1-2 months)

A healthcare technology company's Lead Status field was meaningless. 17 separate Orum disposition flows, unused HubSpot signals, no decay model, and 68% of leads stuck in “Working” forever. Sales leadership couldn't trust the funnel. SDRs couldn't prioritize. Nobody knew which ICP accounts were actually being penetrated.

The Ask

VP
VP SalesMonday 9:00 AM

I can't use Lead Status for anything right now. 17 different Orum flows are updating it, HubSpot signals aren't feeding in, and leads never move backward when they go cold. I need a single system that evaluates real signals, decays stale leads, and gives me actual visibility into ICP penetration. Our team quoted 1-2 months. Can you do it faster?

The Prompt

Full project spec dropped into the terminal.

Our Lead Status field is broken. We have 17 separate Orum disposition flows
updating it, HubSpot engagement signals are mostly unused, and there's no
decay model to move stale leads backward. SDRs don't trust it, leadership
can't use it for funnel reporting, and we have no idea which ICP accounts
are actually being penetrated.

I need you to:
1. Audit the current signal landscape (Outreach, HubSpot, Orum, Calendly, EAC, Salesforce native)
2. Design a centralized signal broker with a proper status hierarchy and decay model
3. Publish the full architecture plan to Outline for stakeholder review
4. After approval, implement the whole thing in Salesforce
5. Build territory routing, account-level rollups, and a reporting suite
6. Document everything post-execution for sales leadership in Outline

This normally takes our team 1-2 months. I need it in days.

Plan → Bless → Build → Document

The architecture plan was published to Outline first so stakeholders could review and approve before a single line of code was written. After deployment, the full system was documented back in Outline for sales leadership. The tool doesn't just build — it publishes the plan, gets the blessing, executes, and documents the result.

Core Workflow

Audit, plan, get approval, build, test, document. Full lifecycle in 2 days.

1

Signal Audit

Map every engagement signal across 6 platforms. Inventory the 17 legacy flows and their gaps.

2

Architecture Plan to Outline

Publish full spec — status hierarchy, signal mappings, decay rules, territory model — for stakeholder blessing.

3

Signal Broker & Decay Engine

Single evaluation engine replacing 17 flows. Nightly batch decay with freshness windows and protection rules.

4

Territory & Routing

Optimize 4-territory model across 4,967 accounts. Real-time lead routing with override support.

5

Rollups & Reporting

Account TOFU scores, health system penetration, lifecycle funnel, and a command center dashboard.

6

Executive Documentation

Post-execution summary published to Outline — consumable format for sales leadership and stakeholders.

After you paste this prompt, Claude Code:

"This is a full lifecycle engine project. Let me start by auditing every signal source and understanding what the 17 legacy flows actually do."

Running
$ g-gremlin sfdc describe --object Lead --fields Status,Outreach_*,HubSpot_*,Orum_* --json
Mapped 47 signal-related fields on Lead. 23 are populated by legacy flows, 14 are from HubSpot sync but unused in status logic.
Running
$ g-gremlin sfdc query --soql "SELECT LeadStatus, COUNT(Id) FROM Lead GROUP BY LeadStatus" --out status_distribution.csv
Status distribution exported. 68% of leads stuck in "Working" — confirms decay is broken.

"68% in "Working" is a dead giveaway — without decay, leads go up and never come back down. The 17 Orum flows each handle a narrow disposition but none of them evaluate the full signal picture. Let me map the complete signal landscape."

Running
$ g-gremlin sfdc snapshot --object Lead --fields Id,Status,LastActivityDate,Outreach_Sequence_State__c,Last_Outreach_Reply__c,HubSpot_Score__c,Last_Orum_Disposition__c --out lead_signals_snapshot.csv
Snapshot: 12,847 leads with signal fields. Will use this for decay window analysis and backfill planning.

"Signal audit complete. I have the full picture: 6 platforms, 47 fields, 17 legacy flows, 68% status inflation. Publishing architecture plan to Outline for stakeholder review."

Running
$ g-gremlin docs publish --provider outline --template lead-status-implementation-spec.md --collection "Engineering" --title "Lead Lifecycle Engine — Architecture Plan" --apply
Published to Outline. Spec includes: 14-level status hierarchy, signal-to-status mappings for all 6 platforms, decay windows, territory model, and rollup design.

Architecture plan published to Outline. Waiting for stakeholder approval before execution.

What Was Built

Centralized Signal Broker

Single evaluation engine replacing 17 legacy flows. Ingests signals from Outreach (replies, meetings, bounces, opens, clicks, sequence state), HubSpot (lead scores, form submissions, webinar registrations, page views), Orum (13 call disposition types via custom metadata), Calendly, EAC, and Salesforce native. Computes a 0–100 signal score on every evaluation. Promote-only logic — leads move up through signals, never down except via scheduled decay.

14-Level Status Hierarchy

Unaware → Working → Aware → Interested → Engaged → Sales Accepted Lead → Qualified, plus terminal states: Do Not Contact, Bad Contact Data, Unqualified. Each transition is signal-driven with clear promotion criteria.

Nightly Decay Engine

Scheduled batch at 2 AM evaluates every active lead against signal freshness windows. Leads in active sequences, with pipeline accounts, or in terminal states are protected.

StatusDecay WindowDemotes To
Engaged21 daysInterested
Interested30 daysAware
Aware45 daysWorking
Working60 daysUnaware

Territory Optimization & Routing

Analyzed 4,967 ICP-qualified accounts across 737 parent accounts. Optimized 4-territory model achieving 0.81% coefficient of variation — essentially perfect balance. Real-time BEFORE-trigger routing with California north/south split, manual override support, and batch reassignment cascades.

Reporting Suite

Lead Lifecycle Funnel, Status by Territory & Owner, Status by Persona, Signal Source Attribution, Stale & Decaying Leads, ICP Account Coverage, Account TOFU Score Bands, Ultimate Parent Health System Penetration, and a Lead Lifecycle Command Center dashboard.

After you paste this prompt, Claude Code:

"Stakeholders approved the plan. Time to build. The signal broker is the core — it replaces all 17 flows with a single evaluation engine. I'll also need the decay batch, territory routing, persona classifier, and the Outreach webhook pipeline."

Running
$ g-gremlin sfdc snapshot --object Lead --fields Id,Status,OwnerId,Territory__c,Account.Name,Account.Ultimate_Parent__c --out pre_deployment_baseline.csv
Pre-deployment baseline captured. 12,847 leads across 4,967 ICP accounts and 737 parent accounts.

"Implementation sequence: 1) Signal broker + custom metadata config, 2) Decay batch with freshness windows, 3) Orum disposition mapping (13 types), 4) Outreach webhook pipeline via Pipedream, 5) Historical backfill, 6) Territory optimization + routing engine, 7) Persona classifier, 8) Account rollups + reporting, 9) Zendesk sync, 10) Test suite."

Running
$ g-gremlin sfdc snapshot --object CustomMetadata --type Orum_Disposition_Mapping__mdt --out orum_mappings.csv
Captured 13 Orum disposition types. Each now maps to a status transition + signal score via custom metadata — configurable without code changes.

"The signal broker evaluates signals from all 6 platforms and computes a 0-100 signal score on every update. Promote-only logic — leads move up through signals, never down, unless the nightly decay batch determines inactivity."

Running
$ g-gremlin sfdc query --soql "SELECT Id, Email, Last_Signal_Date__c FROM Lead WHERE Status IN ('Engaged','Interested','Aware','Working') AND Last_Signal_Date__c < LAST_N_DAYS:60" --out decay_candidates.csv
3,241 leads eligible for decay. Will be processed by nightly batch at 2 AM with per-status freshness windows.
Running
$ g-gremlin sfdc query --soql "SELECT Territory__c, COUNT(Id) cnt, COUNT(DISTINCT AccountId) accts FROM Lead WHERE ICP_Qualified__c = true GROUP BY Territory__c" --out territory_balance.csv
Territory balance: 4 territories, 0.81% coefficient of variation. Effectively perfect balance across 4,967 accounts.

Core implementation complete. Signal broker, decay engine, territory routing, persona classifier, account rollups, and reporting suite all deployed. 305/305 tests passing.

Extended: Platform Integrations

Beyond the core signal broker — webhook pipelines, healthcare-specific matching, persona classification, and support tooling sync.

+1

Outreach Webhook Pipeline

Real-time Outreach events via Pipedream middleware — captures signals the native plugin misses. Historical backfill of ~5,000 leads.

Requires: Outreach + Pipedream

+2

Healthcare Account Matching V3

Specialized matching for 14 major health systems with subsidiary recognition, geographic intelligence, and parent/child traversal.

Requires: Healthcare ICP

+3

Persona Classification

Automated 12-persona bucketing from job titles — Security, Clinical, HR, IT, Executive, and 7 more.

Requires: Lead title data

+4

Zendesk Org Sync

Auto-creates Zendesk organizations when opps close-won or hit late stage. Keeps support tooling in sync.

Requires: Zendesk

After you paste this prompt, Claude Code:

"Everything is deployed and validated. Now I need to document the full system for leadership — what was built, how it works, and what they can now measure."

Running
$ g-gremlin docs publish --provider outline --template executive_summary.md --collection "Sales Leadership" --title "Lead Lifecycle Engine — Deployment Summary" --apply
Executive summary published: architecture overview, signal source inventory, decay model, territory design, reporting suite, and key metrics.
Running
$ g-gremlin docs publish --provider outline --template lead-status-deviations.md --collection "Engineering" --title "Lead Lifecycle — Spec Deviations & Rationale" --apply
Deviations doc published. 4 deliberate deviations from original spec, each with engineering rationale.

Full documentation published to Outline. Leadership has the executive summary; engineering has the spec, deviations, and cutover runbook. Project complete.

Requirements

Salesforce Connected App

Core platform — signal broker, decay, routing

Required

Outreach API + Pipedream

Real-time webhook pipeline for engagement signals

Required

HubSpot sync

Lead scores, engagement scores, form submissions

Required

Orum dispositions

Call outcome signal mappings via custom metadata

Required

Outline workspace

Plan publishing and executive documentation

Required

Gremlin CLI 0.1.21+

CRM snapshot, query, docs publish

Required

Results

17
Legacy flows eliminated
6
Signal platforms integrated
305
Tests passing
~5,000
Leads backfilled
4,967
ICP accounts balanced
0.81%
Territory CV
1-2 mo
Typical timeline
2 days
Actual delivery
17 flows → 1

Single signal broker replaces all legacy status flows

Trustworthy funnel

Leadership can answer: are we penetrating ICP accounts?

60x faster

2 days instead of the typical 1-2 month project timeline

Your Lead Status Is Probably Broken Too

If your team has fragmented status flows, no decay model, and inflated pipeline signals — this is what fixing it looks like.

Architecture guide: How to Build a Computed Lead Lifecycle in Salesforce