Back to Playbooks

Inbound Lead Routing Patrol

ScoutMaintain
~3 min setup

Hourly Scout check for unassigned inbound leads. Catches broken assignment rules before leads go cold. Slack alert on findings with lead details and pattern detection.

The Prompt

We keep losing inbound leads because assignment rules break silently. By the time we notice, leads are cold.

Scout should patrol hourly:
1. Check for unassigned inbound leads created in last 2 hours
2. Check for leads sitting in "Unassigned" queue > 1 hour
3. Check for leads with missing required routing fields (Territory, Region)
4. Flag broken assignment rule patterns
5. Post Slack alert to #rev-ops if any issues found
6. Include lead IDs, creation time, and missing field details

Run every hour during business hours (8am-6pm PT).

How It Works

1. Query Recent Leads

Find all inbound leads created in last 2 hours

2. Check Unassigned

Flag leads with no owner or sitting in unassigned queue > 1 hour

3. Validate Routing Fields

Check for missing Territory, Region, or other routing criteria

4. Pattern Detection

Identify broken assignment rule patterns or queue issues

5. Slack Alert

Post alert to #rev-ops with lead IDs and issue details

Execution Log

After you paste this prompt, Claude Code:

"Hourly routing patrol. Let me check for unassigned inbound leads from the last 2 hours."

Running
$ g-gremlin scout run routing_patrol --schedule "0 8-18 * * 1-5" --timezone America/Los_Angeles
[Scout] Check: routing_patrol (inbound_lead_patrol) [Scout] Querying leads created since 2026-02-02 12:00:00 PT...
Running
$ sf data query --query "SELECT Id, Name, Email, Company, OwnerId, CreatedDate, Territory__c, Region__c FROM Lead WHERE CreatedDate >= LAST_N_HOURS:2 AND LeadSource IN ('Website','Demo Request','Contact Form')"
23 inbound leads found in last 2 hours

"23 recent inbound leads. Now checking for unassigned owners, queue backlogs, and missing routing fields."

Running
$ g-gremlin scout analyze --check unassigned,queue_time,routing_fields
[Scout] Analysis complete: ⚠️ 5 leads unassigned (OwnerId = queue or null) ⚠️ 3 leads in "Unassigned" queue > 1 hour ⚠️ 2 leads missing Territory__c field ✓ 18 leads properly routed
Running
$ g-gremlin scout pattern-detect --anomaly assignment_rules
[Scout] Pattern detected: 🔴 Assignment rule "EMEA Territory" appears broken - 3 leads with Country = "United Kingdom" not routing to EMEA queue - Expected: EMEA Queue, Actual: Unassigned

Generating alert for #rev-ops Slack channel

Alert includes:
- 5 unassigned lead IDs with details
- 3 leads stuck in queue > 1 hour
- 2 leads with missing routing fields
- Pattern: EMEA assignment rule failure
Running
$ g-gremlin notify slack --channel rev-ops --template routing_alert --severity warning
[Slack] Posted to #rev-ops: ⚠️ Lead Routing Patrol Alert - 2:00 PM PT 🚨 Issues found: • 5 unassigned inbound leads • 3 leads in Unassigned queue > 1hr • 2 leads missing Territory field 🔍 Pattern detected: EMEA assignment rule appears broken 3 UK leads not routing to EMEA queue 📋 Affected leads: • Lead-00145 (Acme UK Ltd) - Created 12:15 PM • Lead-00146 (TechCorp London) - Created 12:47 PM • Lead-00147 (DataSys Europe) - Created 1:23 PM 👉 View full report: [Scout Dashboard Link]

Routing patrol complete. 5 issues flagged, pattern detected, #rev-ops alerted. RevOps can fix assignment rule before more leads are lost.

The Result

Scout catches routing failures within minutes instead of days. RevOps gets instant Slack alerts with lead IDs, pattern detection, and root cause analysis. Fix broken assignment rules before inbound leads go cold.

23
Leads checked
5
Issues found
<5 min
Response time
47s
Execution time

Stop Losing Inbound Leads to Broken Routing

Start your free 30-day trial. No credit card required.