Rate this page:

How to Send SMS Messages from Process Builder

Process Builder is a popular tool for building automated workflows in Salesforce. Twilio for Salesforce exposes two global Process Builder actions, Twilio Send SMS and Twilio Send to Studio, that you can use to send out automated SMS messages when certain conditions are met. Common uses of Process Builder include:

  • SMS notifications.
  • Appointment reminders.
  • Customer satisfaction surveys.

Process Builder actions

Twilio Send SMS Message allows you to send a text message from Process Builder. This Apex class is useful for single-message use-cases such as alerts and notifications.

Twilio Send to Studio allows you to initiate SMS and Voice chatbots using Twilio Studio, Twilio’s drag-and-drop visual editor. This Apex class is useful for initiating longer conversations that might require if...then branching.

How many licenses do I need if I’m using Process Builder?

The answer to this question depends on which users are running your automation flow. See “How many seats do I need?” in the FAQ for more details.

Send SMS messages with Process Builder and Twilio for Salesforce

Ready to get started sending simple SMS alerts? Follow the instructions in the video below.

Send Autoresponder SMS messages with Process Builder and Twilio for Salesforce


This functionality is available from v4.92 onwards.

If you are trying to send an SMS as a reponse to an incoming message from a customer, you need to set it up in a slightly different manner to get around the Salesforce limitations.

For example, when a customer confirms an appointment by sending an SMS to your Twilio for Salesforce number, and you want to automatically respond with “Thank you! your appointment is confirmed”, perform the following steps:

  1. Set up a process builder to trigger when a new Twilio Message record is created:
    Trigger - New Twilio Message Record
  2. Set up the criteria to check if the message is an Incoming message. Use the Direction field on the Twilio Message Object, and check for Inbound as the corresponding value for the field:
    Twilio Incoming Message Check
  3. Set up a schedule:
    Screenshot 2021-02-09 at 11.53.34 AM.png

    It may look like the autoresponder message will be sent after an hour, but that’s not the case. If you follow this guide, your autoresponder messages will be sent within minutes of receiving the message from the customer.
  4. Configure the Message response. You can get the phone number from the Message record itself. Use the From field to get the number. And set up the message body, as per your business case:
    Screenshot 2021-02-22 at 4.15.45 PM.png

Twilio Send SMS Message Parameters

Parameter Description
Message The body of the SMS message that you would like to send. This can be static, a field reference, or a formula (useful for templated messages). Note the message length determines the number of segments.
To Mobile Number The phone number you want to send the message to. This can be static, a field reference, or a formula.
From Mobile Number The phone number you want to send the message from. This can be static, a field reference, or a formula.

Send to Studio with Twilio for Salesforce

Interested in crafting interactive bot conversations with your users? Learn how you can launch SMS bots using Twilio Studio and the Salesforce Process Builder in this video:

To configure the Twilio Send to Studio Apex class, provide the following values:

Parameter Description
From Number The phone number you want the Studio flow to be sent from. Currently we only support sending from a specific number, not a messaging service. This might mean your chat bot will contact a user from a new number.
Studio URL The Rest API URL that will call your Studio flow. Example: To find your Studio flow API URL, click on the gear icon in the top-right corner of the flow’s trigger.
To Mobile Number The number that the chat bot will send messages or make calls to.
Parameters (Optional) You can also include additional Salesforce data as context parameters in key/value pairs. This is useful if you want your chat bot to address the recipient by first name, or reference other information from Salesforce within your Studio flow under {{}}.

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

Thank you for your feedback!

Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!