Core concepts
Architecture
Voxa is a Next.js app paired with a Supabase Postgres, an n8n orchestration backbone on Railway, and four external service providers (Twilio, ElevenLabs, Stripe, Anthropic). The four flows below are the only paths a request takes through the system — anything not on these diagrams is helper code.
Interactive
System overview
The browser talks to Next.js. Next.js verifies webhooks and forwards payloads to n8n. n8n owns every external API call from there — Stripe Meter Events, Twilio calls + WhatsApp, ElevenLabs Conv AI, Cal.com, Anthropic Claude. Supabase Postgres + Realtime is the single source of truth that the dashboard subscribes to.
System overview
Inbound calls fan into the n8n backbone; outbound writes land in Supabase, where Realtime pushes them to the dashboard.
Workflow 1 — Onboarding
Triggered by checkout.session.completed on the Stripe webhook. Provisions the Twilio number, clones the owner's voice on ElevenLabs, creates an EL agent with the canonical 6-tool template, imports the Twilio number into EL, and WhatsApps the owner an activation message — all in one workflow.
W1 — Onboarding
From Checkout completion to a live, callable AI receptionist in five n8n steps.
Workflow 2 — Live tool calls
The EL agent calls one of six webhook tools during a live call. Each branch in W2 must respond in <2 seconds — the EL tool timeout is ~5 seconds, and a slow branch means dead air on the call.
W2 — Live tool calls
Six branches share a single Webhook trigger and a Switch node keyed on the tool name. Each branch ends in a Respond-to-Webhook node.
Workflow 3 — Post-call processing
ElevenLabs fires a post-call webhook 5–15 seconds after the caller hangs up. W3 computes the billable minutes, sends a Stripe Meter Event, runs Claude over the transcript for structured lead extraction, upserts the call + lead in Supabase, and (if the lead scored ≥ 7 or the sentiment is angry) WhatsApps the owner an alert.
W3 — Post-call
Single workflow handles billing, AI summary, persistence, and hot-lead alerts in parallel branches.
Workflows 4 & 5
W4 — Stripe events handles invoice.payment_failed (pauses the agent + WhatsApps the owner) and customer.subscription.deleted (releases the Twilio number, deletes the EL agent, archives the row). W5 — Daily digest runs on a cron at 18:00 IST and WhatsApps each business owner a one-line summary of their day. Both are simpler than W1–W3 and are documented inline in their respective JSON files (n8n/04-stripe-webhooks.json, n8n/05-daily-digest.json).
Why n8n?