Inspiration
Clinicians spend too much time chasing lab results, scheduling follow-ups, and calling patients. We wanted a way to automate outreach so they can focus on care instead of admin. Clarus was built to turn clinical events—lab results, PDFs, missed appointments—into automated workflows that reach patients with AI voice calls, SMS, and scheduling, without extra manual work.
What It Does
Clarus is a healthcare workflow automation platform. Clinicians design workflows in a visual builder (triggers → conditions → actions), add patients, and let the system run outreach automatically. When lab results arrive or a PDF is uploaded, workflows evaluate conditions (age, insurance, lab values) and run actions like AI voice calls via ElevenLabs and Twilio, SMS, Google Calendar scheduling, lab orders, and referrals. The dashboard shows live stats (calls today, answer rate, active workflows), patient profiles with ICD-10/HCC conditions and RAF scores, and call logs with transcripts. Clinicians can import patients from PDFs, run workflows manually, or connect to lab events for fully automated follow-up.
How We Built It
We used a Next.js 16 frontend with React Flow for the workflow builder, Auth0 for auth, and Tailwind CSS for UI. The FastAPI backend runs a Python workflow engine that walks the graph, evaluates conditions, and executes actions. Supabase (PostgreSQL) stores workflows, patients, conditions, medications, and call logs. ElevenLabs Conversational AI handles voice calls via Twilio; a webhook updates call logs and creates Google Calendar events when appointments are confirmed. PDF extraction uses pdfplumber and regex to pull patient and lab data from documents. The frontend talks to the backend via REST, with doctor_id from Auth0 scoping all data per clinician.
Challenges We Ran Into
- Condition branching — Routing workflow execution along true/false branches for condition nodes required careful handling of React Flow edges and source handles.
- ElevenLabs ↔ backend sync — Keeping call status and outcomes in sync between ElevenLabs, Twilio, and our database needed a clear webhook flow and polling fallback.
- PDF parsing — Lab reports vary widely in layout; we had to iterate on regex patterns and table extraction to support common formats.
- Google Calendar auth — Using Auth0 IDP tokens for the Google Calendar API required M2M access to user tokens and correct token refresh logic.
Accomplishments That We're Proud Of
- End-to-end automation — From lab event or PDF upload to AI call and calendar booking without manual steps.
- Visual workflow builder — No-code design of triggers, conditions, and actions with drag-and-drop.
- Clinical depth — ICD-10/HCC conditions, RAF scoring.
- Real integrations — ElevenLabs, Twilio, Google Calendar, and Supabase working together in one flow.
- Full audit trail — Execution logs, transcripts, and reports for every workflow run.
What We Learned
We learned how to model clinical workflows as directed graphs and execute them reliably. Integrating multiple external APIs (ElevenLabs, Twilio, Google) taught us to design for webhooks, polling, and failure handling. Parsing medical PDFs showed how important it is to support varied layouts and fallbacks. We also saw how much clinicians value automation that fits into their existing tools and workflows.
What's Next for Clarus
- EHR integrations — Connect to Epic, Cerner, or other EHRs for real-time lab events instead of manual simulation.
- HIPAA hardening — BAA with ElevenLabs, encryption at rest and in transit, and stricter access controls.
- More triggers — Appointment reminders, prescription refills, annual wellness visits.
- Analytics — Workflow performance, call outcomes, and ROI dashboards.
- Multi-tenant — Support for clinics and health systems with role-based access and org-level settings.
System Design Architecture
High-Level Architecture
┌─────────────────────────────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ ┌─────────────────────────────────────────────────────────────────────────────┐ │
│ │ Next.js 16 Frontend (Vercel) │ │
│ │ • Auth0 (login, user.sub → doctor_id) │ │
│ │ • React Flow (Workflow Builder) │ │
│ │ • Dashboard, Patients, Calls, Triggers, Settings │ │
│ └─────────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────────┘
│
│ REST API (fetch)
│ NEXT_PUBLIC_API_URL
▼
┌─────────────────────────────────────────────────────────────────────────────────────┐
│ API LAYER │
│ ┌─────────────────────────────────────────────────────────────────────────────┐ │
│ │ FastAPI Backend (Render) │ │
│ │ • /api/patients, /api/workflows, /api/call-logs │ │
│ │ • /api/lab-event, /api/pdf/*, /api/elevenlabs/webhook │ │
│ │ • /api/twilio/voice, /api/twilio/gather │ │
│ └─────────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────────┘
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐
│ WORKFLOW ENGINE │ │ EXTERNAL SERVICES │ │ DATA LAYER │
│ • Graph traversal │ │ • ElevenLabs API │ │ Supabase (PostgreSQL)│
│ • Condition eval │ │ • Twilio │ │ • workflows │
│ • Action dispatch │ │ • Google Calendar API│ │ • patients │
│ • Step logging │ │ │ │ • call_logs │
└───────────────────────┘ └───────────────────────┘ │ • patient_conditions│
│ • pdf_documents │
└───────────────────────┘
Data Flow: Lab Event → AI Call → Calendar
┌──────────────┐ POST /api/lab-event ┌──────────────────┐
│ Lab System │ ───────────────────────────►│ FastAPI Backend │
│ or Manual │ {trigger_type, patient_id}│ │
└──────────────┘ │ 1. Query enabled │
│ workflows │
│ 2. Load patient │
│ 3. execute_ │
│ workflow() │
└────────┬─────────┘
│
┌──────────────────────────────────┼──────────────────────────────────┐
▼ ▼ ▼
┌────────────────┐ ┌────────────────┐ ┌────────────────┐
│ Supabase │ │ Workflow │ │ ElevenLabs │
│ • get patient │ │ Engine │ │ initiate_ │
│ • create │ │ • trigger │ │ outbound_call │
│ call_log │ │ • conditions │ │ │
│ • update │ │ • call_patient│ └───────┬────────┘
│ execution_ │ │ action │ │
│ log │ └────────────────┘ │
└────────────────┘ │
▲ │
│ ▼
│ ┌────────────────┐ ┌──────────────┐
│ │ Twilio │ │ Patient │
│ │ (telephony) │◄─────────────│ Phone │
│ └────────────────┘ └──────────────┘
│ │
│ POST /api/elevenlabs/webhook │
│ (call ended, outcome) │
└───────────────────────────────────────────────────────────────────┘
│
▼
┌──────────────────────┐
│ Google Calendar API │
│ (if appointment │
│ confirmed) │
└──────────────────────┘
Component Diagram
┌─────────────────────────────────────────────────────────────────────────────────┐
│ CLARUS SYSTEM COMPONENTS │
├─────────────────────────────────────────────────────────────────────────────────┤
│ │
│ FRONTEND BACKEND EXTERNAL │
│ ──────── ─────── ─────── │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Auth0 │ │ FastAPI │ │ Supabase │ │
│ │ Provider │ │ Router │◄───────────►│ PostgreSQL │ │
│ └─────────────┘ └──────┬──────┘ └─────────────┘ │
│ │ │ │
│ ┌──────▼──────┐ ┌──────▼──────┐ ┌─────────────┐ │
│ │ api.ts │ │ endpoints │ │ ElevenLabs │ │
│ │ (fetch) │◄───────────►│ (REST) │◄───────────►│ ConvAI API │ │
│ └─────────────┘ └──────┬──────┘ └─────────────┘ │
│ │ │
│ ┌─────────────┐ ┌──────▼──────┐ ┌─────────────┐ │
│ │ React Flow │ │ workflow_ │ │ Twilio │ │
│ │ Builder │ │ engine.py │ │ Voice/SMS │ │
│ └─────────────┘ └──────┬──────┘ └─────────────┘ │
│ │ │
│ ┌─────────────┐ ┌──────▼──────┐ ┌─────────────┐ │
│ │ Dashboard │ │ Services │ │ Google │ │
│ │ Patients │ │ • supabase_ │ │ Calendar │ │
│ │ Calls │ │ service │ │ API │ │
│ └─────────────┘ │ • elevenlabs│ └─────────────┘ │
│ │ • pdf_service│ │
│ │ • google_ │ │
│ │ calendar │ │
│ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────────┘
Database Schema (Core Tables)
┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│ workflows │ │ patients │ │ call_logs │
├──────────────┤ ├──────────────────┤ ├──────────────┤
│ id │ │ id │ │ id │
│ doctor_id │ │ doctor_id │ │ workflow_id │──► workflows
│ name │ │ name │ │ patient_id │──► patients
│ nodes (JSONB)│ │ phone, dob, mrn │ │ status │
│ edges (JSONB)│ │ insurance, etc │ │ execution_ │
│ status │ └────────┬─────────┘ │ log │
└──────────────┘ │ └──────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ patient_ │ │ patient_ │ │ pdf_ │
│ conditions │ │ medications │ │ documents │
└──────────────┘ └──────────────┘ └──────────────┘
Deployment Architecture
┌─────────────────────────────────────────────────────────────────────────┐
│ DEPLOYMENT (Render + Vercel) │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ Users │
│ │ │
│ ▼ │
│ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ Vercel │ │ Render │ │
│ │ Next.js Frontend │ HTTP │ FastAPI Backend │ │
│ │ useclarus.vercel │────────►│ uvicorn :8000 │ │
│ │ .app │ │ main:app │ │
│ └─────────────────────┘ └──────────┬──────────┘ │
│ │ │
│ ┌─────────────────────┐ ┌──────────▼──────────┐ │
│ │ Auth0 │ │ Supabase │ │
│ │ (auth provider) │ │ (hosted Postgres) │ │
│ └─────────────────────┘ └─────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
Built With
- auth0
- dagre
- elevenlabs-api
- fastapi
- google-calendar-api
- httpx
- javascript
- lucide
- next.js-16
- node.js
- pdfminer.six
- pdfplumber
- postgresql
- pydantic
- pypdfium2
- python
- react
- react-19
- react-flow
- render
- shadcn/ui
- supabase
- tailwind-css-4
- three.js
- twilio
- typescript
- uvicorn
- vercel
Log in or sign up for Devpost to join the conversation.