SMS Integration
Send text messages from Flows using Twilio.
Setup
- Create a Twilio (opens in a new tab) account
- Get your Account SID and Auth Token from the console
- Purchase or port a phone number
- In Lux Desktop: Settings → Credentials → Add Credential
- Select Twilio and enter your credentials
Required Credentials
| Field | Description |
|---|---|
| Account SID | Found in Twilio Console dashboard |
| Auth Token | Found in Twilio Console dashboard |
| Default From Number | Your Twilio number (E.164 format: +15551234567) |
Sending SMS from Flows
Use the Send SMS node:
{
"to": "{{customer.phone}}",
"from": "+15551234567",
"body": "Your order #{{orderId}} has shipped! Track: {{trackingUrl}}"
}Phone Number Formats
Use E.164 format for all phone numbers:
+15551234567 (US)
+447911123456 (UK)
+33612345678 (France)Converting formats:
// In a Code node
const phone = inputs.phone
.replace(/\D/g, '') // Remove non-digits
.replace(/^1/, ''); // Remove leading 1 for US
return { formattedPhone: `+1${phone}` };Message Limits
SMS has character limits:
| Type | Limit | Notes |
|---|---|---|
| Standard SMS | 160 chars | Single message |
| Long SMS | 1600 chars | Split into segments |
| Unicode (emoji) | 70 chars | Per segment |
Tip: Keep messages under 160 characters for best delivery.
Common Use Cases
Verification Codes
{
"to": "{{user.phone}}",
"from": "+15551234567",
"body": "Your verification code is {{code}}. Valid for 10 minutes."
}Order Updates
{
"to": "{{order.customerPhone}}",
"from": "+15551234567",
"body": "Order #{{order.id}}: {{order.status}}. {{order.message}}"
}Appointment Reminders
{
"to": "{{appointment.phone}}",
"from": "+15551234567",
"body": "Reminder: Your appointment is {{appointment.date}} at {{appointment.time}}. Reply CONFIRM or CANCEL."
}Receiving SMS (Inbound)
Configure webhooks to receive SMS:
- In Twilio Console, set webhook URL to your Flow's webhook
- Create Flow with Webhook Trigger
- Process incoming messages
Incoming payload:
{
"From": "+15559876543",
"To": "+15551234567",
"Body": "CONFIRM",
"MessageSid": "SM123..."
}Best Practices
Compliance
- Get consent before sending
- Include opt-out instructions
- Honor STOP requests immediately
Content
- Be concise
- Include sender identification
- Make action clear
Delivery
- Verify phone numbers before sending
- Handle invalid numbers gracefully
- Respect quiet hours
Pricing
Twilio pricing varies by country:
| Destination | Cost (approx) |
|---|---|
| US | $0.0079/message |
| UK | $0.04/message |
| International | Varies |
Check Twilio pricing (opens in a new tab) for current rates.
Troubleshooting
Message Not Delivered
- Verify phone number format (E.164)
- Check Twilio logs for errors
- Ensure account has sufficient balance
Blocked Numbers
- Some carriers block automated messages
- Use verified business numbers
- Register for A2P 10DLC (US)
Next: Voice →