Integrations
SMS

SMS Integration

Send text messages from Flows using Twilio.

Setup

  1. Create a Twilio (opens in a new tab) account
  2. Get your Account SID and Auth Token from the console
  3. Purchase or port a phone number
  4. In Lux Desktop: SettingsCredentialsAdd Credential
  5. Select Twilio and enter your credentials

Required Credentials

FieldDescription
Account SIDFound in Twilio Console dashboard
Auth TokenFound in Twilio Console dashboard
Default From NumberYour 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:

TypeLimitNotes
Standard SMS160 charsSingle message
Long SMS1600 charsSplit into segments
Unicode (emoji)70 charsPer 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:

  1. In Twilio Console, set webhook URL to your Flow's webhook
  2. Create Flow with Webhook Trigger
  3. 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:

DestinationCost (approx)
US$0.0079/message
UK$0.04/message
InternationalVaries

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 →