1. HTTP trigger
Every source posts to one webhook URL (or separate URLs that converge into the same workflow). Authentication via header secret prevents spam submissions.
2. Parse and validate
Reject incomplete payloads early. Phone number formatting to E.164 avoids downstream CRM errors.
3. Score and enrich (AI agent hub)
An OpenAI-assisted step evaluates intent from free-text fields: urgency language, budget mentions, product specificity. In parallel the hub reads:
- Rep roster sheet (who is active this week)
- Territory map (city or pin code to assignee)
Score output drives later branching. High-intent leads skip the queue.
4. CRM write and rep ping
HubSpot (or equivalent) creates or updates the contact. WhatsApp notifies the assigned rep with name, phone, score, and source — not a forward of the raw form.
5. High-intent branch
IF score exceeds threshold:
- Gmail sends a personalised auto-reply to the prospect ("We received your enquiry — [Rep] will call within [X] hours")
- Slack alerts the sales channel for visibility
Lower-intent leads still log to CRM and sheet but may omit the auto-reply to avoid over-promising speed.
6. Audit log
Every lead gets a row in Google Sheets with timestamp, source, assignee, and score. Marketing can finally answer "which channel converts" without guessing.
Assignment logic that survives reality
Territory maps rot when reps go on leave. Production workflows include:
- Active flag per rep in the roster sheet
- Round-robin fallback when territory is ambiguous
- Escalation to a manager WhatsApp when no rep is marked active
Message tone for auto-reply
Auto-replies should set expectation, not sell. Example:
Key Insight
Thank you for your enquiry about [Product]. [Rep Name] from our team will contact you on [Phone] within one business day. Reference: [Lead ID].
Avoid claiming instant callback unless your team can deliver it.
Integration map
| System | Role |
|---|
| Website / ad platform | Webhook source |
| OpenAI | Intent scoring from free text |
| Google Sheets | Rep roster and lead log |
| Postgres or sheet | Territory mapping |
| HubSpot | CRM record |
| WhatsApp | Rep notification |
| Gmail | Prospect auto-reply |
| Slack | High-intent alert |
Common pitfalls
- Duplicate contacts — match on phone before create in CRM.
- After-hours overload — auto-reply always; rep ping can respect quiet hours with a morning batch.
- Portal spam — rate-limit webhook and validate portal signatures where available.
Scope
Straightforward single-source lead capture with scoring, assignment, and one auto-reply channel is a defined scope item. Multi-source normalisation with portal-specific parsers adds complexity but still ships in weeks, not quarters.
See the live workflow diagram on Automations and compare with Lead capture without a spreadsheet for the business case.