n8n + Twilio Integration: Automate SMS, Calls & WhatsApp Workflows
The n8n Twilio integration connects your automation workflows directly to SMS, voice, and WhatsApp channels — without writing backend code or managing a separate messaging service. If you need to send a text when a form is submitted, call a phone number when a server goes down, or ping your team on WhatsApp when a deal closes, Twilio plus n8n handles it in a few nodes.
Twilio is one of the most popular communication APIs in the world, powering SMS and voice for companies of every size. Pairing it with n8n gives you a visual workflow builder that can react to events from over 400 apps and route messages through Twilio instantly.
Why Combine Twilio with n8n
Most teams that use Twilio end up writing custom scripts to send messages — a Python function here, a Node.js endpoint there. That works until you need to connect Twilio to your CRM, database, monitoring tool, or payment processor. Then you're maintaining glue code across multiple services.
n8n eliminates that glue code. You get a dedicated Twilio node that handles authentication, message formatting, and error handling. You connect it to any other node — Webhook, HTTP Request, Postgres, Shopify, Stripe — and the messages flow automatically.
Key reasons teams pair these tools:
- No code required for standard SMS/voice workflows
- Conditional logic — send different messages based on order value, customer tier, or alert severity
- Multi-channel — SMS, WhatsApp, and voice calls from a single workflow
- Cost control — Twilio charges per message, so n8n's filtering prevents unnecessary sends
- Full visibility — every execution is logged in n8n's execution history
Setting Up Your Twilio Credentials in n8n
Before building workflows, you need to connect your Twilio account to n8n. Here's the setup:
- Log in to your Twilio Console and grab your Account SID and Auth Token from the dashboard
- In n8n, go to Settings → Credentials → Add Credential → Twilio API
- Paste your Account SID and Auth Token into the corresponding fields
- Click Test to verify the connection, then Save
You'll also need at least one Twilio phone number. If you're testing, Twilio's trial account gives you a number and a small credit balance — enough to build and test all five workflows below.
Tip: If you're running n8n on n8nautomation.cloud, your credentials are stored securely on your dedicated instance and encrypted at rest. No shared infrastructure, no credential leaks.
Workflow 1: Send SMS Alerts from Any Trigger
The simplest and most useful Twilio workflow: fire an SMS when something happens. This works with any n8n trigger — a webhook call, a schedule, a database change, or an incoming email.
Nodes used:
- Webhook (trigger) — receives an incoming HTTP POST with alert data
- Twilio → Send SMS — sends the message
Twilio node configuration:
- Resource: SMS
- Operation: Send
- From: your Twilio phone number (e.g.,
+15551234567) - To: the recipient's number — use an expression like
{{ $json.phone }}for dynamic values - Message:
Alert: {{ $json.message }} — triggered at {{ $now.toISO() }}
That's it. Two nodes, and you have SMS alerting for any system that can send an HTTP request. Monitoring tools like Grafana, Uptime Kuma, or custom health checks can POST to your webhook URL, and the recipient gets a text within seconds.
Workflow 2: Automated Order Confirmation via SMS
E-commerce teams love this one. When a customer places an order, they get an instant SMS confirmation — no email delays, no spam folder issues.
Nodes used:
- Webhook (trigger) — receives order data from Shopify, WooCommerce, or Stripe
- IF — checks if the customer provided a phone number
- Twilio → Send SMS — sends the confirmation
Message template:
Hi {{ $json.customer_name }}, your order #{{ $json.order_id }} is confirmed! Total: ${{ $json.total }}. We'll text you when it ships. Reply STOP to opt out.
The IF node is important here. Not every order will have a phone number, and sending to an empty field wastes Twilio credits and throws errors. The condition checks {{ $json.phone }} is not empty before passing data to the Twilio node.
You can extend this with a second Twilio node that fires when the order status changes to "shipped," pulling the tracking number from your fulfillment system and texting it to the customer.
Workflow 3: Two-Factor Verification Codes
Twilio's Verify API is purpose-built for sending one-time passcodes. In n8n, you can build a lightweight 2FA system using the HTTP Request node alongside Twilio's Verify service.
Nodes used:
- Webhook (trigger) — receives a verification request with the user's phone number
- HTTP Request — calls Twilio's Verify API to create a verification (
POST /v2/Services/{ServiceSID}/Verifications) - Respond to Webhook — returns a success response
HTTP Request configuration:
- Method: POST
- URL:
https://verify.twilio.com/v2/Services/YOUR_VERIFY_SID/Verifications - Authentication: Basic Auth with your Account SID and Auth Token
- Body (Form):
To={{ $json.phone }},Channel=sms
A second workflow handles the verification check when the user submits their code. Use another Webhook trigger that receives the phone number and code, then call Twilio's Verification Check endpoint to confirm the code is valid.
Workflow 4: WhatsApp Notifications for Team Alerts
WhatsApp messages have a 98% open rate compared to email's 20%. For internal team alerts — deployment notifications, sales milestones, critical errors — WhatsApp cuts through the noise.
Nodes used:
- Schedule Trigger — runs every morning at 9 AM
- Postgres — pulls yesterday's key metrics (new signups, revenue, active users)
- Twilio → Send SMS — sends via WhatsApp
The trick to sending WhatsApp through Twilio's n8n node: prefix the From number with whatsapp:. So instead of +15551234567, you enter whatsapp:+15551234567. Same for the To field.
Message example:
📊 Daily Metrics — {{ $now.format('MMM d') }}
New signups: {{ $json.signups }}
Revenue: ${{ $json.revenue }}
Active users: {{ $json.active_users }}
Full dashboard: https://your-app.com/dashboard
Workflow 5: Voice Call Escalation for Critical Incidents
SMS is great for most alerts, but when something is truly critical — your production database is down, payment processing fails, or a security breach is detected — you need a phone call. People ignore texts; they don't ignore a ringing phone at 3 AM.
Nodes used:
- Webhook (trigger) — receives critical alert from your monitoring system
- IF — checks severity level (only calls for "critical")
- HTTP Request — initiates a Twilio voice call with TwiML
HTTP Request configuration:
- Method: POST
- URL:
https://api.twilio.com/2010-04-01/Accounts/YOUR_SID/Calls.json - Authentication: Basic Auth (Account SID + Auth Token)
- Body (Form):
To= on-call engineer's numberFrom= your Twilio numberTwiml=<Response><Say voice="alice">Critical alert. {{ $json.service }} is down. Check your dashboard immediately.</Say><Pause length="2"/><Say voice="alice">Repeating. {{ $json.service }} is down.</Say></Response>
You can chain this with a Wait node and a follow-up check. If the incident isn't acknowledged within 10 minutes, call the next person in the escalation chain. This gives you a basic on-call rotation without paying for PagerDuty.
Tips for Running Twilio Workflows in Production
Once your workflows are built and tested, keep these points in mind for reliable production use:
- Handle errors gracefully. Add an Error Trigger workflow that catches Twilio failures (invalid numbers, insufficient balance) and logs them or alerts you via a different channel. Twilio returns specific error codes —
21211means invalid phone number,21610means the recipient unsubscribed. - Rate limit your sends. Twilio allows one SMS per second per phone number by default. If you're sending bulk messages, add a Wait node with a 1-second delay between sends, or use Twilio's Messaging Service with multiple numbers for higher throughput.
- Use expressions for dynamic routing. Rather than hardcoding phone numbers, pull them from your database or a Google Sheet. This makes it easy to update recipients without modifying the workflow.
- Monitor your Twilio spend. Add a weekly scheduled workflow that calls Twilio's Usage API (
/2010-04-01/Accounts/{SID}/Usage/Records) and sends you a summary of costs. Catches runaway loops before they drain your balance. - Keep your n8n instance reliable. If your Twilio workflows handle critical alerts, your n8n instance needs to be running 24/7. A managed instance on n8nautomation.cloud handles uptime, backups, and updates — starting at $15/month, so you're not babysitting a server when you should be responding to the alert it just sent you.
Tip: Store your Twilio phone number in n8n's environment variables rather than hardcoding it in each workflow. This way, if you change numbers, you update one place instead of hunting through every workflow.
Twilio and n8n together cover the full spectrum of business communication — transactional SMS, marketing messages, verification codes, WhatsApp alerts, and emergency voice calls. Each workflow above takes 10-15 minutes to build, and once it's running on a dedicated n8nautomation.cloud instance, you don't need to think about it again until you want to add more channels.