⚙ Automation Workflow

n8n workflow that orchestrates the dental office voice agent pipeline. Import the JSON to get started.

🎙 Vapi (Voice AI)
Receives inbound calls, transcribes in real-time, triggers webhooks
● Connected
🧠 n8n Workflow
Orchestrates the call pipeline — routing, lead creation, SMS confirmations
○ Import ready
🗄 AutoFlow CRM
Logs leads, books appointments, stores call transcripts
● Active

Call Flow Diagram

Trigger
📞 Inbound Call
Vapi receives call
AI Agent
🤖 AutoFlow Assistant
Greets, gathers info
Action
📋 Create Lead
POST /api/calls webhook
Decision
📅 Book Appt?
Checks calendar
Yes — slot available
✅ Confirm & Send SMS
n8n sends Twilio SMS confirmation
No — no slots
📝 Log & Notify
Slack alert + follow-up reminder
Post-Call
📊 CRM Update + Analytics
Log transcript, update lead status, track conversion
Optional
📧 Email Digest
Daily summary to office manager
Optional
🔄 HubSpot Sync
Push lead to HubSpot CRM

How to Import into n8n

1

Open n8n → "Templates" or create new workflow

Log in to your n8n instance at app.n8n.io (or self-hosted). Create a blank workflow.

2

Import the JSON below

Click the three dots menu → "Import from JSON" → paste the workflow definition below.

3

Configure credentials

Add your Vapi API key, Twilio credentials, and this server's URL as environment variables in n8n.

4

Point Vapi webhook to n8n

In your Vapi dashboard, set the webhook URL to your n8n endpoint (e.g., https://your-n8n.io/webhook/voice-agent). n8n will relay to AutoFlow via POST https://autoflow-ai-14.polsia.app/api/n8n/leads.

n8n Workflow JSON — paste into n8n "Import from JSON"

🔧 Vapi Setup — Connect Your Voice Agent

Point your Vapi assistant to this server so every inbound call gets logged to the CRM automatically.

Webhook URL for Vapi
https://autoflow-ai-14.polsia.app/api/calls/webhook
Vapi Dashboard Settings
1. Go to Vapi Dashboard → Assistants → Your Assistant
2. Set Server URL to the webhook URL above
3. Set End Call Webhook to receive call-end events
4. Add your VAPI_WEBHOOK_SECRET as an env var in Render to verify webhook authenticity