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:
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
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 licenses do I need?" in the FAQ for more details.
Ready to get started sending simple SMS alerts? Follow the instructions in the video below.
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:
Set up a process builder to trigger when a new Twilio Message record is created:
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:
Set up a schedule:
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.
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:
|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.|
|The phone number you want to send the message to. This can be static, a field reference, or a formula.|
|The phone number you want to send the message from. This can be static, a field reference, or a formula.|
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:
|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.|
|The Rest API URL that will call your Studio flow. Example: |
|The number that the chat bot will send messages or make calls to.|
|(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 |