Back to Templates
Before setting up the workflow in n8n, ensure you have completed the following foundational steps:
called phone numbercall sidcontacts.readonly, contacts.write, opportunities.readonly, opportunities.write, locations.readonly.
SMS sent No ReplyEngaged | Appointment Link SentBOOKEDThis n8n architecture is divided into three distinct sub-workflows. Here is the node-by-node explanation.
Goal: Detect a missed call, log it in GoHighLevel, and immediately text the prospect.
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.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.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.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.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]").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").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.Goal: Process replies to the initial SMS, use AI to determine if it's a valid HVAC opportunity, and send a booking link.
n8n-nodes-base.twilioTrigger): Listens for incoming SMS messages on your Twilio number.n8n-nodes-base.highLevel): Searches GHL to see if the sender's phone number already exists as a contact.n8n-nodes-base.highLevel): Looks up the specific opportunity associated with this contact in the "Missed call to appointment" pipeline.@n8n/n8n-nodes-langchain.agent): The core AI brain of this sub-workflow. It consists of three integrated parts:
gemini-3.1-flash-lite-preview model to process the prompt and context.{"HVAC_oppurtunity?": "yes"}).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.n8n-nodes-base.twilio): Sends a text message containing your GHL scheduling link to prompt the prospect to book a visit.n8n-nodes-base.highLevel): Moves the GHL opportunity stage forward to "Engaged | Appointment Link Sent".Goal: Finalize the pipeline sequence once the prospect actually books an appointment through your scheduling link.
n8n-nodes-base.webhook): Receives the payload triggered by the GHL automation workflow you created in the prerequisites (fired when an appointment is booked).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.n8n-nodes-base.highLevel): Retrieves the current opportunity linked to this phone number that is currently sitting in the "Engaged" stage.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.n8n-nodes-base.highLevel): Moves the opportunity to its final stage: "BOOKED".