Workflows templates are out-of-the-box flows and automations that you can add and start using right away. Each template provides a specific and real world solution.
In this blog post you will learn about the Send SMS with Twilio template.
Why it’s important
Within a workflow you may want to send a message, an alert, a pin, or any type of information via SMS to a user.
This flow creates a text messages and sends it via Twilio SMS API. The flow is meant to be called as a helper flow. This means you can call it from any other flow.
The template has one flow:
- SUB – Send SMS via Twilio
Template flow steps
Note: I removed a number of Notes cards from the flow(s) so all all cards can fit into a screenshot.
The flow SUB – Send SMS via Twilio has the following steps:
- The On Demand – Child Flow card makes this flow a helper flow. This means the flow can be invoked from any other low. This helper flow has four inputs:
To phone number
Twilio Account SID
From phone number
- The second card Object – Construct, creates an object (JSON object) with required header information for Twilio SMS API call
- The third card, Text – Compose puts together additional parameters to be used with Twilio SMS call. The card concatenates
To phone number,
From phone numberinformation
- The next Text – Compose card sets the Twilio endpoint with the
- The last card, API Connector – Post makes an API call to Twilio to send the text message
Flow chart for the two flows looks like this:
You need a Twilio account with a number from which you can send SMS messages. In your Twilio account go to the console. There you will see the information you need to send SMS messages. You will need
Auth Token and
My Twilio phone number.
How to add and setup the template.
- In Workflows console click Templates
- In the search field start typing sms and then select SMS with Twilio template
- Click Add template button
- Set a connection in API Connector – Post card for Twilio by creating a new connection:
- Auth Type:
Account SIDfrom Twilio console
Auth Tokenfrom Twilio console
- Auth Type:
Running the flow
To test the flow click the Test button and enter the input that the flow requires.
Note that From phone number is your Twilio number.
🎁 Looking for more out-of-the-box automation solutions? Check out all the available templates.