DEV Community

Max Katz
Max Katz

Posted on • Originally published at maxkatz.net on

Workflows Template: Send SMS with Twilio

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.

Template overview

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.

Sending SMS flow

Sending SMS flow

The flow SUB – Send SMS via Twilio has the following steps:

  1. 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:
    1. To phone number
    2. message
    3. Twilio Account SID
    4. From phone number
  2. The second card Object – Construct , creates an object (JSON object) with required header information for Twilio SMS API call
  3. The third card, Text – Compose puts together additional parameters to be used with Twilio SMS call. The card concatenates To phone number, message, and From phone number information
  4. The next Text – Compose card sets the Twilio endpoint with the Account SID information
  5. 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:

Sending SMS flow chart

Sending SMS flow chart

Twilio account

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 Account SID, Auth Token and My Twilio phone number.

Twilio account information

Twilio account information

Template setup

How to add and setup the template.

  1. In Workflows console click Templates
  2. In the search field start typing sms and then select SMS with Twilio template
  3. Click Add template button
  4. Set a connection in API Connector – Post card for Twilio by creating a new connection:
    1. Auth Type : Basic
    2. Username : Account SID from Twilio console
    3. Password : Auth Token from Twilio console

Twilio connection
Twilio connection

Running the flow

To test the flow click the Test button and enter the input that the flow requires.

Testing the flow

Testing the flow

Note that From phone number is your Twilio number.


🎁 Looking for more out-of-the-box automation solutions? Check out all the available templates.

Top comments (0)