AutomationFlowsAI & RAG › Automate Lead Qualification & Routing with Gpt-4o-mini, Google Sheets &…

Automate Lead Qualification & Routing with Gpt-4o-mini, Google Sheets &…

Original n8n title: Automate Lead Qualification & Routing with Gpt-4o-mini, Google Sheets & Highlevel CRM

ByRahul Joshi @rahul08 on n8n.io

Automatically qualify and route new leads from a Google Sheet into your CRM with AI-powered scoring and instant sales notifications. Turn raw form submissions into prioritized opportunities—effortlessly. ⚡ Monitors a Google Sheet for new form submissions. 📄 Uses Azure OpenAI…

Event trigger★★★★☆ complexityAI-powered12 nodesGoogle Sheets TriggerAgentLm Chat Azure Open AiGoogle SheetsHigh LevelEmail Send
AI & RAG Trigger: Event Nodes: 12 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #9310 — we link there as the canonical source.

This workflow follows the Agent → Emailsend recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "W0utewh3hTxeQJ63",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automate Lead Qualification & Routing with GPT-4o-mini, Google Sheets & HighLevel CRM",
  "tags": [],
  "nodes": [
    {
      "id": "f21bba3e-5268-4569-aa3f-586879c7c701",
      "name": "Sticky Note - Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1888,
        656
      ],
      "parameters": {
        "color": 4,
        "width": 380,
        "height": 880,
        "content": "## AI-Powered Lead Qualification & Routing\n\nThis workflow automatically scores, categorizes, and routes new leads from Google Sheets using GPT-4o-mini, then syncs them to HighLevel CRM.\n\n## How it works\n\n1. **Trigger**: New lead submitted via Google Form \u2192 Google Sheets\n2. **AI Analysis**: GPT-4o-mini evaluates the lead based on opportunity value, stage, and company info, assigning a qualification score (0-100)\n3. **Categorization**: Leads are tagged as Hot (70+), Warm (40-69), or Cold (<40)\n4. **Storage**: Qualified lead data saved to tracking sheet\n5. **CRM Sync**: Contact automatically created/updated in HighLevel\n6. **Notification**: Sales rep receives email with lead details and AI-generated action items\n\n## Setup steps\n\n1. **Google Sheets**: Connect your account and select the form response sheet. Required columns: Lead Name, Lead email, Lead Contact No., Company Name, Opportunity Value, Stage of Lead\n2. **Azure OpenAI**: Add credentials (API endpoint, key, and GPT-4o-mini deployment name)\n3. **HighLevel CRM**: Connect your GoHighLevel account\n4. **Email**: Configure SMTP settings and update sender/recipient addresses in the \"Send Email to Sales Rep\" node\n5. **Activate**: Turn on the workflow to start processing leads automatically"
      },
      "typeVersion": 1
    },
    {
      "id": "45fc67ec-cd6e-4a8c-960f-2c261d66a110",
      "name": "Sticky Note - AI Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1392,
        624
      ],
      "parameters": {
        "color": 7,
        "width": 392,
        "height": 240,
        "content": "## AI Qualification\n\nGPT-4o-mini analyzes lead data using a scoring rubric: opportunity value (+30), lead stage (+25), company info (+20), complete contact (+15), professional email (+10). Returns structured JSON with score, priority, and action items."
      },
      "typeVersion": 1
    },
    {
      "id": "3231aff8-a7f9-453e-88a7-b6beab1781f0",
      "name": "Sticky Note - Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        640
      ],
      "parameters": {
        "color": 7,
        "width": 328,
        "height": 240,
        "content": "## Data Processing & Storage\n\nParses AI response, handles errors gracefully, then saves enriched lead data to Google Sheets for tracking and reporting."
      },
      "typeVersion": 1
    },
    {
      "id": "889552de-d146-4887-b1ff-54b35cd6c0b7",
      "name": "Sticky Note - Routing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        624
      ],
      "parameters": {
        "color": 7,
        "width": 536,
        "height": 240,
        "content": "## Lead Routing\n\nCategorizes by score (Hot/Warm/Cold), syncs to HighLevel CRM, and emails sales rep with full context and next steps."
      },
      "typeVersion": 1
    },
    {
      "id": "c4f43b9f-58de-4762-980d-071d11555fee",
      "name": "Categorize Lead Priority1",
      "type": "n8n-nodes-base.function",
      "notes": "Assigns priority level based on qualification score:\n- Hot Lead: Score \u2265 70\n- Warm Lead: Score 40-69\n- Cold Lead: Score < 40",
      "position": [
        -400,
        896
      ],
      "parameters": {
        "functionCode": "// Categorize leads based on AI qualification score\nconst score = $json[\"score\"];\nlet stage;\n\nif (score >= 70) {\n  stage = \"Hot Lead\";\n} else if (score >= 40) {\n  stage = \"Warm Lead\";\n} else {\n  stage = \"Cold Lead\";\n}\n\nreturn [{ json: { ...$json, stage } }];"
      },
      "typeVersion": 1
    },
    {
      "id": "24aad0d8-a091-4b8e-bb35-b361acda8486",
      "name": "New Lead Form Submission1",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "notes": "\u26a0\ufe0f CONFIGURE: Connect your Google Sheets account and select the sheet containing form responses. Make sure your sheet has these columns:\n- Lead Name\n- Lead email\n- Lead Contact No.\n- Company Name\n- Opportunity Value\n- Stage of Lead",
      "position": [
        -1424,
        896
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "21c01f29-bd3d-49c6-8ff4-cb2313cecdbc",
      "name": "AI Lead Qualification Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "notes": "Uses Azure OpenAI (GPT-4o-mini) to analyze lead data and provide qualification scores and action items.",
      "position": [
        -1200,
        896
      ],
      "parameters": {
        "text": "=Here is a new lead entry:\n\n[\n  {\n    \"Lead Name\": {{ $json[\"Lead Name\"] }},\n    \"Lead email\": {{ $json[\"Lead email\"] }},\n    \"Lead Contact No.\": {{ $json['Lead Contact No.'] }},\n    \"Company Name\": {{ $json['Company Name'] }},\n    \"Opportunity Value\": {{ $json['Opportunity Value'] }},\n    \"Stage of Lead\": {{ $json['Stage of Lead'] }}\n  }\n]\n\nPlease analyze this lead and provide:\n1. A qualification score (0-100)\n2. Priority level assessment\n3. Specific action items for sales follow-up\n\nFormat your response as JSON with these fields: score, priority, and action_items.",
        "options": {
          "systemMessage": "You are an AI sales assistant specialized in lead qualification. Your job is to analyze incoming lead data and assess the quality and potential of each lead.\n\nAnalysis Guidelines:\n- Evaluate based on Opportunity Value, Stage of Lead, and Company information\n- Assign a qualification score from 0-100 based on:\n  * High opportunity value (>$10k): +30 points\n  * Advanced stage (demo/negotiation): +25 points\n  * Known/established company: +20 points\n  * Complete contact information: +15 points\n  * Professional email domain: +10 points\n\n- Provide practical action items based on lead stage:\n  * \"approaching\" \u2192 Schedule discovery call, Send introductory email\n  * \"demo\" \u2192 Prepare demo materials, Confirm meeting details\n  * \"negotiation\" \u2192 Review pricing options, Prepare proposal\n  * \"won\" \u2192 Initiate onboarding, Notify finance team\n  * \"lost\" \u2192 Log feedback, Add to nurture campaign\n\nResponse Format:\n{\n  \"score\": <number 0-100>,\n  \"priority\": \"<High/Medium/Low>\",\n  \"action_items\": \"<bulleted list of 2-3 action items>\"\n}"
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "b5c42afa-29b5-4df4-b6ce-c00015f05114",
      "name": "Azure OpenAI Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "notes": "\u26a0\ufe0f CONFIGURE: Add your Azure OpenAI credentials here. You'll need:\n- Azure OpenAI API endpoint\n- API key\n- Deployment name for GPT-4o-mini",
      "position": [
        -1136,
        1120
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8d8f3510-0a98-411a-88b4-b8e10ae6332e",
      "name": "Parse AI Response to JSON",
      "type": "n8n-nodes-base.code",
      "notes": "Extracts and structures the AI qualification data. Includes error handling for robust operation.",
      "position": [
        -848,
        896
      ],
      "parameters": {
        "jsCode": "// Parse AI response and structure the data\nlet rawOutput = items[0].json.output;\n\n// Remove markdown code block formatting if present\nrawOutput = rawOutput.replace(/```json\\n?|\\n?```/g, '').trim();\n\n// Parse the JSON response\nlet parsed;\ntry {\n  parsed = JSON.parse(rawOutput);\n} catch (error) {\n  // If parsing fails, create a default structure\n  console.error('Failed to parse AI response:', error.message);\n  parsed = {\n    score: 50,\n    priority: 'Medium',\n    action_items: 'Review lead manually and assign to sales rep'\n  };\n}\n\n// Merge with original lead data\nconst leadData = items[0].json;\nconst result = {\n  ...leadData,\n  ...parsed,\n  processedAt: new Date().toISOString()\n};\n\nreturn [{ json: result }];"
      },
      "typeVersion": 2
    },
    {
      "id": "c034ae38-cfdf-4680-8674-d5f603d6c43b",
      "name": "Save Lead to Status Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Saves qualified lead data to the Lead Status tracking sheet. Configure your Google Sheet document and sheet name here.",
      "position": [
        -624,
        896
      ],
      "parameters": {
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "04dda893-ccaa-482b-8e47-609f6d8f0176",
      "name": "Add Contact to CRM",
      "type": "n8n-nodes-base.highLevel",
      "notes": "\u26a0\ufe0f CONFIGURE: Connect your HighLevel/GoHighLevel CRM account. The workflow will create or update contact records automatically.",
      "position": [
        -176,
        896
      ],
      "parameters": {
        "email": "={{ $json[\"Lead email\"] }}",
        "phone": "={{ $json[\"Lead Contact No.\"] }}",
        "requestOptions": {},
        "additionalFields": {
          "lastName": "={{ $json[\"Lead Name\"].split(' ').slice(1).join(' ') }}",
          "firstName": "={{ $json[\"Lead Name\"].split(' ')[0] }}"
        }
      },
      "credentials": {
        "highLevelOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "28ac9233-5576-491d-b719-f0c83661c2cc",
      "name": "Send Email to Sales Rep",
      "type": "n8n-nodes-base.emailSend",
      "notes": "\u26a0\ufe0f CONFIGURE: Set your SMTP credentials and update the fromEmail and toEmail fields with your actual email addresses.",
      "position": [
        48,
        896
      ],
      "parameters": {
        "text": "=You have been assigned a new lead:\n\nName: {{ $json[\"Lead Name\"] || 'N/A' }}\nEmail: {{ $json[\"Lead email\"] || 'N/A' }}\nCompany: {{ $json[\"Company Name\"] || 'N/A' }}\nPriority: {{ $('Categorize Lead Priority1').item.json.stage }}\nScore: {{ $json.score }}\n\nAction Items:\n{{ $json[\"Action items\"] || 'No action items provided' }}\n\nPlease follow up accordingly.",
        "options": {},
        "subject": "=New {{ $('Categorize Lead Priority1').item.json.stage }} Lead Assigned",
        "toEmail": "={{ $json.salesRepEmail || 'sales-rep@example.com' }}",
        "fromEmail": "={{ $json.senderEmail || 'sender@example.com' }}"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "62b41f04-5f7a-4615-8584-5ad6ce3daf4f",
  "connections": {
    "Add Contact to CRM": {
      "main": [
        [
          {
            "node": "Send Email to Sales Rep",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Lead Qualification Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Categorize Lead Priority1": {
      "main": [
        [
          {
            "node": "Add Contact to CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Lead Form Submission1": {
      "main": [
        [
          {
            "node": "AI Lead Qualification Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Response to JSON": {
      "main": [
        [
          {
            "node": "Save Lead to Status Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Lead to Status Sheet": {
      "main": [
        [
          {
            "node": "Categorize Lead Priority1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Lead Qualification Agent1": {
      "main": [
        [
          {
            "node": "Parse AI Response to JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Automatically qualify and route new leads from a Google Sheet into your CRM with AI-powered scoring and instant sales notifications. Turn raw form submissions into prioritized opportunities—effortlessly. ⚡ Monitors a Google Sheet for new form submissions. 📄 Uses Azure OpenAI…

Source: https://n8n.io/workflows/9310/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow is designed for marketers, content creators, agencies, and solo founders who want to publish long‑form posts with visuals on autopilot using n8n and AI agents. ​

Tool Http Request, Agent, HTTP Request +27
AI & RAG

Streamline your recruitment process with AI-powered resume analysis that goes beyond keyword matching.

Form Trigger, Google Drive, Google Gemini Chat +7
AI & RAG

Description:

Google Sheets, Email Send, Agent +1
AI & RAG

This workflow automates a complete CRM → Sheets → AI → Email reporting pipeline for HighLevel opportunities. It fetches fresh opportunity data from HighLevel, validates and normalizes every record, sy

Lm Chat Azure Open Ai, High Level, Google Sheets +2
AI & RAG

This workflow automates sales performance tracking and motivational updates by integrating HighLevel CRM, Notion, GPT-4o, and Slack. It pulls all deals from HighLevel, cleans and summarizes sales data

High Level, Google Sheets, Notion +3