Case Study — Voice AI
AI Voice Agent for
Appointment Booking
An AI phone agent that handles inbound calls for a dental clinic end-to-end — checking real-time Google Calendar availability, booking and rescheduling appointments by voice, qualifying leads, and triggering post-call CRM automation the moment a call ends.
Call Pipeline
Overview
A Phone Agent That Actually Books the Appointment
Missed calls and after-hours enquiries cost small clinics real bookings, and generic IVR systems can't check live availability or actually reserve a slot. This project builds an AI voice agent for a dental clinic that answers inbound calls, converses naturally, checks real-time calendar availability, and completes the booking — handing off to a human only when the call genuinely needs one.
The Problem
Front Desks Can't Answer Every Call
- Missed and after-hours calls mean lost bookings and frustrated patients
- Basic IVR menus can't check real calendar availability or actually book a slot
- Double-booking risk is real when voice, staff, and calendar aren't tightly synced
- Manual post-call CRM entry and follow-up gets skipped when the front desk is busy
The Solution
Voice Agent + Live Calendar + Automated CRM Sync
A Retell AI voice agent handles the call end-to-end: checking live Google Calendar freebusy, booking or rescheduling directly against a service-account calendar, and qualifying the caller as a lead. A Postgres exclusion constraint guarantees no slot is ever double-booked, and every completed call fires an n8n workflow that syncs the contact and outcome straight into HubSpot.
System Architecture
Live Voice, Live Calendar, Automated Follow-Up
The system was delivered through five gated phases — spec lock, foundation, live voice path, automation, and hardening — with each phase closed only after live verification, not just passing unit tests.
Automation Workflow
The n8n Workflow Behind Post-Call Automation
Every completed call fires this cloud n8n workflow — it upserts the HubSpot contact, creates a deal when an appointment was booked, and branches into notifications, turning a raw `call_ended` webhook into a synced CRM record without any manual entry.
Key Features
Live-Verified, Not Just Demo-Ready
Technical Highlights
Key Engineering Decisions
Slot Exclusivity Over Unique Keys
A Database Constraint, Not Just Application Logic
A unique constraint on calendar_event_idalone doesn't stop two concurrent calls from booking overlapping times before either event ID exists. The fix was a Postgres exclusion constraint on the appointment time range itself, combined with a live re-check against Google Calendar immediately before writing — closing the race condition at the database layer.
Deferring Mid-Call Messaging
Keeping the Live Call Path Lean
Mid-call SMS/email confirmation via Twilio/SendGrid was deliberately deferred out of the live voice phase — the tool ships stubbed (ENABLE_MESSAGING=false) so the call path stays fast and dependency-light, with confirmations instead handled reliably post-call through the n8n automation layer.
Technology Stack
Voice to CRM, Fully Wired
Built By
Development Team
Mujadid Sana
DeveloperMohsin Sabir
DeveloperNeed a voice agent that actually books appointments?
We build voice AI systems that integrate live with your calendar and CRM — not just a chatbot that transcribes calls, but one that completes the transaction.



