n8n Twilio SMS Automation: Send, Receive, and Reply
Build n8n Twilio SMS automation that sends, receives, and replies to texts. Node config, inbound webhooks, opt-out compliance, and rate limits covered.
A customer calls, the line's busy, the call drops, and that lead is gone to whichever competitor picks up first. n8n Twilio SMS automation catches it: the missed call fires a webhook, n8n texts the caller back within seconds, and the conversation continues over SMS instead of evaporating.
Search this query and you get tutorials that send one outbound text from a spreadsheet and stop. None of them handle the reply. None point a webhook at n8n to receive inbound SMS, branch on what the customer said, or record an opt-out. That's the half that turns a notification script into an actual two-way system, and it's the half this post covers, with the exact Twilio node config.
Sending an SMS is the easy 20%. Receiving and routing the reply is the 80% that makes it useful.
What you can automate with Twilio SMS
The Twilio node (n8n-nodes-base.twilio) sends SMS and WhatsApp messages and can place calls. Paired with a Webhook node for inbound messages, it covers the full conversation:
- Text a missed caller back automatically, within seconds of the dropped call
- Send appointment reminders pulled from a calendar or sheet
- Fire order and shipping updates from a store event
- Receive inbound replies and route them by intent (new lead, question, opt-out)
- Send a one-time code for verification flows
- Blast a paced campaign to a contact list without tripping carrier limits
The first three are outbound-only. The fourth is the one that matters most, because a customer who replies and hears nothing back is worse off than one you never texted.
The Twilio SMS pipeline
OUTBOUND: Trigger → Build message (Set) → Twilio Send SMS → Log
INBOUND: Twilio webhook → n8n Webhook node
→ Classify reply (IF / OpenAI)
→ Branch: opt-out | lead | answer
→ Reply via Twilio + log + alert owner
Two flows, one number. The outbound flow texts people. The inbound flow listens. Wiring only the outbound half is the most common mistake, and it's why so many "SMS automations" feel like a dead end to the person on the other side.
1. Authenticate and send
Create a Twilio credential with your Account SID and Auth Token. In the Twilio node, set the operation to Send SMS, fill To, From (your Twilio number), and Message. The message field takes expressions, so personalize it: Hi {{ $json.firstName }}, sorry the call dropped. The node returns the message SID at {{$json.sid}}, which you log so you can trace delivery later.
2. Receive inbound messages
This is the step the ranking tutorials omit entirely. In your Twilio console, set the number's messaging webhook to an n8n Webhook node URL (n8n-nodes-base.webhook). When someone texts your number, Twilio POSTs the payload, and the fields you'll read are {{$json.body}} for the message text and {{$json.from}} for the sender. Now your workflow can actually react.
The Webhook node's default response is fine for SMS, but note the 120-second timeout: if your reply logic calls a slow API, the work should finish well inside that window or move to an async pattern.
3. Classify the reply
What did they say? An IF node (n8n-nodes-base.if v2) handles simple keyword routing. For anything fuzzier than keywords, the @n8n/n8n-nodes-langchain.openAi v2.1 node classifies intent, returning its output at $json.output[0].content[0].text. Parse that with a Code node (n8n-nodes-base.code v2, jsCode) before the next node reads it. The model returns text; the next node expects a clean field. Add the parse step every time.
4. Branch and reply
Route the classified reply. A STOP-type message goes to the opt-out branch. A genuine lead gets a reply plus an owner alert. A question gets an answer or a handoff. Each branch can send its own Twilio SMS back, closing the loop the customer started.
5. Record opt-outs and log everything
Twilio honors STOP, UNSUBSCRIBE, and START at the carrier level automatically, which keeps you compliant by default. But record it anyway: an IF branch that catches STOP writes the number to a suppressed list in Google Sheets so your outbound workflows skip it. Log every inbound and outbound message with its SID for an audit trail. The missed-call text-back deep dive walks through the full two-way version of this.
Implementation patterns
Pattern 1 — Missed-call text-back
Twilio Status Callback webhook (call no-answer/busy)
→ IF (status === "no-answer" OR "busy")
→ Twilio Send SMS ("Sorry the call dropped, how can the team help?")
→ Google Sheets log
The IF gate matters: without it, the workflow texts back even on answered calls, which annoys customers you actually talked to. Check the call status before sending.
Pattern 2 — Two-way reply triage
Twilio inbound webhook
→ OpenAI classify (new lead / customer / spam)
→ Code (parse JSON)
→ Switch:
lead → Twilio reply + Telegram alert to owner
spam → log + drop
opt-out → suppress number
This is the pattern that earns the "automation" label. The classification plus the parse step turn a raw inbound text into a routed action. Skipping the parse is the silent failure mode: the workflow runs green but the next node reads an empty field.
Pattern 3 — Paced campaign send
Google Sheets (read recipients)
→ Filter out suppressed numbers
→ SplitInBatches (size 1, wait 1s)
→ Twilio Send SMS
→ Sheets update (status = sent)
A standard US long-code number sends roughly 1 SMS per second. Fire 1,000 at once and Twilio queues them anyway, but you lose visibility and risk carrier filtering. Pace with SplitInBatches, or register a Messaging Service for real throughput.
n8n nodes you'll use most
| Node | Purpose |
|---|---|
n8n-nodes-base.twilio | Send SMS and WhatsApp messages, place calls, read message details |
n8n-nodes-base.webhook | Receive inbound SMS and Twilio status callbacks |
@n8n/n8n-nodes-langchain.openAi v2.1 | Classify inbound reply intent (output at $json.output[0].content[0].text) |
n8n-nodes-base.if v2 | Gate the text-back on call status and route replies by intent |
n8n-nodes-base.code v2 | Parse the AI classification JSON before the next node reads it |
n8n-nodes-base.googleSheets | Log messages, recipients, and the suppressed-contacts list |
SMS to US numbers falls under TCPA, and unsolicited texts carry real fines. Twilio auto-handles STOP/START keywords, but you still owe prior consent for marketing texts and a working opt-out path. Transactional texts (a reply to someone who texted you first, an appointment reminder for an existing customer) are lower-risk than cold blasts. Keep a suppressed list and honor it in every outbound workflow.
Getting started
- Create a Twilio credential in n8n with your Account SID and Auth Token.
- Buy or assign a Twilio number capable of SMS.
- Build the outbound Send SMS node and test it against your own phone.
- Add a Webhook node and point your Twilio number's messaging webhook at its URL.
- Wire reply classification, with a Code node to parse any AI output.
- Add the opt-out branch and a suppressed-contacts list.
- Log every message SID so delivery is traceable.
For a complete two-way system that's already wired, the Missed-Call Text-Back Rescue handles both flows out of the box.
Browse the SMS templates →The Missed-Call Text-Back Rescue ships both halves of Twilio SMS automation that this post describes — a core workflow that fires on a Twilio status-callback webhook and texts every missed caller back within seconds, plus a second workflow that catches the inbound reply, runs AI to classify it as new lead, existing customer, or spam, logs it to Google Sheets, and pings you on Telegram with a callback priority. It replaces $99/mo missed-call SaaS for a one-time cost, and it's part of The Complete n8n Templates Bundle, a lifetime license to the whole catalog plus future templates if you run more than one of these.
Twilio SMS automation is only worth building if it listens as well as it speaks. Send the text, point the webhook back at n8n, classify the reply, and honor the opt-out. For related flows, the appointment reminder automation covers scheduled outbound texts, and the Telegram alerts workflow shows the owner-notification half on a different channel. When you want the conversation handled end-to-end, the Voicemail-to-CRM Summarizer extends the same caller-capture idea to voicemail.
See all notification templates →Common questions
How do I send an SMS with n8n and Twilio?
Can n8n receive and reply to inbound SMS?
How do I handle SMS opt-outs in an n8n workflow?
What rate limits apply to Twilio SMS in n8n?
Get the workflow templates this guide is built on
Import-ready n8n JSON, step-by-step setup, and tested end-to-end. One-time payment, own it forever.
Get 3 tested n8n templates, free
The full customer package for three real catalog templates — workflow JSON, step-by-step setup guide, credential checklist. Built through the same live-instance release process as everything we sell. Plus new templates and automation guides in your inbox. No spam, unsubscribe anytime.
- 01Smart To-Do List ManagerPre-built n8n workflow template that automates productivity with OpenAI. Live in about 10 minutes.$14
- 02Email Follow-Up AutomatorPre-built n8n workflow template that automates crm with OpenAI. Live in about 15 minutes.$12
- 03Market Trend AnalyzerPre-built n8n workflow template that automates data processing with OpenAI. Live in about 10 minutes.$14
More automation guides

n8n Retry Logic: Backoff, Idempotency, and Safe Retries
The API you're calling is going to fail sometimes. Not because you did anything wrong, but because networks blip, rate limits kick in, and third-party services have bad afternoons. Good n8n retry logi…

n8n Error Handling: Catch, Notify, and Never Lose a Run
A workflow that fails silently is worse than no workflow at all, because you trust it right up until the day you discover it stopped running last Tuesday. Solid n8n error handling is the difference be…

n8n Cloud vs Self-Hosted: The Real Cost Breakdown
The n8n Cloud vs self-hosted question has a boring, correct answer that most articles dodge: it depends on whether your time is cheaper than a server. On the invoice, self-hosting wins nearly every ti…