Send WhatsApp Message
Sends a WhatsApp message to a specified phone number using the Twilio API for WhatsApp. This node enables you to integrate WhatsApp messaging into your automation workflows for richer customer communication.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Prerequisites
Before using WhatsApp messaging, you must:
- Enable WhatsApp in your Twilio account
- Configure a WhatsApp Sender - Set up a WhatsApp-enabled phone number in Twilio Console
- Complete WhatsApp Setup - Follow Twilio's WhatsApp setup process including business verification (if required)
WhatsApp messaging requires additional setup beyond standard Twilio SMS. Visit Twilio's WhatsApp documentation for setup instructions.
Input
- Connection Id - The Twilio connection identifier from the Connect node. This is optional if you provide credentials directly in the Options.
- From Number - Your Twilio WhatsApp-enabled phone number (without the
whatsapp:prefix). Must be in E.164 format (e.g.,+14155552671). The node automatically adds thewhatsapp:prefix. - To Number - The recipient's WhatsApp phone number (without the
whatsapp:prefix). Must be in E.164 format (e.g.,+14155552672). The node automatically adds thewhatsapp:prefix. - Message - The WhatsApp message content to send. WhatsApp supports longer messages than SMS and preserves formatting.
Output
- Response - The Twilio API response containing message details including:
sid- Unique message identifierstatus- Message status (queued, sent, delivered, read, failed)to- Recipient WhatsApp number (withwhatsapp:prefix)from- Sender WhatsApp number (withwhatsapp:prefix)body- Message contentdate_created- Timestamp when message was createdprice- Cost of the messagenum_media- Number of media attachmentserror_code- Error code if message failederror_message- Error description if message failed
Options
- Account SID - Your Twilio Account SID. This is optional if you're using a Connection Id from the Connect node.
- Auth Token - Your Twilio Auth Token. This is optional if you're using a Connection Id from the Connect node.
WhatsApp messages are generally cheaper than SMS and support richer formatting and media. However, they require recipients to have WhatsApp installed.
Examples
Example 1: Send Order Confirmation
Send an order confirmation via WhatsApp:
Inputs:
- Connection Id:
connection_id(from Connect node) - From Number:
+14155552671 - To Number:
+14155552672 - Message:
Thank you for your order!
Order #: 12345
Total: $129.99
Items:
- Product A (x2)
- Product B (x1)
Estimated delivery: Jan 20, 2024
Track your order: https://example.com/track/12345
Output:
{
"sid": "SM1234567890abcdef1234567890abcdef",
"status": "queued",
"to": "whatsapp:+14155552672",
"from": "whatsapp:+14155552671",
"body": "Thank you for your order!...",
"date_created": "2024-01-15T10:30:00Z",
"price": "-0.0050",
"price_unit": "USD"
}
Example 2: Customer Support Response
Automate customer support responses:
Flow Structure:
- Receive Message - Get incoming WhatsApp message
- If-Else - Check message content for keywords
- Send WhatsApp Message - Send appropriate response
Message Examples:
- If message contains "hours": "Our business hours are Monday-Friday, 9 AM - 5 PM EST."
- If message contains "return": "To initiate a return, please visit: https://example.com/returns"
- If message contains "support": "A support agent will contact you shortly. Ticket #
{{ticket_id}}"
Example 3: Appointment Reminders
Send WhatsApp appointment reminders from a database:
Flow Structure:
- Schedule Trigger - Run daily at 9 AM
- Database Query - Get appointments for tomorrow
- For Each - Loop through appointments
- Send WhatsApp Message - Send personalized reminder
Message Template:
Appointment Reminder
Hi {{customer_name}},
You have an appointment scheduled:
Date: {{appointment_date}}
Time: {{appointment_time}}
Service: {{service_type}}
Location: {{location_address}}
Please reply:
- CONFIRM to confirm
- CANCEL to cancel
- RESCHEDULE to change time
See you soon!
Example 4: Bulk WhatsApp Campaign
Send promotional messages to customer list:
Flow Structure:
- Excel - Read Range - Read customer contacts
- For Each - Loop through customers
- Delay - Wait 2 seconds between messages (rate limiting)
- Send WhatsApp Message - Send personalized offer
Message:
Special Offer for {{customer_name}}!
Get 20% off your next purchase with code: SPECIAL20
Valid until {{expiry_date}}
Shop now: {{shop_url}}
Reply STOP to unsubscribe.
WhatsApp has strict policies against spam. Only send messages to customers who have opted in to receive WhatsApp communications from your business.
Example 5: Multi-Language Support
Send messages in customer's preferred language:
Flow Structure:
- Database Query - Get customer info including language preference
- Switch - Route based on language
- Send WhatsApp Message - Send in appropriate language
English Message:
Hello {{name}}, your package has been delivered!
Spanish Message:
Hola {{name}}, ¡tu paquete ha sido entregado!
French Message:
Bonjour {{name}}, votre colis a été livré!
Tips
- Phone Number Format - Input numbers WITHOUT the
whatsapp:prefix. The node adds it automatically. Use E.164 format:+[country code][number]. - Message Length - WhatsApp supports much longer messages than SMS (up to 4,096 characters) without additional charges for length.
- Formatting - WhatsApp preserves line breaks and formatting. Use multiple lines for better readability.
- Rich Media - While this node sends text, Twilio's WhatsApp API also supports images, documents, and location sharing (requires additional API calls).
- Delivery Status - WhatsApp provides more detailed status: queued, sent, delivered, read, failed.
- Opt-In Required - Recipients must have opted in to receive WhatsApp messages from your business. Follow WhatsApp's Business Policy.
- Template Messages - For certain use cases (marketing, notifications), you may need to use WhatsApp-approved message templates.
- Response Handling - Use the Receive Message node to handle incoming WhatsApp replies.
- Rate Limiting - Add delays between messages when sending to multiple recipients to avoid rate limits.
Common Errors
Empty From/To Number
Error: "ErrInvalidArg: From Number cannot be empty" or "To Number cannot be empty"
Solution:
- Ensure both From Number and To Number fields are populated
- Check that your data source contains valid phone numbers
- Verify the variable names match your flow data
Empty Message
Error: "ErrInvalidArg: Message cannot be empty"
Solution:
- Ensure the Message field contains text
- Check that message variables are properly populated
- Verify your message template has content
Invalid Phone Number Format
Error: "ErrCreateMessage: Error sending message: Invalid 'To' Phone Number"
Solution:
- Use E.164 format WITHOUT the
whatsapp:prefix:+[country code][number] - Remove spaces, dashes, or parentheses from phone numbers
- Ensure country code is included (e.g., +1 for US/Canada)
- Example:
+14155552671(correct),whatsapp:+14155552671(incorrect - node adds prefix automatically)
WhatsApp Not Enabled
Error: "WhatsApp is not enabled for this number"
Solution:
- Ensure you've enabled WhatsApp in your Twilio Console
- Verify the From Number is a WhatsApp-enabled number
- Complete the WhatsApp sender setup process in Twilio
- Check that your Twilio account has WhatsApp access
Template Required
Error: "Message failed - Template message required" or similar
Solution:
- For the first message to a user (within 24 hours), you may need to use an approved template
- Submit message templates for approval in Twilio Console
- Use approved templates for outbound marketing/notifications
- Ensure you're complying with WhatsApp Business Policy
Recipient Not on WhatsApp
Error: Message fails to deliver
Solution:
- Verify the recipient has WhatsApp installed on their phone
- Ensure the phone number is correctly associated with a WhatsApp account
- Check that the recipient hasn't blocked your WhatsApp number
- Verify the phone number is active and can receive messages
Opt-In Not Confirmed
Error: Message rejected due to opt-in requirements
Solution:
- Ensure recipients have explicitly opted in to receive WhatsApp messages
- Maintain opt-in records for compliance
- Follow WhatsApp's opt-in requirements for your region
- Don't send unsolicited messages
Rate Limit Exceeded
Error: Too many messages sent too quickly
Solution:
- Add delays between messages (recommended: 1-2 seconds)
- Implement retry logic with exponential backoff
- Consider using Twilio's Messaging Service for better throughput
- Monitor your sending rate and adjust accordingly
Related Nodes
- Connect - Create a Twilio connection for authentication
- Receive Message - Receive incoming WhatsApp messages via webhook
- Send SMS - Send messages via SMS instead of WhatsApp
- Voice Call - Make voice calls instead of sending messages