AutomationFlowsAI & RAG › Score and Route Gohighlevel Leads with Claude Sonnet, Slack, and Google Sheets

Score and Route Gohighlevel Leads with Claude Sonnet, Slack, and Google Sheets

ByAkshay Chug @akshaychug on n8n.io

This workflow receives new GoHighLevel contacts via webhook, uses Anthropic Claude Sonnet to score and classify them as Hot/Warm/Cold, tags the contact in GoHighLevel accordingly, alerts your team in Slack for hot leads, and logs every lead with reasoning and next steps to…

Webhook trigger★★★★☆ complexityAI-powered16 nodesChain LlmAnthropic ChatSlackHTTP RequestGoogle Sheets
AI & RAG Trigger: Webhook Nodes: 16 Complexity: ★★★★☆ AI nodes: yes Added:

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

This workflow follows the Chainllm → Google Sheets 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": "23MjJQ7qHEFhuqid",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true,
    "templateCredsSetupCompleted": true
  },
  "name": "AI Lead Classifier for GoHighLevel: Score, Tag and Alert with Claude and Slack",
  "tags": [],
  "nodes": [
    {
      "id": "fb952ff5-1871-49ca-96d0-79fb03d8241c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        512
      ],
      "parameters": {
        "color": 0,
        "width": 480,
        "height": 1208,
        "content": "## AI Lead Classifier for GoHighLevel using Claude and Slack\n\nEvery new contact that lands in GoHighLevel gets scored, tagged, and routed automatically -- no manual lead sorting, no missed hot leads.\n\n### How it works\n\n1. GoHighLevel fires a webhook the moment a new contact is created in your account.\n2. The Settings node defines your ideal customer profile -- niche, company size, budget signals, and any keywords that indicate a strong or weak fit.\n3. Claude Sonnet reads the contact details and returns a score from 1 to 10, a tier label (Hot, Warm, or Cold), a one-line reasoning, and a recommended next action.\n4. A Switch node routes the contact into one of three branches based on their tier.\n5. Hot leads (score 7-10) trigger an instant Slack alert with the contact summary and fire an HTTP Request to update the GHL contact with a Hot Lead tag and move them to the correct pipeline stage.\n6. Warm leads (score 4-6) get tagged as Warm Lead and moved to a nurture stage in GHL via API.\n7. Cold leads (score 1-3) get tagged as Cold Lead and are moved to a low-priority stage.\n8. Every contact -- regardless of tier -- is logged to Google Sheets with the score, tier, reasoning, and timestamp.\n\n### Setup steps\n\n- [ ] **GoHighLevel webhook** -- In GHL go to Settings, Integrations, Webhooks and create a new webhook. Paste the URL from the Receive GHL Contact node and set the trigger to Contact Created. Activate this workflow first so the URL is generated.\n- [ ] **GHL API key** -- In GHL go to Settings, API Keys and create a new key. Paste it into the GHL API Key field in the Configure ICP and Settings node.\n- [ ] **GHL Location ID** -- Copy your Location ID from GHL Settings and add it to the Configure ICP and Settings node.\n- [ ] **Settings node** -- Open Configure ICP and Settings and fill in your niche, target company size, keywords that signal a good fit, and keywords that signal a poor fit.\n- [ ] **Claude AI** -- Click the Claude Sonnet sub-node under Classify Lead with Claude, add a new Anthropic credential, and paste your API key from console.anthropic.com.\n- [ ] **Slack** -- Connect your Slack account in Notify Team - Hot Lead and set your channel. Right-click and Disable this node if you do not use Slack.\n- [ ] **Google Sheets** -- Create a sheet called GHL Lead Log with columns: Timestamp, Name, Email, Phone, Source, Score, Tier, Reasoning, Next Action. Connect your Google account in Log Lead to Sheets.\n- [ ] Activate the workflow and create a test contact in GHL to verify all three branches work correctly.\n\n### Customization\n\nAdjust the Hot and Warm score thresholds in the Route by Tier switch node to match your standards. Add GHL pipeline IDs to the HTTP Request nodes to move contacts between pipeline stages automatically. Swap Claude Sonnet for Claude Haiku to reduce cost if lead volume is very high."
      },
      "typeVersion": 1
    },
    {
      "id": "924c443a-8442-4909-93c1-29f86418a67a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        512
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 488,
        "content": "## Receive new GHL contact\n\nGoHighLevel sends a webhook the moment a new contact is created. The Settings node holds your ICP definition, GHL API key, and Location ID -- edit only this node to personalise the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "f001c662-fa5f-4405-89d8-c64ed277bc9e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        512
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 584,
        "content": "## Classify and score with Claude AI\n\nClaude Sonnet reads the contact's name, email, phone, source, and any custom fields and returns a score, tier, reasoning, and recommended next action. Edit the prompt in this node to add any industry-specific signals."
      },
      "typeVersion": 1
    },
    {
      "id": "e999bca2-30a9-4a06-8474-182fd46d72a7",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2592,
        512
      ],
      "parameters": {
        "color": 7,
        "width": 260,
        "height": 584,
        "content": "## Route by tier\n\nA Switch node routes each contact to Hot, Warm, or Cold branch. Each branch tags the contact in GHL via API and takes the appropriate action."
      },
      "typeVersion": 1
    },
    {
      "id": "f25c09fc-c22f-4472-8d63-624d237a72e6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2912,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 648,
        "height": 732,
        "content": "## Act, update GHL and log\n\nHot leads get a Slack alert and GHL tag update. Warm and Cold leads get tagged automatically. Every contact is logged to Google Sheets. Slack is optional -- right-click Notify Team - Hot Lead and Disable if unused."
      },
      "typeVersion": 1
    },
    {
      "id": "27e553bb-d234-46b8-bbbf-fa63d3aa312c",
      "name": "Receive GHL Contact",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1648,
        784
      ],
      "parameters": {
        "path": "ghl-new-contact",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "lastNode"
      },
      "typeVersion": 2
    },
    {
      "id": "52e7a684-1471-420c-ae75-b070b253fccc",
      "name": "Configure ICP and Settings",
      "type": "n8n-nodes-base.code",
      "position": [
        1888,
        784
      ],
      "parameters": {
        "jsCode": "// ================================================\n//  EDIT THIS NODE -- all your settings live here\n// ================================================\n\nconst GHL_API_KEY     = 'YOUR_GHL_API_KEY';\nconst GHL_LOCATION_ID = 'YOUR_GHL_LOCATION_ID';\nconst NICHE           = 'B2B SaaS, marketing agencies, or e-commerce brands';\nconst IDEAL_SIZE      = 'Small to mid-size businesses with 5-200 employees';\nconst GOOD_SIGNALS    = ['automation', 'agency', 'saas', 'marketing', 'scale', 'grow', 'roi'];\nconst BAD_SIGNALS     = ['student', 'just looking', 'not ready', 'no budget'];\nconst HOT_THRESHOLD   = 7;\nconst WARM_THRESHOLD  = 4;\n\n// ================================================\n//  DO NOT EDIT BELOW THIS LINE\n// ================================================\n\nconst body = $input.first().json.body || $input.first().json;\n\nreturn [{\n  json: {\n    ghl_api_key:     GHL_API_KEY,\n    ghl_location_id: GHL_LOCATION_ID,\n    niche:           NICHE,\n    ideal_size:      IDEAL_SIZE,\n    good_signals:    GOOD_SIGNALS.join(', '),\n    bad_signals:     BAD_SIGNALS.join(', '),\n    hot_threshold:   HOT_THRESHOLD,\n    warm_threshold:  WARM_THRESHOLD,\n    contact_id:      body.id || body.contact_id || '',\n    first_name:      body.firstName || body.first_name || '',\n    last_name:       body.lastName  || body.last_name  || '',\n    email:           body.email || '',\n    phone:           body.phone || '',\n    source:          body.source || body.attributionSource || '',\n    company:         body.companyName || body.company || '',\n    notes:           body.additionalInfo || body.notes || '',\n    timestamp:       new Date().toISOString()\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "cc7a419c-48e1-4290-b79b-4c71cffeb85b",
      "name": "Classify Lead with Claude",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2160,
        784
      ],
      "parameters": {
        "text": "=You are a B2B lead qualification specialist. Score this new GoHighLevel contact against the ideal customer profile below.\n\nIDEAL CUSTOMER PROFILE:\nNiche: {{ $json.niche }}\nIdeal company size: {{ $json.ideal_size }}\nStrong fit signals: {{ $json.good_signals }}\nPoor fit signals: {{ $json.bad_signals }}\n\nCONTACT DETAILS:\nName: {{ $json.first_name }} {{ $json.last_name }}\nEmail: {{ $json.email }}\nPhone: {{ $json.phone }}\nCompany: {{ $json.company }}\nSource: {{ $json.source }}\nNotes: {{ $json.notes }}\n\nReturn ONLY valid JSON, no extra text:\n{\n  \"score\": 8,\n  \"tier\": \"Hot\",\n  \"reasoning\": \"One sentence explaining the score\",\n  \"next_action\": \"One specific recommended action e.g. Call within 1 hour, Add to nurture sequence, No action needed\",\n  \"ghl_tag\": \"Hot Lead\"\n}\n\nScore guide: 7-10 = Hot, 4-6 = Warm, 1-3 = Cold\nTier must be exactly one of: Hot, Warm, Cold\nghl_tag must be exactly one of: Hot Lead, Warm Lead, Cold Lead",
        "promptType": "define"
      },
      "typeVersion": 1.4
    },
    {
      "id": "7f097297-bb98-46f6-b59d-64918a4acbea",
      "name": "Claude Sonnet",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        2160,
        976
      ],
      "parameters": {
        "model": "claude-sonnet-4-5",
        "options": {
          "temperature": 0
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "5ff3f46b-98d0-46ef-bcf7-9ceb73d0bcad",
      "name": "Parse Classification",
      "type": "n8n-nodes-base.code",
      "position": [
        2416,
        784
      ],
      "parameters": {
        "jsCode": "const text = $input.first().json.text || '';\nconst cfg  = $('Configure ICP and Settings').first().json;\n\nlet parsed = { score: 5, tier: 'Warm', reasoning: 'Could not parse', next_action: 'Review manually', ghl_tag: 'Warm Lead' };\ntry {\n  const match = text.match(/\\{[\\s\\S]*\\}/);\n  if (match) parsed = JSON.parse(match[0]);\n} catch(e) {}\n\nconst validTiers = ['Hot','Warm','Cold'];\nif (!validTiers.includes(parsed.tier)) parsed.tier = 'Warm';\n\nreturn [{ json: {\n  contact_id:   cfg.contact_id,\n  first_name:   cfg.first_name,\n  last_name:    cfg.last_name,\n  email:        cfg.email,\n  phone:        cfg.phone,\n  company:      cfg.company,\n  source:       cfg.source,\n  timestamp:    cfg.timestamp,\n  ghl_api_key:  cfg.ghl_api_key,\n  ghl_location_id: cfg.ghl_location_id,\n  score:        parsed.score,\n  tier:         parsed.tier,\n  reasoning:    parsed.reasoning,\n  next_action:  parsed.next_action,\n  ghl_tag:      parsed.ghl_tag\n}}];"
      },
      "typeVersion": 2
    },
    {
      "id": "7fe71a35-03dc-4545-957c-9951c4415cd9",
      "name": "Route by Tier",
      "type": "n8n-nodes-base.switch",
      "position": [
        2656,
        784
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Hot",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.tier }}",
                    "rightValue": "Hot"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Warm",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.tier }}",
                    "rightValue": "Warm"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Cold",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.tier }}",
                    "rightValue": "Cold"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "8341358b-5794-47ec-880a-18ba639efe61",
      "name": "Notify Team - Hot Lead",
      "type": "n8n-nodes-base.slack",
      "position": [
        2944,
        560
      ],
      "parameters": {
        "text": "Hot lead just came in via GHL!\n\nName: {{ $json.first_name }} {{ $json.last_name }}\nCompany: {{ $json.company }}\nEmail: {{ $json.email }}\nPhone: {{ $json.phone }}\nSource: {{ $json.source }}\nScore: {{ $json.score }}/10\nReason: {{ $json.reasoning }}\nNext action: {{ $json.next_action }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#hot-leads"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "1ba2f234-7119-436a-b3c0-9c9428d8a3dd",
      "name": "Tag Hot Lead in GHL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3184,
        560
      ],
      "parameters": {
        "url": "={{ 'https://rest.gohighlevel.com/v1/contacts/' + $json.contact_id }}",
        "method": "PUT",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $json.ghl_api_key }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "07f9f1f1-019e-4513-be97-deff515ab31f",
      "name": "Tag Warm Lead in GHL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2944,
        800
      ],
      "parameters": {
        "url": "={{ 'https://rest.gohighlevel.com/v1/contacts/' + $json.contact_id }}",
        "method": "PUT",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $json.ghl_api_key }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "57812360-b1b5-4421-bc10-93ca8bd92d66",
      "name": "Tag Cold Lead in GHL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2944,
        1024
      ],
      "parameters": {
        "url": "={{ 'https://rest.gohighlevel.com/v1/contacts/' + $json.contact_id }}",
        "method": "PUT",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $json.ghl_api_key }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d9257cd7-058b-46cd-bf5b-12fb81637f1b",
      "name": "Log Lead to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3424,
        784
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $json.first_name + ' ' + $json.last_name }}",
            "Tier": "={{ $json.tier }}",
            "Email": "={{ $json.email }}",
            "Phone": "={{ $json.phone }}",
            "Score": "={{ $json.score }}",
            "Source": "={{ $json.source }}",
            "Company": "={{ $json.company }}",
            "Reasoning": "={{ $json.reasoning }}",
            "Timestamp": "={{ $json.timestamp }}",
            "Next Action": "={{ $json.next_action }}"
          },
          "mappingMode": "defineBelow"
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "GHL Lead Log"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.5
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "342c853d-1cde-4d5f-8dbc-940efd70e0b1",
  "connections": {
    "Claude Sonnet": {
      "ai_languageModel": [
        [
          {
            "node": "Classify Lead with Claude",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Route by Tier": {
      "main": [
        [
          {
            "node": "Notify Team - Hot Lead",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Tag Warm Lead in GHL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Tag Cold Lead in GHL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive GHL Contact": {
      "main": [
        [
          {
            "node": "Configure ICP and Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tag Hot Lead in GHL": {
      "main": [
        [
          {
            "node": "Log Lead to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Classification": {
      "main": [
        [
          {
            "node": "Route by Tier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tag Cold Lead in GHL": {
      "main": [
        [
          {
            "node": "Log Lead to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tag Warm Lead in GHL": {
      "main": [
        [
          {
            "node": "Log Lead to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Team - Hot Lead": {
      "main": [
        [
          {
            "node": "Tag Hot Lead in GHL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Lead with Claude": {
      "main": [
        [
          {
            "node": "Parse Classification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure ICP and Settings": {
      "main": [
        [
          {
            "node": "Classify Lead with Claude",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

This workflow receives new GoHighLevel contacts via webhook, uses Anthropic Claude Sonnet to score and classify them as Hot/Warm/Cold, tags the contact in GoHighLevel accordingly, alerts your team in Slack for hot leads, and logs every lead with reasoning and next steps to…

Source: https://n8n.io/workflows/15939/ — 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

Stop treating document review as a manual task. Let AI extract, classify, and route every contract, invoice, and NDA automatically.

HTTP Request, Chain Llm, Email Send +4
AI & RAG

Automatically reads every reply to your cold email campaigns in Instantly.ai, uses Claude AI to understand the intent, and takes the right action . No need ofmanual inbox checking needed. A lead repli

Chain Llm, Anthropic Chat, Slack +3
AI & RAG

This workflow starts when a GoHighLevel opportunity is marked Won, uses Anthropic Claude to generate a tailored welcome email and 6-task onboarding plan,creates tasks in GoHighLevel,then creates a Goo

Chain Llm, Anthropic Chat, HTTP Request +5
AI & RAG

This n8n workflow orchestrates a powerful suite of AI Agents and automations to manage and optimize various aspects of an e-commerce operation, particularly for platforms like Shopify. It leverages La

Google Sheets, HTTP Request, Slack +10
AI & RAG

Fully automates your service order pipeline from incoming booking to supplier confirmation — with built-in SLA enforcement and automatic escalation if a supplier goes silent. 📥 Receives orders via web

HTTP Request, Google Sheets, Agent +4