This guide shows how to connect GoHighLevel, n8n and Claude into one lead pipeline: a lead fills in a form, Claude reads the message and scores it, n8n creates or updates the contact in HighLevel, and only the leads worth a call become opportunities in your pipeline. You get the full importable workflow, the exact API calls, and the rules we follow at Purist when Claude Code builds and maintains workflows like this one.
Every HighLevel endpoint, header and field in this guide was checked on November 14, 2026 against HighLevel's official API specification (the GoHighLevel/highlevel-api-docs repository) and n8n's documentation. The workflow passed n8n's own workflow validator the same day. It is a template: plug in your IDs and credentials, then test it with the request at the end before you send real traffic.
Who Does What in the Stack
| Tool | Its job in this pipeline | Why it is there |
|---|---|---|
| GoHighLevel | Stores contacts and opportunities, then runs your SMS, email and calendar follow-up | It is where your sales team already works |
| n8n | Receives the form, calls Claude, applies your rules, writes to HighLevel | Custom logic, versioned and testable, billed per execution |
| Claude (API) | Reads the free-text message and returns a score, an intent and tags | Forms say a lot in the message box, and rules alone miss it |
| Claude Code | Builds, validates and maintains the n8n workflow from plain instructions | Changes take minutes and every change is checked before it goes live |
The point of the split: HighLevel's own workflows are excellent for messaging and pipeline moves, but scoring with your own model and prompt, version control and complex branching are easier in n8n. HighLevel stays the single place your team looks at.
Before You Start: Four Things From HighLevel
- 1 An access token. HighLevel's API documentation accepts an access token generated for a sub-account, or a Private Integration token of the sub-account. Give it the contacts.write and opportunities.write scopes.
- 2 Your location ID, which is the sub-account ID.
- 3 Your pipeline ID and the ID of the stage where hot leads should land.
- 4 The version header. Every API v2 call needs Version: 2021-07-28.
Get the pipeline and stage IDs with one call. The locationId query parameter is required:
The response lists each pipeline with its stages. Copy the pipeline id and the id of your "hot lead" stage.
If you prefer n8n's built-in HighLevel node, it supports contacts (create or update, get, update, delete), opportunities, tasks and calendar bookings. n8n's credential documentation notes that HighLevel deprecated API v1.0, so new connections use OAuth2 with API v2. We use plain HTTP Request nodes in this guide because they show exactly what is sent, and they work with a Private Integration token.
The Workflow, Node by Node
The flow has nine nodes: Webhook, Normalize and validate, Claude, Parse the score, HighLevel upsert, an IF on the score, HighLevel opportunity, and two webhook replies.
1. Webhook: receive the lead
A POST webhook on the path ghl-lead-intake, set to reply through a Respond to Webhook node, so your form gets a clean JSON answer.
2. Normalize and validate
Bad data is cheaper to stop here than to clean in the CRM. This Code node rejects a missing or malformed email, keeps only digits and the plus sign in the phone number, and holds your HighLevel IDs in one place:
3. Claude: qualify the lead
An HTTP Request to the Anthropic Messages API (POST https://api.anthropic.com/v1/messages) with the header anthropic-version: 2023-06-01 and your API key in an x-api-key header credential. A small, fast model is enough for scoring. The prompt asks for JSON only, and tells the model to score high only when the message states a concrete need, a timeline or a budget:
The node retries three times with a two-second wait, so a brief network error does not lose a lead.
4. Parse the score
Models occasionally wrap JSON in text. This node extracts the JSON between the first and last brace, falls back to a score of 0 if parsing fails, clamps the score between 0 and 100, and adds a tag your HighLevel workflows can react to:
The fallback matters: a parsing problem sends the lead to nurture instead of crashing the workflow, so nobody is lost.
5. HighLevel: upsert the contact
POST https://services.leadconnectorhq.com/contacts/upsert with your bearer token and the Version header. Only locationId is required by the API. The body we send:
The response contains new (true when the contact was created), the contact object and a traceId. We use contact.id in the next step.
One behaviour worth knowing, from HighLevel's own specification: upsert follows the "Allow Duplicate Contact" setting of the location. If that setting checks both email and phone, HighLevel looks for an existing contact in the order you configured. If two different contacts already exist, one with the same email and another with the same phone, the API updates the one that matches the first field in your configured order and ignores the second. So decide that order deliberately before you connect any form.
6. IF: is the score above your threshold?
A number comparison of the score against minScore (70 in the template). Hot leads go to the opportunity step; the rest are already tagged ai-score-nurture in HighLevel, where a nurture workflow can pick them up.
7. HighLevel: create the opportunity
POST https://services.leadconnectorhq.com/opportunities/. HighLevel requires pipelineId, locationId, name, status and contactId. Status accepts open, won, lost, abandoned and all; a new lead is open:
Putting the score in the opportunity name means your sales team sees it on the pipeline board without opening anything.
8 and 9. Reply to the form
The hot branch replies with the opportunity ID, the nurture branch with the contact ID. Your website can use that answer to show a different thank-you message, for example a booking link for hot leads.
Download the Workflow
Once imported:
- 1 Create a Header Auth credential named x-api-key with your Anthropic API key, and select it on the Claude node.
- 2 Create a Bearer Auth credential with your HighLevel token, and select it on both HighLevel nodes.
- 3 Replace YOUR_LOCATION_ID, YOUR_PIPELINE_ID and YOUR_HOT_STAGE_ID in the Normalize and validate node.
- 4 Activate the workflow and point your form at the production webhook URL.
Test It Before Real Traffic
Use the webhook-test path while the workflow is open in the editor, then check three things in HighLevel: the contact exists with the right tags, the opportunity sits in your hot stage with the score in its name, and sending the same request twice updates the contact instead of creating a duplicate.
How Claude Code Builds and Maintains It
At Purist, workflows like this one are built and changed by Claude Code working directly against n8n through n8n's MCP server. The loop is always the same:
- 1 Describe the change in plain language, for example "raise the threshold to 75 and add the intent as a HighLevel tag".
- 2 Claude Code reads the current workflow, edits it, and runs n8n's validator before saving anything.
- 3 Nothing that sends messages is activated without a human go.
- 4 The change is tested with a test request, and the result is checked in the CRM, not assumed.
The rules live in a CLAUDE.md file at the root of the project, so every session starts with them. A short version of the ones that matter here:
What We Learned Running Automations in Production
These come from running Purist's own operations on n8n, Supabase and Claude Code, not from theory.
- A watcher must never change what a human sees. One of our early inbox scripts marked replies as read after processing them, and a prospect's answer went unnoticed for hours. Read-only access, and an alert instead.
- Any endpoint a scheduler can call, the internet can call too. Throttle it: our reply watcher refuses to run more than once every 10 minutes without a secret.
- Use upsert, not create, on every CRM write. Forms get submitted twice; duplicates cost more to clean than to prevent.
- Fall back safely when the model returns something unexpected. The parse step above sends the lead to nurture rather than failing.
- Keep a journal. Every automated step at Purist writes a timestamped line, which is how we find out what happened at 3 am without guessing.
What It Costs to Run
| Piece | Cost |
|---|---|
| GoHighLevel | From $97 a month on Starter, $297 on Unlimited, plus usage (full pricing) |
| n8n | Free self-hosted, or an n8n Cloud plan billed per execution (n8n pricing) |
| Claude API | Billed per token by Anthropic; one scoring call uses a few hundred tokens. Check anthropic.com/pricing for current rates |
Frequently Asked Questions
Does n8n have a GoHighLevel node?
Yes. n8n's HighLevel node covers contacts, opportunities, tasks and calendar bookings. New credentials use OAuth2 with HighLevel's API v2, since API v1.0 is deprecated.
Which HighLevel API header is required?
Every API v2 call needs Version: 2021-07-28, plus the Authorization bearer token.
Why use n8n instead of HighLevel's own workflows?
Keep messaging and pipeline moves in HighLevel. Use n8n when you need your own AI model and prompt, versioned logic, complex branching, or tools HighLevel does not connect to.
Can I use GPT or another model instead of Claude?
Yes. Only the request in step 3 and the parsing in step 4 change; the HighLevel side stays the same.
Will this create duplicate contacts?
Not if you keep the upsert call and set the Allow Duplicate Contact order in HighLevel deliberately, as explained in step 5.
Sources
- HighLevel API specification, contacts and opportunities (github.com/GoHighLevel/highlevel-api-docs), checked November 14, 2026.
- n8n documentation, HighLevel node and HighLevel credentials (docs.n8n.io), checked November 14, 2026.
- Anthropic Messages API documentation (docs.anthropic.com).
Want this pipeline built in your own HighLevel and n8n accounts? Book a free automation audit.
Tags
Steve founded PURIST, a workflow automation studio working with n8n, Make and Claude AI, and is the point of contact on every project. Prices and features in our articles come from vendor documentation and public pricing pages. How we research and score tools.