Twilio Integration
Overview
The Twilio integration in Lamatic provides communication automation capabilities through SMS, voice calls, and WhatsApp messaging. This integration enables automated multi-channel communication within workflows, supporting comprehensive communication automation across different channels including SMS, voice calls, and WhatsApp messaging.
The Twilio integration provides Action capabilities for sending messages and making calls. You can integrate it into your flows to automate communication processes.
Features
β Key Functionalities
- Action - Send SMS: Sends text messages to phone numbers with customizable content and delivery options.
- Action - Send Voice Call: Makes automated voice calls with custom messages and call management features.
- Action - Send WhatsApp Message: Sends WhatsApp messages including text and media content to WhatsApp-enabled numbers.
β Benefits
- Multi-Channel Communication: Supports SMS, voice calls, and WhatsApp messaging from a single integration.
- Automated Messaging: Streamlines communication processes with programmable messaging and calling.
- Global Reach: Leverages Twilio's global infrastructure for reliable message delivery worldwide.
- Rich Media Support: Enables sending media files through WhatsApp messaging for enhanced communication.
Prerequisites
Before setting up the Twilio integration, ensure you have the following:
- Twilio Account: A valid Twilio account with active phone numbers and proper authentication setup.
- Twilio Credentials: Account SID and Auth Token from your Twilio console.
- Phone Numbers: Purchased phone numbers for SMS and voice calls (if needed).
- WhatsApp Business API: Set up WhatsApp Business API for WhatsApp messaging (if needed).
Setup
Step 1: Set Up Twilio Account
-
Create Twilio Account:
- Sign up for a Twilio account at twilio.com (opens in a new tab)
- Verify your phone number and complete account setup
-
Get Credentials:
- Navigate to your Twilio Console Dashboard
- Copy your Account SID and Auth Token
- Store these credentials securely for use in Lamatic
-
Purchase Phone Numbers (if needed):
- Buy phone numbers for SMS and voice calls
- Set up WhatsApp Business API (for WhatsApp messaging)
Step 2: Set Up Lamatic Flow
-
Create a Custom Flow for Twilio automation:
- Configure the Twilio node based on your use case
- Set up action parameters for your communication needs
- Test the integration with your Twilio credentials
-
Use Pre-built Templates: Start with our
Twilio Communication Template
Step 3: Configure Node in Lamatic
- Add the Twilio node to your flow.
- Provide necessary credentials and communication parameters.
- Configure the specific action (SMS, Voice Call, or WhatsApp Message).
Step 4: Testing
For testing, you need to manually provide phone numbers and message content as dummy data. Once deployed, these values will be automatically processed through your configured Twilio integration.
Configuration Reference
Credential Configuration
Parameter | Description | Required | Example |
---|---|---|---|
Credential Name | Display name for the Twilio credentials | β | my-twilio-credentials |
Account SID | Your Twilio Account SID from the console | β | ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
Auth Token | Your Twilio Auth Token from the console | β | your-auth-token-here |
Action Configuration
Send SMS Action
Parameter | Description | Required | Example |
---|---|---|---|
Name | Display name for the action | β | Send SMS |
Credentials | Twilio authentication details | β | my-twilio-credentials |
Action | Type of Twilio action to perform | β | Send SMS , Send Voice Call , Send WhatsApp Message |
Body | SMS message content | β | Hello, this is an automated SMS message. |
To | Recipient phone number (E.164 format) | β | +1234567890 |
From | Sender phone number (your Twilio number) | β | +1987654321 |
Send Voice Call Action
Parameter | Description | Required | Example |
---|---|---|---|
Name | Display name for the action | β | Send Voice Call |
Credentials | Twilio authentication details | β | my-twilio-credentials |
Action | Type of Twilio action to perform | β | Send Voice Call |
Voice Message | Text to be converted to speech for the call | β | Hello, this is an automated voice call. |
Call To | Recipient phone number (E.164 format) | β | +1234567890 |
Call From | Sender phone number (your Twilio number) | β | +1987654321 |
Call Timeout | Maximum call duration in seconds | β | 30 |
Send WhatsApp Message Action
Parameter | Description | Required | Example |
---|---|---|---|
Name | Display name for the action | β | Send WhatsApp Message |
Credentials | Twilio authentication details | β | my-twilio-credentials |
Action | Type of Twilio action to perform | β | Send WhatsApp Message |
WhatsApp Message | WhatsApp message content | β | Hello, this is an automated WhatsApp message. |
To (WhatsApp) | Recipient WhatsApp number (E.164 format) | β | +1234567890 |
From (WhatsApp) | Sender WhatsApp number (your Twilio WhatsApp number) | β | +1987654321 |
Media URL | URL of media file to send (image, document, etc.) | β | https://example.com/image.jpg |
Low-Code Example
Send SMS Action
nodes:
- nodeId: twilioNode_1
nodeType: twilioNode
nodeName: Twilio
values:
credentials: my-twilio-credentials
action: sms
timeout: 60
to: '{{triggerNode_1.output.sampleInput}}'
from: '{{triggerNode_1.output.sampleInput}}'
body: Test SMS
modes: {}
needs:
- triggerNode_1
Send Voice Call Action
nodes:
- nodeId: twilioNode_2
nodeType: twilioNode
nodeName: Twilio
values:
credentials: my-twilio-credentials
action: voice_call
timeout: 60
to: '{{triggerNode_1.output.sampleInput}}'
from: '{{triggerNode_1.output.sampleInput}}'
body: Test Voice Call
modes: {}
needs:
- triggerNode_1
Send WhatsApp Message Action
nodes:
- nodeId: twilioNode_3
nodeType: twilioNode
nodeName: Twilio
values:
credentials: my-twilio-credentials
action: whatsapp
timeout: 60
to: '{{triggerNode_1.output.sampleInput}}'
from: '{{triggerNode_1.output.sampleInput}}'
body: Test WhatsApp Message
modes: {}
needs:
- triggerNode_1
Output
Send SMS Output
messageId
: String identifier for the sent SMS messagestatus
: String indicating the delivery statusto
: String containing the recipient phone numberfrom
: String containing the sender phone numberbody
: String containing the message contentprice
: String containing the cost of the messagetimestamp
: String containing the send timestamp
Send Voice Call Output
callId
: String identifier for the voice callstatus
: String indicating the call statusto
: String containing the recipient phone numberfrom
: String containing the sender phone numberduration
: String containing the call durationprice
: String containing the cost of the calltimestamp
: String containing the call timestamp
Send WhatsApp Message Output
messageId
: String identifier for the WhatsApp messagestatus
: String indicating the delivery statusto
: String containing the recipient WhatsApp numberfrom
: String containing the sender WhatsApp numberbody
: String containing the message contentmediaUrl
: String containing the media URL (if sent)timestamp
: String containing the send timestamp
Troubleshooting
Common Issues
Problem | Solution |
---|---|
Authentication Errors | Verify that the Account SID and Auth Token are correct and valid |
Invalid Phone Numbers | Ensure phone numbers are in E.164 format (e.g., +1234567890) |
SMS Delivery Fails | Check if the recipient number is valid and can receive SMS |
Voice Call Issues | Verify the sender number has voice calling capabilities enabled |
WhatsApp API Errors | Ensure WhatsApp Business API is properly configured and approved |
Rate Limiting | Implement appropriate delays between API calls to avoid hitting rate limits |
Insufficient Credits | Check your Twilio account balance and add funds if necessary |
Debugging
- Check Twilio API logs for detailed error messages
- Verify phone number formats and validity
- Test credentials using Twilio's API explorer
- Monitor account usage and billing
- Validate media URLs for WhatsApp messages
- Check network connectivity and firewall settings
- Review Twilio API documentation for specific error codes
- Ensure proper permissions for the phone numbers being used