
To set a variable to test input against, select order_prompt > inbound.Body from the Variable to Test dropdown menu. You can now name the Widget - this tutorial will use split_order. Widget by dragging the grey dot at the bottom of Send & Wait for Reply Widget's Reply to the grey dot at the corner of the new Split Based On. Connect the Send & Wait for Reply Widget to the Split Based On. It does this by setting a variable that you can test the input against. Widget allows you to distinguish among input (the customer's response, no response, and errors). Once a response is received, you will need to take action based on its content. Your Flow is now prepared to reply to an inbound message and wait for a response. Please reply with one of the following: latte, cappuccino, americano, cortado, or cold brew. Welcome to our automated ordering system. You can leave the remaining Widget fields empty or set to their default values and click Save. In the Widget's Message Body, add a friendly response that will be sent to the customer once your Flow is triggered - see the sample text below. You can name the Widget anything you like - this tutorial will use order_prompt. Click the Send & Wait for Reply Widget on the Canvas and select the Widget's Config tab. Configure the Send & Wait for Reply Widget
You can expect the customer to reply with one of the options you specify. In this case, You will ask the user what kind of coffee they want to order. You can use this Send & Wait for Reply Widget to deliver an SMS to the user.
Connect it to the Trigger (Start) Widget by dragging the red dot at the bottom of Incoming Call Transition to the grey dot at the corner of the new Send & Wait for Reply Widget. Start by dragging a Send & Wait for Reply Widget onto the Canvas from the Widget Library. When your bot receives a message, you will need to reply, prompting the customer for a coffee order. You will add more Widgets throughout this tutorial by dragging them from the Widget Library on the right side of the Canvas. In this case, you want to receive SMS messages from customers, so you will trigger the Flow with an incoming message. This Widget starts your Flow when it's triggered by an event that you specify. Once the Studio Flow is created, you’ll see a Canvas with a Trigger Widget already in place. You can also select Messaging Chatbot to start with most of the pieces already on your Canvas and connected to one another. Select Start from scratch to follow along with the rest of this tutorial. Each template provides a different foundation of building blocks. The modal will load several template options. A modal will display where you can name your flow - this tutorial will use "Barista Bot.". Log into your Twilio account and navigate to the Studio Dashboard. You can also use the Messaging Chatbot template to begin with most of pieces already in place. Chatbot api how to#
By the end, you'll understand how to construct a chatbot with minimal building blocks in place.
You’ll create a Twilio Studio Flow from Twilio's starter template in this tutorial. To scale this Flow with Twilio Messaging Services, please reach out to discuss your use case. This demo tutorial is best suited for use with a single Twilio Phone number. Using the Twilio Conversations Integration