By GTAVille.com | AI Automation | GoHighLevel | n8n | Retell AI
Did you know there are over 2 million businesses worldwide using GoHighLevel as their CRM? And the wild part? The majority of them are still manually handling their inbound and outbound phone calls in 2025.
According to Gartner, 90% of businesses will be using AI voice agents by 2027. That means right now, there’s a massive window of opportunity to go build and sell this stuff — before everyone else figures it out.
In this guide, I’m going to show you exactly how to build an AI voice agent that can answer the phone, collect caller details, and book appointments directly into a GoHighLevel calendar — all without a human touching anything.
We’re using:
- Retell AI — the voice agent platform
- GoHighLevel — the CRM and calendar
- n8n — the automation backbone connecting everything
Let’s get into it.
What You’re Actually Building
Here’s the full picture before we dive in:
Caller phones in
↓
Retell AI Voice Agent answers
↓
Agent collects name, number, and preferred date
↓
Agent calls get_availability function → n8n webhook
↓
n8n hits GHL API → returns available time slots
↓
Agent reads slots back to caller → caller picks a time
↓
Agent calls schedule_appointment function → n8n webhook
↓
n8n searches GHL for existing contact (or creates new one)
↓
n8n books the appointment into GHL calendar
↓
Agent confirms booking to caller
Clean. Fully automated. No human needed.
Before You Start — What You Need
- A Retell AI account (retellai.com)
- A GoHighLevel sub-account with a calendar set up — sign up here (affiliate link)
- A self-hosted or cloud n8n instance up and running
- Your GoHighLevel Private Integration Token (API key)
- Your GoHighLevel Calendar ID and Location ID
Don’t have those GHL credentials yet? Jump to Step 5 first — I’ll show you exactly where to find them.
Don’t want to set up GoHighLevel yourself? Get in touch with us — we can set up a GHL sub-account for you, either as a practice sandbox or a fully configured, ready-to-use system.
Why Two Functions and Not One
Before touching any code, here’s the most important concept in this whole build — and the mistake that trips up most people.
You need two separate functions:
get_availability— checks the calendar for open slotsschedule_appointment— actually books the appointment
Why not combine them? Because when you do, the AI gets confused. Here’s what happens:
Caller: “I’m free on Tuesday.” Combined function AI: Books the first available Tuesday slot immediately. Doesn’t ask for a preferred time.
That’s not how humans handle a scheduling call. What should happen is:
Caller: “I’m free on Tuesday.” Agent: “Let me check Tuesday for you… We have 10 AM, 12 PM, or 3 PM available — which works for you?” Caller: “12 PM please.” Agent: “Perfect, booking that in now.”
Splitting the functions into get_availability and schedule_appointment gives the agent the natural conversational flow that actually makes sense to callers.
Step 1: Structure Your Retell AI Voice Agent Prompt
You only need to add the appointment scheduling section to your existing agent prompt. Here’s a solid template you can drop straight in:
APPOINTMENT SCHEDULING
Step 1 — Collect the Caller's Name and Phone Number
Before anything else, get the caller's full name (ask them to spell it) and their phone number (repeat it back to confirm).
Step 2 — Find a Date
Ask the caller what day would work best for them to come in.
- If the caller gives multiple days, ask them to choose just one.
- If the caller is unsure, suggest finding the earliest available time that works for them.
- Once you have a specific date, use the get_availability function to check availability.
- Say something natural before running it, like: "Let me just check the schedule for that day."
Step 3 — Present the Available Slots
When the automation returns the available times, present 2–3 options to the caller. If their preferred time is available, confirm it. If not, suggest the closest alternatives.
- If the caller agrees to a slot → move to Step 4.
- If the caller can't do any of the suggested slots → go back to Step 2 and check a different day.
Step 4 — Book the Appointment
Once the caller has confirmed a date and time, use the schedule_appointment function to secure the appointment.
Say something like: "Booking that in for you now."
After the booking is confirmed by the automation, confirm it to the caller:
"Perfect [Name], you're booked in for [Service] on [Day], [Date] at [Time]. You'll receive a confirmation shortly."
Pro tip: Tell the agent to instruct the AI to format the
start_dateasYYYY-MM-DD(e.g.,2025-10-24) in your function parameter description. This makes sure the date parsing in n8n works reliably every time.
Step 2: Create the get_availability Function in Retell AI
Inside your Retell AI agent, go to Functions and create a new function with these settings:
Function Name: get_availability
Description:
Use this function to check the availability of the appointment calendar for a specific date.
Call this ONLY after the caller has confirmed a single specific date they want to check.
API Endpoint: Your n8n webhook URL (production URL — see Step 4)
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
start_date |
string | Yes | The date to check availability for, in YYYY-MM-DD format (e.g., 2025-10-24) |
time_zone |
string | Yes | The caller’s time zone (e.g., America/Toronto, America/New_York) |
Speak During Execution:
Let me just check the schedule for that day.
Step 3: Create the schedule_appointment Function in Retell AI
Create a second function with these settings:
Function Name: schedule_appointment
Description:
Use this function to book an appointment after the caller has confirmed their preferred date and time.
Only call this AFTER the caller has explicitly confirmed a specific time slot.
API Endpoint: Same n8n webhook URL as get_availability
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
full_name |
string | Yes | The caller’s full name as confirmed during the call |
phone_number |
string | Yes | The caller’s phone number as confirmed during the call |
appointment_start_time |
string | Yes | The confirmed appointment date and time in ISO format (e.g., 2025-10-24T15:00:00) |
time_zone |
string | Yes | The caller’s time zone (e.g., America/Toronto) |
Speak During Execution:
Booking that in for you now.
Speak After Execution:
Your appointment has been confirmed. You'll receive a confirmation shortly.
Step 4: Build the n8n Workflow
This is where everything comes together. Download the pre-built workflow at the end of this article and import it into your n8n instance.
But let’s walk through what’s actually happening in each section so you understand it — not just copy it.
How to Import the Workflow
- In n8n, click Workflows in the sidebar
- Click the + button to add a new workflow
- Click the three-dot menu (⋯) → Import from file
- Select the
ghl-voice-agent-n8n-workflow.jsonfile - Click Save
The Workflow Structure
Once imported, you’ll see two main branches flowing from a single webhook:
Webhook (entry point)
↓
Route Function (Switch node)
├── get_availability → Set Vars → Get Free Slots → Return Slots
└── schedule_appointment → Set Vars → Search Contact → Book Appointment
Let’s walk through each part.
The Webhook Node
This is your entry point. Both Retell AI functions point to this same webhook URL.
After importing, activate the workflow and grab the Production URL from the webhook node. This is the URL you paste into both Retell AI functions in Steps 2 and 3.
Format will look like:
https://n8n.yourdomain.com/webhook/ghl-voice-agent
The Route Function (Switch Node)
This is the traffic controller. It reads the name field from the incoming request body and routes it:
- If
namecontainsget_availability→ goes to the availability branch - If
namecontainsschedule_appointment→ goes to the booking branch
Simple but critical. This is what lets you use one webhook URL for both functions.
Branch 1: Get Availability
Set Vars – Availability Node
This is where you fill in your GHL credentials. Open this node and update these three values:
ghl_auth → Bearer YOUR_GHL_PRIVATE_INTEGRATION_TOKEN
calendar_id → YOUR_CALENDAR_ID
location_id → YOUR_LOCATION_ID
Everything else (time zone, date conversion to Unix timestamp) is handled automatically by expressions.
About the date conversion: GHL’s API needs dates as Unix timestamps in milliseconds, not human-readable text. The workflow converts whatever date the agent sends (e.g., “October 24, 2025”) to the millisecond timestamp for midnight that day — then adds 86,400,000ms (24 hours) to get the end of the day. This way it checks all slots within that single day.
Get Free Slots Node
Calls the GHL API:
GET https://services.leadconnectorhq.com/calendars/{calendarId}/free-slots
With startDate, endDate, and timezone as query parameters.
Has Available Slots? (If Node)
Checks if the word "slots" exists in the API response. If yes → return the slots to the agent. If no → tell the agent there’s nothing available and to ask for a different date.
Branch 2: Schedule Appointment
Set Vars – Booking Node
Same credentials to update here:
ghl_auth → Bearer YOUR_GHL_PRIVATE_INTEGRATION_TOKEN
calendar_id → YOUR_CALENDAR_ID
location_id → YOUR_LOCATION_ID
The full_name, phone_number, appointment_start_time, and time_zone values are automatically pulled from the incoming function call — no changes needed.
Search Contact Node
Before booking, the workflow checks if the caller already exists as a contact in GHL. Why? Because in GoHighLevel, you cannot book an appointment for someone who isn’t a contact. And you don’t want duplicate contacts cluttering your CRM.
This hits:
GET https://services.leadconnectorhq.com/contacts/?locationId={id}&query={phone}
Contact Exists? (If Node)
- True (contact found) → Skip straight to booking the appointment using the existing contact’s ID
- False (no contact) → Create a new contact first, then book the appointment
Create Contact Node (only runs for new callers)
Creates a contact with just name, phone, and locationId. That’s all GHL needs to create a valid contact.
Create Appointment Nodes
Books the appointment using:
POST https://services.leadconnectorhq.com/calendars/events/appointments
With calendarId, locationId, contactId, startTime, and title.
Appointment Booked? (If Node)
Checks if the response contains an id (meaning the booking was successful). If yes → sends a success message back to the agent. If no → sends an error message so the agent can handle it gracefully on the call.
Step 5: Get Your GoHighLevel Credentials
Here’s where to find the three values you need to fill into the Set Vars nodes.
Private Integration Token (API Key)
- Log into your GoHighLevel account
- Go to Settings → Integrations → Private Integrations
- Click + Create New Integration
- Give it a name (e.g., “n8n Voice Agent”)
- Copy the token — paste it as
Bearer YOUR_TOKENin theghl_authfield
Location ID
- In GHL, go to Settings → Business Profile
- The Location ID is shown near the top of the page
- It looks something like:
abc123XYZdefGHI456
Calendar ID
- In GHL, go to Calendars → open the calendar you want to use
- In the URL bar, you’ll see something like:
/calendars/settings/abc123... - That
abc123...part is your Calendar ID - Alternatively: Settings → Calendars → click on the calendar → the ID is in the URL
Step 6: Activate and Test
Once you’ve updated both Set Vars nodes with your credentials, you’re ready to test.
Before going live, do a manual chat test inside Retell AI:
- Open your agent in Retell AI
- Use the Test Chat feature (not a live call)
- Walk through this exact flow:
– Say you want to book an appointment – Give a name and phone number – Say you’re available on a specific day – Check that the agent returns real time slots from your GHL calendar – Confirm a time – Check that the appointment appears in your GHL calendar
Common things to check if it’s not working:
| Problem | Likely Cause |
|---|---|
| Webhook not triggering | Workflow not activated, or wrong URL in Retell AI |
| “No slots found” every time | Wrong Calendar ID, or calendar has no availability set |
| Contact not found errors | Wrong Location ID |
| 401 Unauthorized from GHL | Private Integration Token is wrong or expired |
| Date not parsing | AI is sending the date in an unexpected format — add “send as YYYY-MM-DD” to your function parameter description |
Not on GoHighLevel Yet?
If you haven’t got a GoHighLevel account yet, you can sign up using our referral link below. It’s the same price — you just help support GTAVille.com so we can keep making free content like this.
Start your GoHighLevel free trial →
And if you’d rather skip the setup entirely, we’ve got you covered too — scroll down to the “Want Us to Build This For You?” section.
The Business Play — Turning This Into a Service
Now here’s where it gets interesting.
You just built something that 2 million GoHighLevel businesses need and don’t have yet. Most of them are service-based businesses — dental practices, med spas, law firms, real estate agencies, gyms, home services. All of them are paying a receptionist or VA to answer phones and book appointments.
What you’ve built replaces or augments that entirely.
What this is worth:
- A basic AI receptionist setup for a small business: $500–$2,500 one-time setup
- Ongoing management and hosting: $200–$500/month retainer
- For agencies bundling this into a full AI marketing suite: $1,500–$5,000/month
The pitch is simple: “Your AI receptionist answers every call 24/7, never calls in sick, never puts anyone on hold, and books directly into your calendar.”
Who to target first:
- Dental and medical clinics (high call volume, appointment-based)
- Beauty salons and med spas (same)
- Coaching and consulting businesses
- Home service companies (plumbers, electricians, HVAC)
- Any GHL agency that wants to white-label this for their clients
If you’re serious about turning this into a service, the move is to package it — voice agent + missed call text-back + follow-up automations + GHL CRM setup — and sell it as a full AI front desk solution.
That’s how you get to $5K/month retainers instead of $500 one-offs.
Summary — What We Built
Here’s a quick recap of the full stack:
| Component | Tool | Purpose |
|---|---|---|
| Voice Agent | Retell AI | Answers calls, collects info, calls functions |
| Automation | n8n | Connects everything, handles logic |
| CRM + Calendar | GoHighLevel | Stores contacts, holds appointments |
| Functions | get_availability + schedule_appointment | Two-function approach for clean UX |
The key things to remember:
- Always use two functions — combining them breaks the conversational flow
- The Switch node routes both functions through one webhook — clean and scalable
- Set Vars nodes are your config panel — only update those two nodes when deploying for a new client
- GHL requires a contact before booking — the workflow handles this automatically
Download the Free n8n Workflow
Download ghl-voice-agent-n8n-workflow.json
Import it into your n8n, update the two Set Vars nodes with your GHL credentials, grab your webhook URL, paste it into Retell AI, and you’re live.
Want Us to Build This For You?
At GTAVille.com, we build custom AI voice agent systems and full marketing automation suites for service-based businesses — so they can capture, qualify, and convert more leads on autopilot.
Here’s what we offer:
- Full build & setup — We configure your Retell AI agent, n8n workflow, and GoHighLevel calendar end-to-end
- GHL sub-account — Not on GoHighLevel yet, or just want a practice sandbox? We’ll set up a sub-account for you — either to experiment with or a fully ready-to-use system out of the box
- White-label for agencies — Resell this entire system to your own clients under your brand
If you want this set up for your business (or want to resell it to your clients), get in touch with us here.
Already sold on GoHighLevel and want to sign up yourself? Create your GoHighLevel account here → (affiliate link — same price, supports GTAVille.com)
Found this useful? Share it with someone building AI automation. Drop a comment below with your questions — we read every single one.
Tags: GoHighLevel, Retell AI, n8n, AI Voice Agent, Appointment Booking, AI Automation, GoHighLevel Integration, n8n Workflow, AI Receptionist



