CRM automation: AI lead scoring and routing into GoHighLevel (n8n)
At a glance
- Setup estimate
- 1–2 h (ESTIMATE)
- Tools
- Industries
- Agencies & consultancies, General (any small business)
Problem
Form leads land in a sheet with no prioritization, and sales responds late
Who it's for
Agencies, founders and small sales teams whose web form (for example a Google Form) writes leads into a Google Sheet and who work leads in HighLevel. The trigger: new rows sit in the sheet unread, nobody knows which to call first, and you want each lead scored, labeled Hot, Warm or Cold, pushed into HighLevel and emailed to a rep within minutes.
Skip it if you don't have Azure OpenAI (the template is built on it), or if you need the score to live inside HighLevel: as shipped, the label only reaches the email (see below).
Tools and what each does
- Google Sheets Trigger
- Polls the sheet every minute for new rows (Lead Name, Lead email, Lead Contact No., Company Name, Opportunity Value, Stage of Lead).
- AI Agent + Azure OpenAI (gpt-4o-mini deployment)
- Scores the lead 0–100 with a rubric in the system message: value over $10k +30, demo/negotiation stage +25, known company +20, complete contact info +15, professional email domain +10. It also returns a priority and stage-based action items.
- Code: Parse AI Response to JSON
- Strips code fences and parses the reply. If parsing fails, it substitutes score 50, priority Medium and 'Review lead manually'.
- Google Sheets (Save Lead to Status Sheet)
- Appends the parsed result to a 'Lead Status' sheet.
- Function: Categorize Lead Priority
- Labels Hot (70+), Warm (40–69) or Cold (under 40).
- HighLevel
- Creates or updates the contact with email, phone, and first/last name split from Lead Name.
- Send Email (SMTP)
- Emails the assigned rep the name, email, company, priority, score and action items.
Browse by tool: n8n, Google Sheets, Azure OpenAI, HighLevel
Steps
- A new form submission lands as a row in your leads sheet; the trigger picks it up on its next one-minute poll.
- The AI agent scores the lead with the rubric and suggests 2–3 action items for its stage.
- The Code node parses the JSON reply (or falls back to a neutral 50/Medium).
- The result is appended to the Lead Status sheet.
- The Function node labels the lead Hot, Warm or Cold.
- HighLevel creates or updates the contact.
- An email goes to the sales rep for every lead, with the label in the subject ('New Hot Lead Assigned').
Known problems in the source template
Found by reading the template's JSON, not by running it. Likely fails as shipped.
Problem: The email reads 'Action items' while the AI returns 'action_items', so the email is likely to always say 'No action items provided'.
Fix: Read action_items in the email node.
Problem: The parser merges the agent's output item, not the original sheet row, so later steps may not see Lead Name, Lead email or phone.
Fix: Reference the sheet trigger's row (Lead Name, Lead email, phone) explicitly in the HighLevel and email steps.
Problem: The description lists the header 'Lead Email' but the nodes read 'Lead email'.
Fix: n8n expressions are case-sensitive, so match the node spelling exactly.
Problem: Every lead triggers a rep email, not only hot ones, and the Hot/Warm/Cold label isn't written to HighLevel or to the Lead Status sheet (labeling runs after the sheet write, and the HighLevel node sets no tag). The rep address falls back to [email protected] unless you set it.
Fix: Add an If on the label so only hot leads email the rep, write the label to HighLevel (as a tag) and to the sheet, and set your rep's address.
Before you start
- An Azure OpenAI resource with a gpt-4o-mini deployment, connected in n8n. Whether the standard OpenAI chat model node works as a drop-in swap is UNKNOWN; we haven't run it.
- A HighLevel account connected via OAuth.
- A Google account connected to n8n, a leads sheet with the headers above and a Lead Status sheet. Both sheet nodes ship with placeholder IDs.
- SMTP credentials and the rep's email address.
- Setup estimate: 1–2 h (ESTIMATE).
What can go wrong
Built for Azure OpenAI and needs a GPT-4o-mini deployment there; whether the standard OpenAI node works as a swap is UNKNOWN (untested). Also needs HighLevel CRM and SMTP email. Spot-check the AI's hot/warm/cold scores.
- Silent failureWhen the AI reply isn't valid JSON, the parser quietly assigns score 50, so the lead is labeled Warm and treated like a real score. Log or flag these fallbacks.
- ModelAzure retires model versions on its own schedule, separate from OpenAI's (OpenAI's API removes gpt-4o-mini on Jan 14, 2027). Check Azure's model-retirements page for your deployment's date.
- Reliability'Known/established company' is the model's guess, and polling every minute uses Google API quota around the clock. Spot-check scores.
- ModelModel status not verified as of Oct 20 2026.
How to adapt it
- Add an If node after labeling so only Hot leads email the rep immediately, and Warm/Cold go into a daily digest.
- Write the label into HighLevel as a tag (and into the sheet) by moving the Function node before the sheet write and adding a tag field in the HighLevel node.
- Rewrite the rubric for your market: change the $10k threshold and stage names to the ones your form uses.
- Assign reps by territory or round-robin with a Switch node before the email, and fill salesRepEmail properly.
- Use a structured output parser on the agent instead of the regex parser, so bad replies fail loudly.
Sources we checked
- Source template: n8n.io workflow 9310 checked
- Template JSON via n8n templates API checked
- OpenAI API deprecations checked
- Azure OpenAI model retirements checked
- Status
- Researched: Sourced and summarized, not yet run end-to-end by us
- Last checked
- Details checked
Setup estimates are rough guesses for someone comfortable with the tools who already has the accounts and API keys. Real time is unknown until tested.