El problema
The problem
El laboratorio recibía solicitudes de cita por WhatsApp de forma manual. El equipo de recepción invertía tiempo respondiendo las mismas preguntas: disponibilidad, sucursales, instrucciones de preparación, confirmaciones. Fuera de horario, los mensajes quedaban sin respuesta hasta el día siguiente.
The lab received appointment requests via WhatsApp manually. The reception team spent time answering the same questions: availability, locations, preparation instructions, confirmations. Outside business hours, messages went unanswered until the next day.
La solución
The solution
Un agente conversacional en el número de WhatsApp Business del laboratorio que guía al paciente en 5 pasos hacia la confirmación de su cita:
A conversational agent on the lab's WhatsApp Business number that guides the patient through 5 steps to appointment confirmation:
- Selección del estudio o panel de análisis
- Selection of the test or analysis panel
- Elección de sucursal
- Branch selection
- Fecha y horario preferido
- Preferred date and time
- Instrucciones de preparación automáticas (ayuno, hidratación, etc.)
- Automatic preparation instructions (fasting, hydration, etc.)
- Confirmación con folio único
- Confirmation with unique booking ID
El sistema opera 24/7. Fuera de horario registra la solicitud y confirma al día siguiente en cuanto abre el sistema/sistemas.
The system operates 24/7. Outside business hours it logs the request and confirms the next day when the system opens.
Arquitectura
Architecture
Backend en Node.js sobre Railway con webhook de WhatsApp Cloud API. El flujo de conversación combina un state machine para la lógica de negocio (sucursal, horario, estudio) con GPT-3.5-turbo para el lenguaje natural. El historial y los registros de citas se persisten en Supabase.
Node.js backend on Railway with WhatsApp Cloud API webhook. The conversation flow combines a state machine for business logic (branch, time, test) with GPT-3.5-turbo for natural language. History and appointment records are persisted in Supabase.