Deeper · 03.B
One tool. One decision.
dispatch_lead is the only tool the AI receptionist needs. It converts spoken intent into routed work in under one second.
01
What dispatch_lead expects
customer_name— stringcustomer_phone— E.164 formatservice_category— enum (plumbing, dental, locksmith, etc.)location— city + neighborhood when knownurgency— enum (emergency, today, this_week)notes— free text from the call
02
What dispatch_lead does
- 01Validate inputsPhone is valid for the country. Service category exists in the roster.
- 02Insert row in Supabase leads tableStatus pending, source domain stamped, conversion ID linked.
- 03Run provider lookupRoster query: same country + same service + capacity > 0 + last_dispatched < 5 minutes ago is excluded (to avoid spamming).
- 04Build the dispatch payloadCustomer info, service, urgency, scheduled time if any. Plus the Stripe-ready commission record stub.
- 05Fire three notificationsWhatsApp template via SEND-MESSAGE.ts (never direct fetch to graph.facebook.com). Email via Mailgun. SMS via Twilio.
- 06Update lead status to dispatchedReturns the success ack to ElevenLabs so the agent can close the call cleanly.
03
What dispatch_lead must not do
It must not give the customer the provider's direct number. The customer must not be able to bypass bord. That single rule is the entire reason the commission gets paid. The lead is a relationship, not a referral.
The moat is that the customer does not know who they're actually calling. They called bord. bord routed them. The provider serves them. The transaction never has bord's logo on the receipt, but bord owns the transaction.