Inspiration

Healthcare accessibility remains a significant challenge, with patients often facing long wait times on hold, complex phone menu systems, and difficulty scheduling appointments outside business hours. We were inspired to create ClinicFlow after experiencing these frustrations firsthand.

Our vision was to leverage AI voice technology to make healthcare scheduling as simple as having a conversation with a friendly receptionist—available 24/7, understanding natural language, and handling the entire booking process autonomously.

What it does

ClinicFlow Voice Navigator is an intelligent voice-based appointment scheduling system that:

Answers calls 24/7 with a natural, empathetic AI voice assistant named "Ava" Verifies patient identity by phone number lookup in real-time. Registers new patients on the fly, collecting necessary information conversationally. Checks provider availability across multiple doctors and specialties. Books appointments with instant confirmation and conflict prevention. Retrieves existing appointments for patients who need to check their schedule. Handles complex conversations including clarifications, preferences, and edge cases.

Patients simply call the clinic number, speak naturally about their needs, and Ava handles everything from identity verification to appointment confirmation—no button pressing, no waiting on hold.

LIVE DEMO Call: +1-620-350-9126 Say: "I need to schedule an appointment" Follow the natural conversation to book!

How we built it

Architecture:

Voice Interface: MS Millis (Bland AI) for natural speech-to-text, text-to-speech, and conversation flow Backend: Node.js/Express deployed on Google Cloud Run for serverless scalability Database: PostgreSQL (Google Cloud SQL) for storing patients, providers, appointments, and availability slots Real-time Logging: Google Cloud Firestore for call analytics and debugging Integration: Custom webhook handlers connecting MS Millis function calls to database operations

Technology Stack: Frontend (Voice): MS Millis + ElevenLabs Voice AI Backend: Node.js 20, Express.js, PostgreSQL driver (pg) Infrastructure: Google Cloud Run, Cloud SQL (PostgreSQL), Firestore Database: PostgreSQL with relational schema (providers, patients, appointments, slots) API Integration: RESTful webhooks with JSON payload handling

Development Process: Designed database schema with proper relationships and constraints Created seed data for demo providers and appointment slots Built modular webhook handlers for each function (verify, check availability, book, register) Configured MS Millis agent with ElevenLabs voice and conversation prompts Deployed to Cloud Run with Cloud SQL Unix socket connectivity Iteratively debugged MS Millis payload format and parameter handling Implemented transaction safety for concurrent booking prevention

Challenges we ran into

1. Cloud SQL Connection Configuration Initially deployed to Cloud Functions Gen2, which doesn't support Unix socket connections for Cloud SQL. After encountering deployment errors, we pivoted to Cloud Run, which natively supports /cloudsql/ socket paths.

2. MS Millis Webhook Format Discovery MS Millis doesn't document their webhook payload structure. Through extensive logging, we discovered they send parameters directly in the request body (not nested under a parameters field) and don't include an explicit action field. We implemented auto-detection logic based on parameter combinations.

3. Database Schema Mismatch Initial queries failed because we assumed column names like patient_id and provider_id, but the actual schema used id for primary keys. We added aliases in SELECT statements to maintain consistency.

4. Provider ID Type Confusion Demo data used string IDs (DOC_001, DOC_002) while MS Millis initially sent integers (1, 2, 3). We built a flexible mapper function that accepts both formats and provider names ("Dr. Martinez" → "DOC_001").

5. Concurrent Booking Race Conditions Multiple callers could theoretically book the same slot simultaneously. We implemented PostgreSQL transactions with FOR UPDATE row locking to ensure atomic booking operations.

6. Real-time Debugging Without access to MS Millis's internal logs, debugging required adding comprehensive logging to every webhook endpoint, then tailing Cloud Run logs during live call tests.

Accomplishments that we're proud of

✅ End-to-End Working System: From call pickup to appointment confirmation, the entire flow works seamlessly ✅ Natural Conversation Flow: Ava handles interruptions, clarifications, and edge cases gracefully without sounding robotic ✅ Production-Ready Architecture: Deployed on scalable cloud infrastructure with proper database transactions and error handling ✅ Zero Downtime Registration: New patients can be registered during the call without needing to visit the clinic first ✅ Real-World Data Integrity: Implemented proper transaction handling to prevent double-bookings and data corruption ✅ Flexible Integration: Built a webhook system that auto-detects function calls and handles multiple parameter formats ✅ Comprehensive Error Handling: Every function returns user-friendly messages even when technical errors occur

What we learned

Technical Insights:

Cloud Run vs Cloud Functions: Understanding when to use each service based on connectivity requirements PostgreSQL Transactions: Implementing row-level locking for concurrent access scenarios Webhook Debugging: Building robust logging to reverse-engineer undocumented API formats Voice AI Limitations: Designing prompts that guide natural conversations without being prescriptive

Product Insights:

User Experience First: The best technology is invisible—patients shouldn't need to think about how to interact with the system Error Recovery: In voice interfaces, every error needs a conversational recovery path, not just an error code Context Preservation: Maintaining conversation context across multiple function calls is critical for natural flow

Process Insights:

Iterative Debugging: Real-world integrations require patience and systematic debugging Schema Planning: Upfront database design prevented major refactoring during implementation Minimal Viable Product: Focusing on core booking flow first allowed us to deliver a working demo on time

What's next for ClinicFlow Voice Navigator

Short-term Enhancements:

SMS Confirmations: Send appointment reminders and confirmation codes via Twilio Appointment Modifications: Allow patients to reschedule or cancel via voice Insurance Verification: Integrate with insurance APIs for real-time eligibility checks Multi-language Support: Add Spanish, Mandarin, and other language options

Medium-term Features:

Symptom Pre-screening: Ask relevant medical questions before booking to route to appropriate specialists Wait-list Management: Automatically notify patients when earlier slots become available Provider Preferences: Learn patient preferences (preferred doctor, time of day) for smarter suggestions Dashboard Interface: Web portal for clinic staff to monitor calls and manage availability in real-time

Long-term Vision:

Multi-clinic Support: Scale to clinic networks with centralized scheduling EHR Integration: Sync with Epic, Cerner, and other electronic health record systems Prescription Refills: Extend voice AI to handle medication renewal requests Telemedicine Routing: Automatically offer virtual appointments when appropriate Voice Biomarker Analysis: Detect stress or health deterioration patterns in voice for early intervention

Business Model:

Per-clinic SaaS: Monthly subscription based on call volume API Access: Allow other healthtech companies to integrate our scheduling engine White-label Solution: Customizable voice assistant for healthcare systems

Built With

Share this project:

Updates