Twilio Integration

No sections found for this integration
The integration documentation may not have the expected structure

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:

Always required:

  • Twilio Account: A valid Twilio account with proper authentication setup.
  • Twilio Credentials: Account SID and Auth Token from your Twilio console.

Required for the actions you plan to use:

  • SMS: A purchased Twilio phone number with SMS capability enabled.
  • Voice Calls: A purchased Twilio phone number with voice capability enabled.
  • WhatsApp Messages: Either the Twilio WhatsApp Sandbox (development and testing) or a registered WhatsApp sender (production). See below.

WhatsApp: Sandbox vs. Production

WhatsApp messages cannot be sent from a standard Twilio phone number. You have two options:

Twilio WhatsApp Sandbox (development and testing)

The Sandbox lets you send and receive WhatsApp messages immediately. No WhatsApp Business Account and no Meta approval are required, which makes it the fastest way to test a flow.

  1. Find your sandbox number and unique join code in the Twilio Console under Messaging → Try it out → Send a WhatsApp message.
  2. Each recipient must opt in by sending join <your-join-code> to the sandbox number, or by scanning the QR code shown in the Console.
  3. Use the sandbox number as your From (WhatsApp) value in the node.

Sandbox limitations:

  • You can only message users who have joined your sandbox.
  • Sessions expire three days after joining. Recipients must rejoin after that.
  • Rate limited to one message every three seconds.
  • Business-initiated messages can only use Twilio’s pre-approved templates (Appointment Reminders, Order Notifications, Verification Codes).
  • The sandbox number is shared across Twilio accounts and cannot be customized.

Registered WhatsApp sender (production)

For production traffic, custom message templates, or your own branded number, register a WhatsApp sender through Twilio’s WhatsApp Self Sign-up (direct customers) or the WhatsApp Tech Provider Program (ISVs). This is the path that involves WhatsApp Business Account setup and approval.

Setup

Step 1: Set Up Twilio Account

  1. Create Twilio Account:

    • Sign up for a Twilio account at twilio.com
    • Verify your phone number and complete account setup
  2. Get Credentials:

    • Navigate to your Twilio Console Dashboard
    • Copy your Account SID and Auth Token
    • Store these credentials securely for use in Lamatic
  3. Set Up Your Sending Channels:

    • For SMS or voice calls: Purchase a Twilio phone number with the capability you need (SMS, voice, or both).
    • For WhatsApp: Use the WhatsApp Sandbox to get started without approval, or register a WhatsApp sender for production. A regular phone number will not work for WhatsApp. See WhatsApp: Sandbox vs. Production.

Step 2: Set Up Lamatic Flow

  1. 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
  2. Use Pre-built Templates: Start with our Twilio Communication Template

Step 3: Configure Node in Lamatic

  1. Add the Twilio node to your flow.
  2. Provide necessary credentials and communication parameters.
  3. 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

ParameterDescriptionRequiredExample
Credential NameDisplay name for the Twilio credentialsmy-twilio-credentials
Account SIDYour Twilio Account SID from the consoleACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Auth TokenYour Twilio Auth Token from the consoleyour-auth-token-here

Action Configuration

Send SMS Action

ParameterDescriptionRequiredExample
NameDisplay name for the actionSend SMS
CredentialsTwilio authentication detailsmy-twilio-credentials
ActionType of Twilio action to performSend SMS, Send Voice Call, Send WhatsApp Message
BodySMS message contentHello, this is an automated SMS message.
ToRecipient phone number (E.164 format)+1234567890
FromSender phone number (your Twilio number)+1987654321
TimeoutTimeout in seconds. Defaults to 60.60

Send Voice Call Action

ParameterDescriptionRequiredExample
NameDisplay name for the actionSend Voice Call
CredentialsTwilio authentication detailsmy-twilio-credentials
ActionType of Twilio action to performSend Voice Call
Voice MessageText to be converted to speech for the callHello, this is an automated voice call.
Call ToRecipient phone number (E.164 format)+1234567890
Call FromSender phone number (your Twilio number)+1987654321
TimeoutTimeout in seconds. Defaults to 60.60

Send WhatsApp Message Action

⚠️

Requires either the Twilio WhatsApp Sandbox (development) or a registered WhatsApp sender (production). A standard Twilio phone number will not work. See WhatsApp: Sandbox vs. Production.

ParameterDescriptionRequiredExample
NameDisplay name for the actionSend WhatsApp Message
CredentialsTwilio authentication detailsmy-twilio-credentials
ActionType of Twilio action to performSend WhatsApp Message
WhatsApp MessageWhatsApp message contentHello, this is an automated WhatsApp message.
To (WhatsApp)Recipient WhatsApp number (E.164 format)+1234567890
From (WhatsApp)Sender WhatsApp number. Your Sandbox number or registered WhatsApp sender.+14155238886
Media URLURL of media file to send (image, document, etc.)https://example.com/image.jpg
TimeoutTimeout in seconds. Defaults to 60.60

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
      whatsappTo: '+911234567890'
      whatsappFrom: '+14155238886'
      whatsappMessage: Test WhatsApp Message
    modes: {}
    needs:
      - triggerNode_1

whatsappFrom in this example is Twilio’s shared Sandbox number. For production, use your registered WhatsApp sender number instead.

Output

The Twilio node returns the same output shape for all three actions:

  • sid: String identifier assigned by Twilio for the message or call (Twilio’s SID).
  • status: String indicating the delivery or call status.
  • message: String containing a status or error message.
  • output: Object containing the response payload from Twilio.

Example Output Reference

schema:
  output: object
  sid: string
  message: string
  status: string

Troubleshooting

Common Issues

ProblemSolution
Authentication ErrorsVerify that the Account SID and Auth Token are correct and valid
Invalid Phone NumbersEnsure phone numbers are in E.164 format (e.g., +1234567890)
SMS Delivery FailsCheck if the recipient number is valid and can receive SMS
Voice Call IssuesVerify the sender number has voice calling capabilities enabled
WhatsApp API ErrorsIf using the Sandbox, confirm the recipient has joined it and the session hasn’t expired. If using a registered sender, ensure it is properly configured and approved
WhatsApp message not delivered (Sandbox)The recipient must send join <your-join-code> to the sandbox number first. Sandbox sessions also expire after three days, requiring the recipient to rejoin
Rate LimitingImplement appropriate delays between API calls to avoid hitting rate limits
Insufficient CreditsCheck 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

Was this page useful?

Subscribe to updates