Integrating Twilio Bots into Mobile Workflows with Apple Shortcuts
Tags: twilio, apple, productivity
Published: 2019-08-27 12:07:25

---
title: Integrating Twilio Bots into Mobile Workflows with Apple Shortcuts
published: true
description: Demonstrate how Twilio bots can be incorporated into mobile workflows using Apple Shortcuts.  
tags: twilio, apple, productivity
cover_image: https://lh3.googleusercontent.com/ckMoP8rvYKvdOU4n5IXEN2-fWEDflhJiVXK0Oqnt1m5F6IkP_Ip8S7fjW2pOICPOjqSYiXGYcqta
---

Building messaging bots has allowed me to personalize my mobile experience.  Where there are no existing services meeting my individual needs I've built bots tailored to my personal requirements, like this one I call [Twilio Fit](https://www.twilio.com/blog/build-sms-exercise-training-bot-python-zappa-aws-twilio-sms) that designs a daily workout that won't get boring.  Bots are a great way to deploy custom functionality in a mobile-first manner without having to design a full app, but interactions were limited to the various channel(s) to which the bot was deployed.  Incorporating messaging bots into the larger mobile experience was a challenge.  That all changed when I stumbled on Apple Shortcuts, which took my Twilio bots to a whole new level.

## Discovering Apple Shortcuts.

[Apple Shortcuts](https://apps.apple.com/us/app/shortcuts/id915249334) is an app provided by Apple that allows you to setup workflows on your iPhone.  You can design custom workflows triggered by a variety of actions that will pass inputs and outputs to any number of different tasks.  Within the app there is an entire gallery of shortcuts available allowing you to get prepped for the morning commute, share your current location via a text message, track how much caffeine you've had today, or help you with those tricky guitar chords among many, many others.  After reviewing all the different actions you could take within Apple Shortcuts I thought, what would happen if I hooked this up to one of my bots?  Let's find out!

## Twilio and Apple Shortcuts is Love.

One bot I frequently use is my SMS Grocery List Bot to convert a screenshot of a recipe into a more useful shopping list.  For this bot a screenshot of a recipe is sent to a Twilio SMS messaging bot and the bot returns a list of ingredients in the form of a note to make shopping easier.  Without Shortcuts a lot of this process would be manual, finding the bot's number in iMessage, selecting the picture to send, opening Notes and pasting the returned list.  With Shortcuts some of these steps can be automated to make the bot more accessible.  Let's walkthrough what the workflow looks like in Shortcuts to give you an idea of how Twilio and Shortcuts can improve the mobile experience of your bots.  Below are the first 3 steps of the workflow.

![enter image description here](https://lh3.googleusercontent.com/3X0TsqOMXCBurOJiG_2tcYuPWczkzdvVdzLFt8WyogqEzl5K3XMDgbRP3WBDM2AgBnTky39n3q-u)
In this use case an assumption is made that the last screenshot is the one that has the recipe.  Alternatively you can prompt the user to select the screenshot they want to send.  There are so many different ways this can get configured!  Next, the **Send Message** section takes the selected screenshot and sends it as a MMS message to the Twilio SMS messaging service, which I've saved as a contact, twilio-sms-shopping-list.  Many bots have some kind of wake word to start the conversation.  In the **Send Message** step you can pass that wake word to your SMS bot to start a conversation with a bot quickly.  When **Send Message** is triggered a new message window is opened with your image already populated in the message.  All you have to do is click send!

![enter image description here](https://lh3.googleusercontent.com/QsVxAXINoEviRf9Oc1SPpsZC4Vf3voWse3rx-Z88CYSZtBiZ7_00VWxDxpak0TN8OW3Jn1N0tszX)
At this point the screenshot has been sent to the bot for processing.  Extracting the text and applying the NLP models takes a little bit of time, so the **Wait to Return** step pauses the rest of the process until there is output to continue.  The **Wait to Return** action allows the user to leave the Shortcut app and will continue when the user returns.  After a few seconds the Twilio bot will return the recipe ingredients.  When the ingredients are returned the user can open the message and copy the ingredients.

![enter image description here](https://lh3.googleusercontent.com/CbyDRBuShpdeCPJ95Tg1-vqVoFUCCUMr1BV0b_JELA_Opb-XelQmuHrTFL3xaLSsLVahV3PMuIwS)
After copying the ingredients the process will continue when the user  opens the Shortcuts app again.  The last steps will take the ingredients that were copied to the clipboard and create a new Note in the **Notes** app that will contain the list of ingredients that were copied from the message.

![enter image description here](https://lh3.googleusercontent.com/TYO-kflUEv6cBduT75Cl_7vWQR0Kl7t9iGDQREYggux-10CQiun6hZdutvA49hOd3CSYkVct2Cye)
When complete the note that was just created will be opened.  Just like that you're ready to go grocery shopping with a list you can actually use!  No more forgetting ingredients!

![enter image description here](https://lh3.googleusercontent.com/aM7-uykTv6Zi0-1JnWcFIG-3CQoLKIxbV7Y3pZBqB6YMiOwtCrCpBkuiPrGW_gDAAq7A2fgpShSL)
The best part is once the Shortcut has been setup it can be accessed with the click of a button on your home screen!  You can even design custom icons for your bots to make them more personal.  Now all my bots are accessible with a click of a button from the home screen of my phone!

![enter image description here](https://lh3.googleusercontent.com/lG-kRnKSnmFpZaA_Y0ni4XaW51SNYhxBdPoy4m7lWqTMfIPee4lwwZHNQ18Qvcnw1aw2sbW49_rm)

## Wrapping Up

Combining Twilio with Shortcuts creates a new dynamic, which can make your bots more accessible.  With the flexibility of the Twilio platform and the number of different services Shortcuts integrates with there are so many different options for testing different integrations of your bots into your mobile experience.

Now that you've seen how you can use Twilio and Apple Shortcuts together here are a couple other tutorials to get you started:

- [Twilio Fit](https://www.twilio.com/blog/build-sms-exercise-training-bot-python-zappa-aws-twilio-sms) to build your own personal trainer bot.
- [Sous Chef Bot](https://github.com/mvielkind/sous-chef-bot) to build a bot that will convert screenshots of your favorite recipe into organized shopping lists.

If you're new to Twilio you can use this [referral link](www.twilio.com/referral/J5x4pK) for a free $10 to get started!

Happy building!