Inbound demo routing via webhook
Turn every demo request into a resolved, scored, owned lead in under 5 minutes, with a next step for every lead, including the disqualified ones. Routing is scored against historical leads with known outcomes.
Blueprint: B01 inbound lead enrichment and routing. Verification: illustrative. The commands and the holdout import were run on the twin; the plan and contract below come from the blueprint card (details at the bottom).
The raw idea
gw idea acme "route inbound demo requests to the right AE in under 5 minutes; existing accounts go to their owner, Gmail signups still get a path" --id inbound-01
Client setup this play needs
| What | How |
|---|---|
routing.owner decision with the rule order |
gw client decide acme routing.owner "existing owner, then territory (country + headcount), then weighted round-robin" |
| The rep roster | gw client decide acme routing.roster "dana.ortiz:2, sam.lee:1, priya.nair:1 (weights)" --note "RevOps sheet, 2026-11" |
reach.person.exclude standard |
Students, job seekers, competitors and restricted countries never get a sequence (they still get a path) |
| A routing holdout | 50–100 historical leads with who they went to and what happened, plus about 10 personal-email cases |
The CRM export becomes the holdout. Contact fields are removed on import unless you pass --keep-contact, so key the rows by lead id and company domain, not by email:
gw client gold acme inbound_history --csv examples/csv/gold-inbound-history.csv
Any column whose name contains email or phone, and any value that looks like an email, is dropped. That’s why the sample uses personal_domain, not personal_email_domain.
What Clarify asks, and good answers
| Question | Good answer |
|---|---|
| Which form tool, and what does the payload look like? | Paste a real sample. “Webflow form → our backend → Clay. Object body: email, first_name, last_name, company, employees, country, form_id. Our backend sets an idempotency key.” |
| Existing scoring model? | “None. Build fit in a code node.” |
| Tier thresholds? | “T1: fit 70+ and a demo request. T2: fit 40–69, or a pricing contact. DQ below that.” |
| Routing rule order? | Answered by your routing.owner decision. |
| Tier 1 notification? | “Slack DM to the owner and a call task due the same day.” |
| Sequencer? | “None for T1, the AE calls. T2 goes to the SDR sequence behind the QA gate.” |
| DQ handling? | “Tag in the CRM and send the recorded demo. Never silence.” |
| SLA? | “Under 5 minutes from submit to routed, p95.” |
| Should Clay ever create CRM records? | “Leads only, never accounts.” |
What Gate A should show
The graph:
flowchart LR
W[Webhook: object body + idempotency key] --> N[Code: normalize email/domain, personal flag, parse form]
N --> P{Personal email?}
P -- yes --> PR[Person resolve: name + company → work email]
P -- default --> RC[Resolve company]
PR --> RC
RC --> M[CRM account match]
M --> E{Customer or open opp?}
E -- yes --> OWN[Owner branch: CRM update + Slack to owner. Stop]
E -- default --> SUP[Suppression: DNC, competitor, student, restricted country]
SUP --> FIT[ICP fit + persona classify]
FIT --> TIER[Code: tier = fit × form intent]
TIER --> R{T1 / T2 / DQ}
R -- T1 --> T1[Route owner → CRM upsert → Slack + call task]
R -- T2 --> T2[QA gate → SDR sequence]
R -- default: DQ --> DQ[CRM tag + recorded demo]
OWN --> WB[Write tier, reasons, routed_to, routed_at]
T1 --> WB
T2 --> WB
DQ --> WB
Check:
- Owner and customer checks come before any sequence, and suppression before the paid persona and fit enrichment.
- Every lead reaches a terminal path, the DQ ones included. “Default route → end” is not a path for an inbound lead.
- The sender posts an object and sends
X-Clay-Webhook-Idempotency-Key, stable per submission and reused on retries. A repeated key starts no run. Only webhook URLs under/sources/webhook/honor it. If the plan’s trigger URL is an older/tc-workflows/streams/…URL, the key is ignored and a retry routes the lead twice. - Personal domains go to person resolution, not straight to DQ. A founder on a Gmail address is a real lead.
- Consent before the first live CRM write and the first enroll. Publishing never launches sequences.
The cost is per submission, and it’s small next to the cost of a lost demo. The levers are fill-gaps-only enrichment (conditional on the field being empty), one company enrichment shared by several fills from the same domain (look it up in Audiences first), Classify instead of a Claygent for persona, and phone lookups for T1 only.
The contract (from the B01 card):
| Assertion | Kind |
|---|---|
| Trigger-to-routed p95 under 5 minutes over 50 test fills | measured |
| Routing matches the ops rule table on the historical leads: 100% for existing-owner cases, at least 95% overall | holdout (inbound_history) |
| T1 precision at least 60% (T1s that became SQLs in history) | holdout |
| 100% of leads get a response path | deterministic (graph + test fills) |
| Runs started from the webhook carry an idempotency key | deterministic |
| QA gate upstream of every enroll and every record-creating CRM write | deterministic (graph) |
What Verify proves
Verify replays the historical leads through the draft and compares routed_to and tier with what actually happened. Existing-owner cases must match 100%: routing a customer’s demo request to a new AE is the mistake that ends the play’s credibility. It also sends the same test submission twice with one idempotency key and checks for exactly one run.
The commands, in order
gw client decide acme routing.owner "existing owner, then territory (country + headcount), then weighted round-robin"
gw client decide acme routing.roster "dana.ortiz:2, sam.lee:1, priya.nair:1 (weights)" --note "RevOps sheet, 2026-11"
gw client gold acme inbound_history --csv examples/csv/gold-inbound-history.csv
gw idea acme "route inbound demo requests to the right AE in under 5 minutes; existing accounts go to their owner, Gmail signups still get a path" --id inbound-01
gw questions acme/inbound-01
gw answer acme/inbound-01 Q1 "Object body: email, first_name, last_name, company, employees, country, form_id; our backend sets X-Clay-Webhook-Idempotency-Key"
gw answer acme/inbound-01 --defaults
gw show acme/inbound-01
gw approve acme/inbound-01 --gate A
gw approve acme/inbound-01 --gate B
After publish, point your form backend at the published webhook URL. A live webhook runs the published version only, so a draft you’re still editing never takes production traffic.
Cost levers
- Fill gaps only. Enrich a field when it’s empty, never to overwrite.
- Reuse company enrichment across fills from one domain.
- Classify for persona, not a Claygent. Fixed labels, guarded by
usedUncertain. - Phone lookups for T1 only.
Failure modes
| What you see | What it means | What to do |
|---|---|---|
| A lead routed twice | The sender retried without an idempotency key, or the URL is an old streams URL | Key per submission, /sources/webhook/ URL |
| A HubSpot payload breaks every field reference | HubSpot posts a top-level array, which lands under payload |
Post an object from your backend, or read $.payload[0] |
| Customers’ demo requests go to a new AE | The account match missed a sub-brand | A customer.definition golden record for it |
| A customer gets the SDR sequence | The owner branch isn’t upstream of the sequence on every path | Graph assertion; reject at Gate A |
| DQ leads hear nothing | A default route that ends the run | Every route gets a next step |
Verification
Illustrative. On an isolated twin factory, both gw client decide lines, gw client gold acme inbound_history --csv examples/csv/gold-inbound-history.csv (8 rows imported) and the play commands ran as shown. The scripted runner replays the lookalikes recording for any idea, so the questions, graph and contract above come from the B01 card and 01-clay-workflows-mechanics.md, not from twin output.
Not run: a live webhook, idempotency behavior in Clay, real CRM writes, real stage agents.