The system runs across two separate n8n workflows with clear single responsibilities.


Workflow 1 — Mid-Call Booking Pipeline (8 Nodes)

Fires mid-call via Vapi tool call. Must respond within seconds or the call experience breaks.

Node 1 — Aria Booking Webhook

Method: POST. Receives the booking payload from Vapi mid-call when bookAppointment tool fires. Path: aria-book-appointment.

Node 2 — Validate Inputs

Code node. Checks all required fields are present — callerName, callerEmail, slotTime, callerTimezone. Sanitises input. Structures clean payload for downstream processing.

Node 3 — Book on Cal.com

HTTP Request node. Posts to Cal.com v2 bookings API with correct nested attendee object structure. Includes Authorization, Content-Type, and cal-api-version headers. Creates confirmed calendar event and generates meeting URL.

Node 4 — Booking Success? (IF Node)

Condition: Cal.com response status === success. TRUE path → confirmation stack. FALSE path → failure response.

Node 5 — Log to Supabase

HTTP Request node (TRUE branch). PATCH to Supabase aria_bookings table. Creates the initial lead record with booking details, caller data, and confirmed status.

Node 6 — Slack Alert

HTTP Request node (TRUE branch). Posts structured booking notification to ANR Slack channel with caller name, email, slot time, timezone, problem summary, and meeting URL.

Node 7 — Send Confirmation Email via Brevo

HTTP Request node (TRUE branch). Sends confirmation email to caller from ANR Digital Studios with meeting time, join link, and warm closing.

Node 8 — Respond to Vapi

Webhook response node. Returns success JSON to Vapi so Aria knows the booking succeeded and can close the call naturally.