Loading...
New Winner – Cross-Border Excellence | Payoneer India 2026 Check out
Featured Recognized by Salesforce; Proven by impact! Check out

This blog outlines how to automate lead qualification in GoHighLevel by integrating an AI model, Gemini, to evaluate leads based on predefined criteria. The process involves creating custom contact fields, setting up workflows, and utilizing a Node.js backend to handle webhooks and API interactions. The workflow captures lead information, assesses it, and updates the contact's qualification status, score, and recommended actions. The guide provides step-by-step instructions for setting up the necessary integrations, workflows, and testing the system to ensure seamless operation.

GoHighLevel workflows can capture lead details and trigger webhooks, but evaluating each prospect against service fit, budget, and purchase readiness requires additional logic. Connecting an AI model makes this evaluation part of the automated process.

With Gemini, submitted lead information can be assessed against predefined scoring criteria to generate a qualification status, score, reason, and recommended next action. Structured JSON output helps the backend process these results and update the corresponding GHL contact fields.

In this blog, we will walk through how to build this workflow using custom contact fields, GHL automation, a webhook, a Node.js backend, and the Gemini API, from form submission to sales follow-up.

The flow looks like this:

Form submitted -> Workflow 1 -> Webhook -> Node.js backend -> Gemini API

⬇

GHL API updates contact fields + adds a tag

⬇

Workflow 2 (tag added) -> pipeline stage, task, notification


Prerequisites

Before setting up the automation, make sure you have the following:

  • GoHighLevel account: Access to forms, workflows, opportunities, custom fields, and Private Integrations.
  • Google AI Studio account: Generate an API key from Google AI Studio.
  • Node.js: Required to run the backend application.
  • Public server URL: Use ngrok for local testing or a hosting platform such as Render, Railway, or Vercel for deployment.
  • Basic technical knowledge: Familiarity with JavaScript, REST APIs, webhooks, and environment variables.


Steps to Automate Lead Qualification in GoHighLevel

Step 1: Create a Private Integration in GHL

The backend needs permission to read and update contacts. GHL provides this through a Private Integration token.

  • Open the sub-account where your form and workflows live.
  • Navigate to: Settings > Private Integrations. If you don’t see it, enable it in the sub-account’s Labs or Advanced settings, depending on your GHL version.

Step 1 4

  • Click Create new Integration.
  • Enter a name and a short description.
  • Select the scopes the backend needs:
    • contacts.readonly
    • contacts.write
  • Click Create and copy the token immediately. GHL shows it only once.
  • Note your Location ID, found in Settings > Business Profile or in the URL after /location/.


Step 2: Create Custom Contact Fields

  • Go to Settings > Custom Fields and create these fields:

Field name Type
Lead Budget Text or dropdown (budget ranges)
Service Required Dropdown or text
Purchase Timeline Dropdown or text
Business Size Text or dropdown
Lead Qualification Score Number
AI Qualification Status Dropdown with exactly: Qualified, Nurture, Needs Review
AI Qualification Reason Large text
AI Next Best Action Large text

Step 2 4

  • Get the custom field IDs, fetch the IDs with this request:GET https://services.leadconnectorhq.com/locations/{locationId}/customFieldsHeaders:Authorization: Bearer YOUR_PRIVATE_INTEGRATION_TOKENVersion: 2021-07-28

The response lists every field with its ID, name, and fieldKey. Copy the IDs of the four AI fields (score, status, reason, next action) for use in Step 5.

Step 3: Create the Lead Qualification Form

  1. Navigate to: Sites > Forms and create a new form.
  2. Add these fields: Name, Email, Phone, Service Required, Purchase Timeline, Budget, Business Size, and an optional Additional Goals / Comments field.
  3. Map each field to the matching custom field, so GHL saves the answers on the contact.
  4. Save the form.


Step 4: Create Workflow 1 to Collect and Send Lead Data

  1. Navigate to: Automation->Workflows and create a new workflow.
  2. Set the trigger to Form Submitted and select your form.
  3. Add these actions in order:
    1. Add Tag: AI Qualification Needed
    2. Create/Update Opportunity: place it in the AI Qualification pipeline stage
    3. Webhook: configured as below
  4. Configure the Webhook action:
    1. Method: POST
    2. URL: https://YOUR-PUBLIC-URL/qualify?key=YOUR_WEBHOOK_SECRET
    3. Custom data:

Step 4 4

  • Save and publish the workflow.
  • The webhook secret is a password you invent. Generate one with: node -e "console.log(require('crypto').randomBytes(24).toString('hex'))"


Use the same value in the webhook URL and in your backend’s .env file.

Step 5: Build the Backend with Gemini

Create a .env file:

Create an index.js file:

  • Run it locally: node index.js
  • To let GHL reach your computer during testing, open a second terminal and run ngrok http 3000. Use the HTTPS address it prints in the webhook URL, followed by /qualify?key=YOUR_WEBHOOK_SECRET.


Step 6: Create Workflow 2 to Act on the Qualification Result

  1. Create a second workflow.
  2. Set the trigger to On Contact AI Qualification Status field Change.
  3. Add actions for each outcome:

Status Suggested actions
Qualified Move the opportunity to Qualified, create a high-priority task for sales, send an internal notification
Nurture Add the lead to a follow-up sequence
Needs Review Create a task for a team member to clarify missing information

 

  • Add a final Remove Tag action for AI Qualification Needed.
  • Save and publish.


Step 7: Test and Validate the Integration

  • Submit a test lead through the GHL qualification form.
  • Verify that the initial workflow adds the tag, creates or updates the opportunity, and sends the webhook.
  • Confirm that the backend receives the lead information and gets a valid response from Gemini.
  • Check that the lead score, qualification status, AI reason, and next step are updated on the GHL contact record.
  • Verify that the second workflow updates the opportunity, adds the correct tag, and creates the sales task.
  • Test error scenarios, including missing data, failed API requests.

 

Conclusion

By integrating Gemini with GoHighLevel, businesses can automate lead evaluation, store AI-generated insights, and trigger relevant sales follow-ups. This approach brings together lead scoring, workflow automation, and API integration to make the qualification process more consistent and easier to manage.

HIC Global Solutions, a Salesforce partner, can help organizations evaluate similar automation requirements across their CRM environment, while teams can extend this workflow with additional scoring criteria, review rules, and reporting as their needs evolve.

Watch Demo Video

Frequently Asked Questions
How can the Gemini API automate lead qualification in GoHighLevel?

The Gemini API evaluates lead details such as budget, service requirements, business size, and purchase timeline to generate qualification scores and recommended sales actions.

How does Gemini assign lead qualification scores?

Gemini scores leads from 0 to 100 based on service fit, budget fit, purchase timeline, and business readiness, helping sales teams prioritize promising prospects.

Can Gemini automatically update GoHighLevel contact records?

Yes, a Node.js backend can send Gemini’s qualification results to GoHighLevel through its API, updating custom fields for scores, status, reasons, and recommended actions.

What are the lead qualification statuses used in this automation?

The workflow uses three statuses: Qualified for promising leads, Nurture for prospects needing more time, and Needs Review for incomplete, contradictory, or ambiguous information.

How can businesses test a Gemini API integration with GoHighLevel?

Submit test leads, verify webhook delivery, validate Gemini’s JSON response, confirm contact field updates, and check that the correct tags, opportunity changes, and sales tasks are triggered.

Related Articles
How to Connect Claude with Notion Using a Custom Connector

Claude becomes more useful when it can access information stored in external platforms such as Notion. This connection helps users retrieve relevant business documents without manually uploading them into Claude. A custom connector built with the Model Context Protocol (MCP) allows Claude to communicate with Notion through a dedicated server. It can search pages and […]

Read More
How to Configure Volume and Attribute-Based Discounts Using Pricing Procedures in Revenue Cloud Advanced

Revenue Cloud helps businesses automate product pricing and manage discounts according to their sales requirements. Salesforce Revenue Cloud supports structured pricing calculations, allowing organizations to apply pricing rules consistently across supported sales transactions. Revenue Cloud Advanced (RCA) provides pricing capabilities that help businesses manage product prices, volume discounts, and attribute-based adjustments. Pricing procedures bring these […]

Read More
How to Connect Salesforce with Claude AI Using an MCP Server

Claude AI can make working with Salesforce CRM data much easier. Instead of manually opening records, building reports, or writing SOQL queries, teams can ask Claude questions in plain English and get answers from their Salesforce org. With Salesforce MCP, users can explore CRM information through a conversational interface, helping them find relevant details with […]

Read More
How to Set Up Salesforce Claudeforce Using the Headless 360 MCP Server

Setting up Salesforce Claudeforce requires more than simply connecting Salesforce with Claude. The process involves beta access, the Salesforce Headless 360 MCP Server, an External Client App, plugin configuration, and user-level permissions. Each part of the setup is important because Claude needs controlled access to Salesforce data and actions while still following the user’s existing […]

Read More
How to Extract Data from PDFs Using OCR.space API in Salesforce

Many times it’s crucial to extract information from documents such as loan statements, invoices, applications, identity documents, and scanned forms. When the information is stored as an image or scanned PDF, it cannot be directly read and used as regular text. This is where Salesforce OCR becomes useful. Optical Character Recognition can convert text from […]

Read More
Passwordless Login with Passkeys in Salesforce: A Practical Setup Guide

Passwordless login with passkeys gives Salesforce users another way to authenticate without entering a traditional password every time. Instead, users can verify their identity through a device, browser, or supported passkey manager. For Salesforce admins and consultants, setting up passkeys requires a little planning. Each user needs access to their own registered passkey, and backup […]

Read More
Our Location worldwide
Indian Flag India
7th Floor, A-10, Pegasus Tower, Sector 68, Noida, Uttar Pradesh 201301 +91-1203669505
United States of America Flag USA
333 West Brown Deer Road Unit G – 366 Milwaukee WI, USA 53217 +1(262) 310-7818
United Kingdom Flag UK
7 Bell Yard, London, WC2A 2JR +44 20 3239 9428
CA Flag Canada
HIC Global Solutions INC
6D - 7398 Yonge St #1124 Thornhill, ON L4J 8J2 Canada +1(262) 310-7818