CORTEXFLOW · FREE FOREVER
Automation
Missed-Call Text-Back AI Booker
↓ Download workflow JSON
Import in n8n: Workflows → ⋯ → Import from file, then add your credentials. Free download with a free account.
How it works
Your AI receptionist that never lets a missed call go cold:
- STEP 1 — Twilio webhook + instant response — a missed-call status callback or inbound SMS hits the “Twilio Incoming (Missed Call / SMS)” webhook. “Respond Empty TwiML” answers Twilio immediately with an empty
<Response/>, then “Normalize Twilio Payload” turns the form-encoded params into a standard lead event (event_type:missed_callorsms). - STEP 2 — Config + 24h dedupe — two Config Set nodes (“CONFIG — Business Settings”, “CONFIG — AI + Services”) hold every editable value: business name, owner phone, Twilio number, calendar ID, AI business profile, model. For missed calls, the log is read first — if this caller was already texted in the last 24h, the run stops (no double-texting).
- STEP 3 — Instant text-back + logging — a new missed call is appended to the sheet with status
NEW, a friendly SMS goes out via the Twilio Messages API (“Sorry we missed your call…”), and the sheet flips toCONTACTED. - STEP 4 — AI classifies the reply — inbound SMS rebuilds the conversation history from the Sheets log (“Build History Array”), then “AI Agent — Classify + Draft Reply” (gpt-4o-mini) with the “Structured Output Parser — Intent + Reply” returns
{intent, summary, missing_fields, suggested_reply}. Intents:booking,quote,existing_job,wrong_number,other. - STEP 5 — Booking branch — intent
bookingwith zero missing fields → “Google Calendar — Create Booking” → confirmation SMS → sheetBOOKED→ “Telegram — Owner Alert” pings you a one-line summary. Missing details → the AI’s follow-up question is texted and the sheet flips toREPLIED. - STEP 6 — Quote / wrong-number branches —
quotegets a quote-capture SMS (REPLIED);wrong_numbergets a polite close (DROPPED);existing_job/otherget the AI’s friendly acknowledgement (REPLIED). - STEP 7 — Daily no-reply sweeper — a second flow in the same workflow (“Daily No-Reply Sweeper”, every 2 hours) scans for
CONTACTEDrows older than 2h with no reply → sends exactly one nudge SMS → marksNUDGED.
Status flow in Sheets: NEW → CONTACTED → REPLIED → BOOKED (plus DROPPED, NUDGED)
Set up steps
You’ll need:
- n8n (self-hosted or cloud)
- A Twilio account with a phone number — twilio.com/try-twilio (free trial works; set the number’s voice status-callback URL and SMS webhook to this workflow’s production URL)
- An OpenAI API key — platform.openai.com/signup → API keys
- Google Sheets + Google Calendar OAuth2 credentials — n8n Credentials → Google Sheets OAuth2 / Google Calendar OAuth2
- A Telegram bot — telegram.org → message @BotFather, send
/newbot, copy the token; get your chat ID from @userinfobot
Steps:
- Import the workflow — in n8n, Workflows → Import from File → select
missed-call-textback-ai-booker.json. - CONFIG — Business Settings — open the Set node and fill in:
business_name— e.g.Acme Plumbingowner_phone— your phone in E.164 format (e.g.+1555…)twilio_number— your Twilio number in E.164 formatcalendar_id— your Google Calendar ID (Calendar settings → “Integrate calendar”)nudge_hours— how long before the sweeper nudges a silent lead (default2)
- CONFIG — AI + Services — open the Set node and fill in:
spreadsheet_id— the Google Sheet IDsheet_name— tab name (defaultLeads)twilio_account_sid— from your Twilio consoleopenai_model—gpt-4o-miniby defaulttelegram_chat_id— your Telegram chat IDai_business_profile— describe your services, prices, hours, and booking rules — the AI receptionist’s whole brain lives here
- Create the sheet — in your Google Sheet, make a tab named
Leadswith exactly these headers:Date | Phone | Name | Status | Last Message | Conversation | Intent | Booking Date | Summary | Last Updated. Then select your Google Sheets credential in all ten Sheets nodes (or use the credential prompt on import). - Twilio auth — in each “Send * SMS” HTTP node, select your HTTP Header Auth credential. Set the header name to
Authorizationand the value toBasic <base64(AccountSID:AuthToken)>(encode it once with any base64 tool; the workflow never stores your SID/token in the JSON). - Twilio webhooks — in the Twilio console → your number → Voice: set the Status Callback URL to this workflow’s production webhook URL (POST); Messaging: set “A message comes in” to the same URL (POST).
- Google Calendar + OpenAI + Telegram — select your Google Calendar credential in “Google Calendar — Create Booking”, your OpenAI credential in “OpenAI Chat Model — Booker”, and your Telegram credential in “Telegram — Owner Alert”. Then activate the workflow.
Customize it
- Business tone — rewrite the instant SMS in “Send Instant SMS — Sorry We Missed You” and the nudge in “Send Nudge SMS” to match your brand voice; keep them short and human.
- Booking requirements — edit the
ai_business_profilein “CONFIG — AI + Services” to list exactly what a booking needs (name, address, preferred day/time); the AI only books whenmissing_fieldsis empty, so this text is your real booking form. - Dedupe window — “Check 24h Dedupe” skips callers texted within the last 24h; the sweeper’s quiet window is
nudge_hoursin “CONFIG — Business Settings”. Tighten or loosen both for your call volume. - Quote handling — the quote branch just captures interest today. Route it into a CRM or a pricing sheet by swapping “Send Quote-Capture SMS“‘s follow-on node.
- Quiet hours — add a schedule-aware IF before the SMS nodes if you don’t want 2 AM texts going out; queue them for morning instead.
- Sell it — this is the classic $1.5–3K-setup agency product: clone the workflow per client, swap the two CONFIG nodes, point their Twilio number at it, done.