Back to Templates

Recover missed calls and book HVAC appointments with GoHighLevel, Twilio, Gemini

Created by

Created by: iamvaar || iamvaar
iamvaar

Last update

Last update a day ago

Share


Workflow explanation: Watch on YouTube

Automated Missed Call Recovery with Gohighlevel + Twilio + Gemini

Prerequisites for the HVAC n8n Workflow

Before setting up the workflow in n8n, ensure you have completed the following foundational steps:

  • Twilio Call Status Webhook: Set the webhook of Sub-workflow 1 in the Twilio Voice section for "Call Status Changes".
  • GoHighLevel Custom Fields: Create two custom fields in GoHighLevel (GHL):
    1. called phone number
    2. call sid
  • Twilio API Integration: Ensure your Twilio API credentials are ready and configured in n8n.
  • GoHighLevel Developer App: Create a free GoHighLevel Developer App with the following scopes: contacts.readonly, contacts.write, opportunities.readonly, opportunities.write, locations.readonly.
    • Generate the Client ID and Secret within the Developer App.
    • Enter these into the n8n GHL OAuth credentials.
    • Copy the OAuth Redirect URL from n8n to the App OAuth redirection settings and complete the authentication process.
  • GoHighLevel Automation Workflow: Create a workflow inside GHL that triggers when a "New Appointment is Created" and fires a POST webhook to the URL generated by Sub-workflow 3 in n8n.
  • GoHighLevel Pipeline Setup: Create a pipeline in GHL named "Missed call to appointment" with the following 3 stages:
    1. SMS sent No Reply
    2. Engaged | Appointment Link Sent
    3. BOOKED
  • Scheduling Link: Note down your GoHighLevel scheduling link and keep it handy to insert into the Twilio SMS node.

Workflow Breakdown

This n8n architecture is divided into three distinct sub-workflows. Here is the node-by-node explanation.

Sub-Workflow 1: Automated Missed Call Follow-Up

Goal: Detect a missed call, log it in GoHighLevel, and immediately text the prospect.

  • When Webhook Received (n8n-nodes-base.webhook): Acts as the entry point. It receives incoming POST call data from your telephony provider (Twilio) whenever a call status changes.
  • Filter Valid Call Statuses (n8n-nodes-base.if): Evaluates the incoming webhook payload. It only allows the workflow to continue if the CallStatus contains busy, no-answer, or canceled.
  • Prepare Lead Data (n8n-nodes-base.set): Cleans and maps the incoming JSON data. It extracts the caller's phone number, removes the + sign for clean formatting, grabs the called number and CallSid, and attaches specific tags like missed-call-lead.
  • Create Lead in HighLevel (n8n-nodes-base.highLevel): Pushes the cleaned data into GHL to create a new Contact. It maps the custom fields you created (called phone number and call sid) and assigns the hvac-inbound-missed tag.
  • Create Opportunity in HighLevel (n8n-nodes-base.highLevel): Creates a pipeline opportunity for the newly generated lead. It names the opportunity dynamically (e.g., "Missed Call.... [Phone].... [Date/Time]").
  • Send SMS via Twilio (n8n-nodes-base.twilio): Sends the initial outreach text message to the caller (e.g., "Hi, I believe you missed a call with us... Please state your issue directly here").
  • Update Opportunity Status (n8n-nodes-base.highLevel): Updates the GHL opportunity stage to the first stage in your pipeline ("SMS sent No Reply") to track that the initial outreach has occurred.

Sub-Workflow 2: AI-Powered SMS Lead Qualification & Booking

Goal: Process replies to the initial SMS, use AI to determine if it's a valid HVAC opportunity, and send a booking link.

  • When SMS Received (n8n-nodes-base.twilioTrigger): Listens for incoming SMS messages on your Twilio number.
  • Check If Lead (n8n-nodes-base.highLevel): Searches GHL to see if the sender's phone number already exists as a contact.
  • Check Pipeline State (n8n-nodes-base.highLevel): Looks up the specific opportunity associated with this contact in the "Missed call to appointment" pipeline.
  • Lead Analyzer Agent (@n8n/n8n-nodes-langchain.agent): The core AI brain of this sub-workflow. It consists of three integrated parts:
    • The Agent: Prompted to act as an HVAC Opportunity Finder. It evaluates the user's SMS context to determine if they need HVAC services and if it's appropriate to send a booking link.
    • Gemini Chat Model: Uses Google's gemini-3.1-flash-lite-preview model to process the prompt and context.
    • Parse Structured Output: Forces the AI to return a clean JSON response (e.g., {"HVAC_oppurtunity?": "yes"}).
  • If HVAC Opportunity Found (n8n-nodes-base.if): Checks the parsed JSON output from the AI. If the AI determined the answer is "yes" or "yeah", the workflow proceeds.
  • Send Response SMS (n8n-nodes-base.twilio): Sends a text message containing your GHL scheduling link to prompt the prospect to book a visit.
  • Update Lead Opportunity (n8n-nodes-base.highLevel): Moves the GHL opportunity stage forward to "Engaged | Appointment Link Sent".

Sub-Workflow 3: GoHighLevel Appointment Sync & Pipeline Advancement

Goal: Finalize the pipeline sequence once the prospect actually books an appointment through your scheduling link.

  • When Appointment Booked (n8n-nodes-base.webhook): Receives the payload triggered by the GHL automation workflow you created in the prerequisites (fired when an appointment is booked).
  • Check Lead SMS Origin (n8n-nodes-base.highLevel): Queries GHL using the phone number from the appointment payload to ensure it matches up with the correct existing contact record.
  • Check Pipeline State1 (n8n-nodes-base.highLevel): Retrieves the current opportunity linked to this phone number that is currently sitting in the "Engaged" stage.
  • Update Contact in HighLevel (n8n-nodes-base.highLevel): Fills in the missing data gaps. Since the initial missed call only gave you a phone number, this node uses the data submitted in the booking form to update the contact's First Name, Last Name, and Email address.
  • Update Opportunity in HighLevel (n8n-nodes-base.highLevel): Moves the opportunity to its final stage: "BOOKED".