Tutorial: Starting a flow from a text message

You can use webhooks to start a flow automatically, when an end-user sends a text message to a Twilio number. Here is a quick app that texts you back when you send a text message.

Let’s get building!

If you need to take a closer look, click on the images to enlarge them. Have a question? Click the Help button on the bottom right-hand corner of this page to ask.

This is what our canvas will look like, once we are done:

What we will need

  1. ManyWho username/password. (If you do not have a ManyWho login, please click here to request one.)
  2. Your mobile phone number.
  3. Twilio account and password. (You can create a Twilio account here.)
  4. A Twilio programmable SMS number, with text messaging supported and configured for the country of your mobile phone.
  5. Twilio service for ManyWho configured. (Learn more here. To see a list of services you have installed, click Services in the Home screen sidebar.)
  6. A new flow. Use the ManyWho Identity service. Make sure Access is set to ‘Anyone can run this flow’ and Social Feed is set to ‘None.’ You can call the flow ‘Launching a flow’ or anything you wish. Publish the flow to get the Flow ID.
  7. Twilio webhook configured to launch an app via text messaging. You will need the Tenant ID and Flow ID to configure this.

Importing the Twilio Service
  1. Open your flow, and click Shared Elements on the right-hand-side navigation.
  2. Select Services.
  3. Click Import Existing.
  4. Click the Import button next to the Twilio: Service.
  5. Click Close.

The Shared Elements > Services screen will show the Twilio service once it is imported to the flow.


Configuring the Message action
    1. Drag a Message element from the sidebar to the canvas.
    2. In the Configuration Panel, copy-paste Send SMS in the Name text field and click New Message Action.
    3. Select Twilio Service from the The Service to send the Message drop-down menu.
    4. Click the Select button next to Send SMS (Simple).
    5. Click Select or create a new Value in the Value field for Body.
    6. Click Create a new Value.
    7. The Name field says Body. You can change it to anything you like.
    8. Select String from the What kind of Value is this? menu.
    9. The What kind of Value is this? field should say String.
    10. Enter the text you want to say in the Default Value field. For example, you can copy-paste This works like a charm!
    11. Click Save.
    12. Click Select or create a new Value in the Value field for From.
    13. Click Create a new Value.
    14. The Name says Subject. You can change it to anything you like.
    15. The What kind of Value is this? field should say String.
    16. Enter your Twilio programmable SMS number in the Default Value field.
    17. Click Save.
    18. Click Select or create a new Value in the Value field for To.
    19. Click Create a new Value.
    20. The Name field says To. You can edit to anything you like.
    21. The What kind of Value is this? field should say String.
    22. In the Default Value field enter the mobile number of the phone you want the message to be sent to.
    23. Click Save.
    24. Click Apply Message Action.
    25. Click Save Message.

      This is what the canvas looks like now:

Creating the first outcome
  1. Hover your mouse on Start. The mouse pointer changes from a crossbar to a hand.
  2. Drag an arrow from Start to Send SMS.
  3. In the Configuration Panel, type Go in the Name field. (This outcome does not need a button-click from the user – and therefore has no Label field.)
  4. Click Save Outcome.

    This creates an arrow from Start to Send SMS with the legend Go on it.

Adding the confirmation screen
  1. Drag a Step element from the sidebar to the canvas.
  2. In the Configuration Panel, copy-paste the text SMS Sent in the Name text field.
  3. In the Content Editor, copy-paste the text Thank you for your time.
  4. Click Save Step.

    This is what the canvas looks like now:

Creating the second outcome
  1. Hover your mouse on Send SMS. The mouse pointer changes from a crossbar to a hand.
  2. Drag an arrow from Send SMS to SMS Sent.
  3. In the Configuration Panel, type Yes in the Name field. (This outcome does not need a button-click from the user – and therefore has no Label field.)
  4. Click Save Outcome.

    This creates an arrow from Send SMS to SMS Sent with the legend Go on it.

That was fast!

And… we are done building. This is what the canvas looks like now:

Let’s publish the flow now and run it.


Appchievement!

It took us around 20 minutes to build an app that can be triggered by sending a text message. To launch the app, send a text message to your Twilio number.

Once Twilio receives the text, the app is launched. The Message element in the flow sends a text back to the user.

The flow then moves to the Step element, that confirms a text has been sent.


Check out the ManyWho glossary for a definition of terms and key concepts that appear in the ManyWho website, Drawing Tool, technical documentation, blogs, and marketing communications.

If you need to take a closer look, click on the images to enlarge them. Have a question? Click the Help button on the bottom right-hand corner of this page to ask.

You may also like: