Agent #008 · RevOps

Lead Routing Agent

🟠 Scale

Routes inbound leads with suppression-first logic through customer, opportunity, named-account, territory, and round-robin rules — shadow mode before production

Build time
1-3 days
Primary user
RevOps
Primary outcome
Correct ownership and SLA discipline
Deployable pack
Yes: full pack

Adam's take

The highest-stakes agent in the launch set. Run it in shadow mode longer than feels necessary; a misrouted lead is annoying, a suppressed customer getting prospected is a fire.
Adam Woozeer, founder

Required tools

HubSpotn8n

Optional tools

SalesforceSlackLeanData (replacement)

Expected value

Speed-to-lead in minutes; SLA discipline; correct ownership without manual triage

Deployable workflow pack

The full pack includes the agent spec, deployment guide, architecture diagrams, n8n workflow skeleton, Clay template, HubSpot properties, JSON schemas, OpenAPI spec, cost and ROI calculators, demo data, QA checklist, and governance notes.

View pack on GitHub
Full deployment guide →Governance & failure modes →QA checklist →

How to deploy this agent

Lead routing looks simple until you actually build it. A lead from an existing customer’s domain shouldn’t create a new deal. A named account should reach its assigned AE, not round-robin. A suppressed contact shouldn’t be routed anywhere at all. This agent runs every inbound lead through those checks in a strict, documented order — and it runs in shadow mode before it ever touches a live queue.

Core signals

1. Suppression check: Runs first, unconditionally. A suppressed or unsubscribed contact is routed nowhere — this rule has no exceptions.
2. Existing customer routing: A lead whose company domain matches an existing customer routes to Customer Success or the account owner, never into a new-logo outbound pool.
3. Open opportunity routing: A lead from a company with an open deal routes straight to the deal owner.
4. Named account routing: A company on the named-account list always reaches its assigned AE, regardless of what round-robin would have otherwise assigned.
5. Territory routing: Geo and segment rules route anything not caught by the rules above.
6. Round-robin fallback: Only reached when nothing above resolved — capacity-weighted, not a flat rotation.

Input schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://deploytheagent.com/schemas/agent-008-input.schema.json",
  "title": "Agent #008 Lead Routing Agent Input",
  "type": "object",
  "required": [
    "record_id"
  ],
  "properties": {
    "record_id": {
      "type": "string",
      "description": "CRM record ID (company/contact/deal depending on agent)."
    },
    "domain": {
      "type": "string"
    },
    "config_version": {
      "type": "string",
      "description": "Versioned config used for this run."
    }
  },
  "additionalProperties": true
}

Output schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://deploytheagent.com/schemas/agent-008-output.schema.json",
  "title": "Agent #008 Lead Routing Agent Output",
  "type": "object",
  "required": [
    "record_id",
    "routing_status",
    "routing_matched_rule",
    "routing_timestamp",
    "routing_exception_reason"
  ],
  "properties": {
    "record_id": {
      "type": "string"
    },
    "routing_status": {
      "type": "string",
      "description": "Agent #008 output field."
    },
    "routing_matched_rule": {
      "type": "string",
      "description": "Agent #008 output field."
    },
    "routing_timestamp": {
      "type": "string",
      "description": "Agent #008 output field."
    },
    "routing_exception_reason": {
      "type": "string",
      "description": "Agent #008 output field."
    }
  },
  "additionalProperties": false
}

Scoring / classification logic

Anything that fails all six rules, or matches two rules ambiguously (say, an open-opportunity match and a named-account match pointing to different owners), routes to a human-reviewed exception queue instead of a best guess. That design decision — ambiguous is safer slow than wrong fast — is the whole point of this agent.

HubSpot CRM properties

routing_status company
Written by Agent #008 (Lead Routing Agent).
routing_matched_rule company
Written by Agent #008 (Lead Routing Agent).
routing_timestamp company
Written by Agent #008 (Lead Routing Agent).
routing_exception_reason company
Written by Agent #008 (Lead Routing Agent).

n8n workflow skeleton

The Lead Routing Agent routes every inbound lead through suppression, existing-customer, open-opportunity, named-account, and territory checks before falling back to round-robin — with a documented exception queue for anything that doesn't cleanly resolve. It runs in shadow mode before it ever touches a live queue. Configure every node marked CONFIGURE before enabling the trigger.

  1. Trigger
    CONFIGURE: set cadence per agent-spec.md's What It Does section. Leave disabled until Step 6 of deployment-guide.md.
  2. Load versioned config
    CONFIGURE: replace with your versioned config built from real data (see deployment-guide.md Step 1).
  3. Fetch source data
    CONFIGURE: {{HUBSPOT_CREDENTIAL}}. Pull the fields listed in agent-spec.md's Inputs table.
  4. Validate + gate records
    Drops records missing required inputs or failing suppression/gate checks defined in agent-spec.md. Logs every drop.
  5. Apply workflow logic
    Implements the Workflow Logic table from agent-spec.md. Writes model/config version alongside every derived value for auditability.
  6. Write agent-owned CRM fields
    CONFIGURE: {{HUBSPOT_CREDENTIAL}}. Writes only: routing_status, routing_matched_rule, routing_timestamp, routing_exception_reason. Never writes sales-owned fields.
  7. Route to human review / alert
    CONFIGURE: {{SLACK_CHANNEL}}. Fires for records requiring human review per agent-spec.md's Governance section.

Cost calculator

Cost Calculator — Agent #008: Lead Routing Agent

Fill in your own volumes and rates — do not use these as benchmark numbers.

Cost driverYour volumeUnit costMonthly cost
n8n execution (workflow runs)___ runs/month$___ / run$___
Enrichment/sourcing credits (if applicable)___ records/month$___ / record$___
LLM API calls (if applicable)___ calls/month$___ / call$___
Human review time___ hrs/month$___ / hr (loaded)$___
Total$___

Build cost (one-time)

Estimated build time: 1–3 days. Multiply by your builder's loaded hourly rate for a one-time build-cost estimate.

Notes

Costs scale with the volume of records this agent processes, not with the size of your whole CRM — scope your volume estimate to the specific object/list this agent actually touches (see `agent-spec.md`'s Inputs table).

ROI calculator

ROI Calculator — Agent #008: Lead Routing Agent

MetricBeforeAfterBasis
Time to route a new leadMinutes to hours, manualReal-time (seconds)Rule engine resolves instantly
Existing customers misrouted as new logosHappens regularly without a checkCaught by rule #2 every timeDomain-match check runs first, always
Named-account misroutesDepends on whoever routes noticingCaught by rule #4 every timeNamed-account list checked deterministically

SLA and misroute-rate improvements are measurable directly from the logged routing decisions; don't claim a revenue number without your own before/after misroute audit.

Your numbers

InputValue
Records processed per month___
Manual time saved per record (before)___ min
Loaded hourly rate$___
Monthly time-savings value$___ (records × minutes saved ÷ 60 × rate)

Compare this to the cost calculator's monthly total for a net ROI. Do not add a revenue-impact number unless you've measured it against your own baseline — see `agent-spec.md`'s ROI note.

Governance notes

Failure modes

QA checklist

QA Checklist — Agent #008: Lead Routing Agent

To be completed by a non-builder reviewer before go-live.

Deployment checklist

  • All six routing rule sources connected and current (suppression, customer list, open opps, named accounts, territory, round-robin pool)
  • Four HubSpot lead properties created
  • n8n workflow imported in shadow mode first
  • Shadow-mode accuracy reviewed against real leads (min. two weeks or 100 leads)
  • Ambiguous-lead exception test passes
  • Demo-data run matches `demo-data/sample-output.json`
  • Production go-live explicitly approved by RevOps after shadow-mode review
  • QA checklist completed by a non-builder
  • Rollback tested

Failure-mode verification

  • Verified: Existing customer routed as new logo does not occur (mitigation: Rule #2 runs unconditionally before round-robin; QA test asserts a customer-domain lead never reaches round-robin)
  • Verified: Named account routed to wrong rep does not occur (mitigation: List ownership assigned; QA includes a staleness check on list last-updated date)
  • Verified: Ambiguous lead routed confidently does not occur (mitigation: QA test constructs a deliberately ambiguous lead and asserts it lands in the exception queue, not auto-routed)
  • Verified: Shadow mode skipped, straight to production does not occur (mitigation: Deployment checklist makes shadow-mode sign-off a hard gate before the production toggle is flipped)

Governance verification

  • Agent writes only to its agent-owned fields: `routing_status`, `routing_matched_rule`, `routing_timestamp`, `routing_exception_reason` (lead/contact)
  • No auto-send, auto-close, auto-route, or auto-create action occurs without the human step described in `agent-spec.md`
  • Confidence/model-version is present on every written record where applicable
  • Demo-data run output matches `demo-data/sample-output.json` in structure

Sign-off

Reviewer name: _______________ Date: _______________ Result: Pass / Fail (attach notes)

FAQ

Why does this agent need a shadow-mode period before going live?
Routing wrong, fast, is worse than routing right, slow. Shadow mode lets RevOps catch which edge cases the rule list missed before any of them ship live and cause a real misroute.
What happens to a lead that matches two rules with conflicting owners?
It goes to a human-reviewed exception queue with a specific reason string explaining the conflict — it’s never auto-assigned to either owner by default.
Does a suppressed contact ever get routed anywhere?
No. Suppression is the first check, runs unconditionally, and has no downstream override.
How long should the exception queue run hot before it settles down?
Expect it to run hot for roughly the first month as rules get patched from real edge cases, then taper as the rule list matures.

Related agents