Skip to main content
Code on a laptop screen, representing an n8n and Twilio automation being built
Automation guides · 8 min read

How to build missed-call text-back with n8n and Twilio

By Asad Ghaffar ·

You can build missed-call text-back with two n8n workflows and one Twilio number. The first workflow receives the call webhook from Twilio, returns TwiML so the call ends cleanly, then texts the caller, logs the lead and alerts the business owner. The second workflow receives the caller's text replies, logs them and flags urgent ones.

This guide walks through that build, written by Asad Ghaffar, who builds this system for US contractors. It assumes you know your way around n8n and have a Twilio account. If you would rather not build it yourself, the service page explains the done-for-you version.

How the pieces fit together

  1. A customer calls the business number and nobody answers.
  2. The phone carrier's no-answer forwarding sends the call to a Twilio number.
  3. Twilio sends a voice webhook to n8n workflow A.
  4. Workflow A returns TwiML (a short spoken message), then sends the SMS, writes the lead to Google Sheets and alerts the owner.
  5. When the caller texts back, Twilio sends a messaging webhook to n8n workflow B, which logs the reply and raises an urgent alert if it matches keywords such as leak or no heat.

Keeping the business on its existing number is the main design choice. Conditional call forwarding (forward when not answered) is set with the carrier, so callers never see the Twilio number unless they receive the text.

If the business is willing to move its number to Twilio, you can use <Dial timeout="20" action="..."> to ring the owner's phone first. Twilio posts DialCallStatus to the action URL when the dial ends, and you send the text only when it is no-answer or busy. Twilio's default dial timeout is 30 seconds.

Workflow A: the missed call

  1. Webhook node, method POST, with Respond set to 'Using Respond to Webhook node'. Point the Twilio number's 'A call comes in' webhook at its production URL.
  2. Respond to Webhook node, placed straight after the trigger. Respond With: Text. Add a response header Content-Type: text/xml. Body: <Response><Say>Sorry we missed you. We are on a job and will text you now.</Say><Hangup/></Response>
  3. IF node or a Google Sheets lookup that checks whether this caller already got a text in the last 10 minutes. People redial; one text is enough.
  4. Twilio node, operation Send SMS. From: your Twilio number. To: {{ $json.body.From }}. Message: the text you agreed with the business, naming the business and saying how to stop messages.
  5. Google Sheets node, Append Row: caller number, time, call SID, status 'texted'.
  6. Alert to the owner: an email, a Slack message or a second SMS to their own phone with the caller's number.

Respond to Twilio first and do the slow work after. Twilio expects TwiML back quickly; if your workflow waits on Sheets or Gmail before responding, the caller hears silence or an error.

First text (edit for the trade)
Hi, this is [Business name]. Sorry we missed your call, we're on a job right now. What do you need help with? Reply here and we'll get back to you shortly. Reply STOP to opt out.

Workflow B: the caller's reply

  1. Webhook node for the Twilio number's 'A message comes in' webhook, responding with the Respond to Webhook node.
  2. Respond to Webhook: Content-Type text/xml and an empty <Response/>, so Twilio does not send anything back automatically.
  3. Find the caller's row in Google Sheets by phone number and add the reply text and time.
  4. IF node: does the reply contain any urgent keyword the business chose? If yes, send an urgent alert; if not, a normal one.
  5. If the message has media (NumMedia above 0), save the MediaUrl0 link with the lead so the owner can see the photo.

Opt-out keywords such as STOP are handled by Twilio's default opt-out behaviour on US numbers. Test it with a second phone before going live, and never message a number that has opted out.

A2P 10DLC registration comes first

US carriers require businesses that text from a local 10-digit number to register their brand and use case (A2P 10DLC). Unregistered traffic is filtered or blocked, which looks like 'the automation works but nobody receives the text'. Start the registration on day one; approval takes days and you cannot speed it up.

  • Register under the business's own legal name and details, in the business's own Twilio account.
  • Describe the use case honestly: replying to customers who called the business.
  • Include sample messages that name the business and show the opt-out wording.

What breaks in production

  • Wrong content type. Returning JSON or HTML to a voice webhook gives Twilio error 12300. Set text/xml explicitly.
  • Responding late. Put Respond to Webhook immediately after the trigger.
  • Double texts. Spam calls and redials trigger the workflow repeatedly; de-duplicate by number and time window.
  • Silent failures. Add an n8n error workflow that emails you when any step fails, so a broken Google token does not quietly stop every text.
  • Test URLs left in Twilio. n8n's test webhook URL only works while you are listening in the editor; Twilio must point at the production URL.

This is general technical guidance, not legal advice. If the business also wants to send marketing texts, the consent rules are stricter and worth checking with a professional.

Sources

Asad Ghaffar, AI Automation Expert and Full-Stack Developer

Written by Asad Ghaffar

AI Automation Expert & Full-Stack Developer with 3+ years of experience building n8n, Make.com and Zapier automations. He builds lead reply systems for US real estate agents.

Questions & Answers

Questions about this guide

Can n8n send a text when a call is missed?

Yes. Point the Twilio number's incoming-call webhook at an n8n Webhook node, return TwiML with the Respond to Webhook node, then use n8n's Twilio node to send the SMS to the caller's number.

Do I have to move the business phone number to Twilio?

No. Set no-answer call forwarding with the current carrier so only unanswered calls reach the Twilio number. Moving the number to Twilio is optional and lets you control ringing with the Dial verb.

Why does Twilio show error 12300?

Twilio could not read your webhook response as TwiML. Return XML with a Content-Type of text/xml from the Respond to Webhook node.

Do I need A2P 10DLC registration?

Yes, for texting US numbers from a local 10-digit number. Without it messages are likely to be filtered. Register before launch, because approval takes several days.

More guides