Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Get Started with Twilio Studio


Twilio Studio is a visual tool for building communications applications with little or no code. This guide describes the core concepts and mechanics you need to start building with Studio. Once you feel comfortable with these mechanics, you can start building out more complex flows that combine multiple widgets and transitions. Twilio Studio is a visual tool for building communications applications with little or no code. This guide describes the core concepts and mechanics you need to start building with Studio. Once you feel comfortable with these mechanics, you can start building out more complex flows that combine multiple widgets and transitions.


Glossary

glossary page anchor

Here are some of the key Studio terms to help you as you get started:

TermDefinitionExample
FlowA Flow is an individual workflow that you create. They can handle one or more use cases.You can create a flow to handle inbound Voice calls by playing a prerecorded message.
WidgetWidgets are items that you can drag onto the flow canvas. They represent pieces of logic, and can connect to each other through transitions.Use the Send Message widget to send an outbound SMS to a user in your flow.
FlowA Flow is an individual workflow that you create. They can handle one or more use cases.You can create a flow to handle inbound Voice calls by playing a prerecorded message.
WidgetWidgets are items that you can drag onto the flow canvas. They represent pieces of logic, and can connect to each other through transitions.Use the Send Message widget to send an outbound SMS to a user in your flow.
TransitionTransitions define how a flow advances from one widget to the next based on specific conditions.After you place an outbound call with the Outgoing Call widget, you could create a transition to the Say/Play widget to play a message to the connected caller.
StepA Step is the runtime processing of a widget, starting when that widget is entered. Variables get set at the end of a Step.If you're prompting a user for a text input, when they receive the inbound SMS prompt, they are actively in a Step until they exit the widget (send a response or timeout). If the prompt is intended to set a variable, this happens at the end of the Step.
ExecutionAn execution represents a specific person's progress through a flow. An execution is active while the user is in the flow, and it is considered ended when they stop or are kicked out of the flow.When you call the Twilio number connected to a flow, an execution is created to represent your call to that number and your path through the flow. The owner of the flow can see this execution, as well as the executions of other users who run through the flow.

Build with Twilio Studio

build-with-twilio-studio page anchor

Create a flow

create-a-flow page anchor

The first step to use Studio is to create a flow, which represents the workflow that you want to build for your project. The first step to use Studio is to create a flow, which represents the workflow that you want to build for your project.

To create a new flow:

  1. Log in to your Twilio account in the Twilio Console.
  2. Navigate to the Studio dashboard.
  3. Click Create new Flow.
  4. Name your flow, then click Next.
  5. Select a template:
    • Select the Start from scratch option to create an empty flow.
    • Select a predefined template (for example, a chatbot or Interactive Voice Response (IVR) template) to use as a starting point. You can customize these templates for your use case.
  6. Once you've selected your template, click Next.

When you've created the flow, you'll see the flow's canvas. Here, you can build out the rest of the logic for the project. When you've created the flow, you'll see the flow's canvas. Here, you can build out the rest of the logic for the project.

(information)

New versus Classic canvas

If you're using the legacy Twilio Console, you can use one of two versions of the canvas: Classic and New. The new canvas is in public beta, click Try the new Studio canvas to switch to it. The new canvas has the same functionality as the classic canvas with a new look.

You can create Subflows, which let you break down large, complex flows into smaller flows and link them together. Common use cases include reusing common functionality, organizing complex flows into logical subsets, and passing live executions between flows. For example: You can create Subflows, which let you break down large, complex flows into smaller flows and link them together. Common use cases include reusing common functionality, organizing complex flows into logical subsets, and passing live executions between flows. For example:

  • Create a reusable logging Subflow to POST data back to your own systems.
  • Transfer a Contact to another self-contained IVR or chatbot.
  • Encapsulate the gathering and verifying of a Contact's identity.
  • Pass a Contact's language preference to a Subflow to dynamically load the localized content.

Visit the Subflow docs to learn more about how to use Subflows, work with variables, limitations, and more.

Widgets are the building blocks of a Studio flow. They handle incoming actions and respond by performing tasks. These tasks include sending a message, making a phone call, routing the user to another part of the flow, and capturing information. Widgets are the building blocks of a Studio flow. They handle incoming actions and respond by performing tasks. These tasks include sending a message, making a phone call, routing the user to another part of the flow, and capturing information.

Every new canvas has a Trigger widget, which you use to indicate how the flow starts. You can add other widgets onto the canvas to build the rest of your project's logic.

Trigger widget

trigger-widget page anchor

There are four ways to trigger a flow's start:

  • Incoming Message
  • Incoming Call
  • REST API
  • Subflow

You can start your flow with any number of these triggers. For example, you can design your flow to provide information to users who both text and call in. Your flow could be triggered by an Incoming Call and an Incoming Message. The flow could respond to an Incoming Message with a Send Message widget that sends an SMS to the user. It alternatively could respond to an Incoming Call with a Say/Play widget that dictating the message back to the caller.

You can design your flow to respond to any number of the possible triggers.

Widget library and configuration panel

widget-library-and-configuration-panel page anchor

The widget library contains widgets that you can drag and drop onto the canvas. You can click and drag the widget around the canvas to reposition it. Use the search bar to find the widget you want to use.

Click on a widget to open its configuration panel. The configuration panel is where you set up the widget's settings and define transitions to other widgets. You can also open the configuration panel by clicking the Edit icon on the widget.

If you're using the classic canvas in the legacy console, the widget library and settings panel appear in the same space. To return to the widget library, click any empty space on the canvas. You can also click the single back arrow on the configuration panel to get back to the widget library.

To edit a widget, click on the widget to open its configuration panel.

Widget names are generated automatically when you drop them onto the canvas, but they can be renamed. Widget names must meet the following requirements. They:

  • Must be unique. You cannot use the same name for two widgets in a single flow.
  • Must start with a letter.
  • Cannot include spaces or periods. Use the underscore character ("_") to separate words.

The widget type is shown in parentheses under the name so you can tell what the widget does.

(error)

Do not include PII in widget names or flow names

Don't include personally identifiable information (PII) such as a person's name, home address, email address, or phone number, in flow or widget names. The systems that process these attributes assume the data isn't directly identifying. For more details on how Twilio processes your data, refer to our privacy policy.

Some widgets have required configuration settings. Required fields are marked with a red asterisk (*) in the configuration panel and are listed in the widget's documentation. Note that you can't save the flow if any required configuration is missing or invalid.

To save your edits to the widget, click Save or click back onto the canvas. The widget is saved when you click away from it.

To copy a widget, go to > Duplicate widget. You can also use standard keyboard shortcuts.

  • On mac OS: press Cmd + C to copy, then Cmd + V to paste.
  • On Windows or Linux: press Ctrl + C to copy, then Ctrl + V to paste.

If you're using the classic canvas, you can copy a widget in its configuration panel by clicking the copy button. You can also use keyboard shortcuts.

To delete a widget, go to > Delete widget.

If you're using the classic canvas, click the X button in the widget. You can also click the Delete icon in the widget's configuration panel.

Define widget transitions

define-widget-transitions page anchor

A transition defines how a flow moves from one widget to the next based on events and specified conditions. Each transition connects one widget to another widget.

Widgets can have multiple different transition conditions. For example, the Send Message widget contains a transition condition for when the message is sent, and another one for if the message fails to send. You can define separate workflows for each one of these conditions. For example, if the message fails to send, you might want to retry it. If the message does send, you might want to move to a different widget.

You can create a transition in one of two ways.

Option 1: Draw the transition between two widgets

option-1-draw-the-transition-between-two-widgets page anchor

You can draw a transition between two widgets in the canvas.

  1. Click, hold, and drag from the bottom of the first widget in the transition.
  2. Drag your cursor onto widget you'd like to connect to. As you drag the cursor, you'll see a line following the arrow.
  3. Drop the line on the top of the widget you want to connect to.

A line connecting the two widgets indicates that there is now a transition between them. Click the line to edit the transition conditions.

Option 2: Define transitions from the widget configuration panel

option-2-define-transitions-from-the-widget-configuration-panel page anchor
  1. Click the widget to open the widget's configuration panel.
  2. Go to the Transitions tab.
  3. Select the widget you'd like the flow to transition to.

As you make changes, the canvas updates showing lines and arrows that represent your transitions.

You can, similarly, remove a transition in two ways.

Option 1: Remove the transition from the canvas

option-1-remove-the-transition-from-the-canvas page anchor

You can remove a transition by clicking the transition and pressing the Delete key on your keyboard.

In the classic canvas, click the gray dot at the top the second widget in the transition. Then, drag and drop the line on the empty canvas.

Option 2: Remove the transition from the widget configuration panel

option-2-remove-the-transition-from-the-widget-configuration-panel page anchor
  1. Click the widget that starts the transition you want to remove to open its configuration panel.
  2. Select the Transitions tab.
  3. click Disconnect under the transition you would like to remove.

Publish flows and view the revision history

publish-flows-and-view-the-revision-history page anchor

Changes you make on the canvas are saved automatically, but aren't live until you click Publish. This lets you update a flow while you develop it without affecting current users. When you're ready for the changes to go live, click Publish.

Studio also tracks revision history. In the Revision History menu, you can:

  • View a list of every change made to your flow.
  • Compare the differences between versions.
  • Revert to a previous revision.

To open the revision history, click the Revision History menu or, in classic view, hover the pointer over the revision history menu.

Configure a Twilio phone number to connect to a Studio flow

configure-a-twilio-phone-number-to-connect-to-a-studio-flow page anchor

After you finish configuring your Flow and publish all changes, connect it to a Twilio phone number so users can interact with it. You can connect Flows that are triggered by incoming messages or incoming calls.

Twilio ConsoleLegacy Twilio Console
  1. Go to Products & Services > Numbers & Senders > Phone Numbers and select the phone number that you want to connect to the Flow.

  2. In the Configuration Details tab, choose the appropriate trigger:

    • Incoming calls
      1. Go to the Voice and emergency calling tab.
      2. Click Edit details and configure the settings.
      3. Select the Webhook, TwiML Bin, Function, Studio Flow, Proxy Service method to configure the phone number.
      4. Select Use Studio Flow as thee method for handling incoming calls.
      5. Select the Flow that you want to handle incoming calls.
    • Incoming messages
      1. Go to the Messaging tab.
      2. Click Edit details and configure the settings.
      3. Select the Webhook, TwiML Bin, Function, Studio Flow, Proxy Service method to configure the phone number.
      4. Select Use Studio Flow as the method for handling incoming messages.
      5. Select the Flow that you want to handle incoming messages.
  3. Click Save.

Your Flow is now connected to your Twilio phone number.

(information)

Twilio phone number routing

A Twilio phone number can route inbound messages and calls to only one Studio Flow (one-to-one), but a single Studio Flow can process messages and calls from multiple phone numbers (one-to-many).

You can also use the flow's Webhook URL with Twilio resources that accept a callback URL, including Messaging Services, Short Codes, and Channels. Depending on the product, you configure this URL in the Twilio Console, with APIs, or both. The documentation for each product specifies how to connect a Studio flow when that option is available.

To find your flow's Webhook URL, go to the Details tab of the flow. If you're using the classic view, the Webhook URL is in the Trigger widget's configuration panel.

Use variables in your Studio flow

use-variables-in-your-studio-flow page anchor

As your flow executes, Twilio saves the execution state in the flow context. You can access any data in the flow context from your widgets, either in configuration fields or in text areas.

There are four types of data stored in the context:

  • Flow: Data intrinsic to the flow, such as the phone number associated with it.
  • Trigger: Data set when a flow starts, such as the initial incoming message, phone call, or REST API call.
  • Widgets: Data that each widget sets and adds to the context as it executes, such as the digits a user presses or the body of an incoming or outgoing message.
  • Contact: Data about the current contact engaging with the flow, such as their phone number.

You can also store additional variables in the flow's context with the Set Variables widget.

(warning)

Variables can only be updated in the Set Variables widget

Variables can only be updated within the Set Variables widget. When modifying a variable, create a new variable in the Set Variables widget and update the original variable using Liquid filters.

Liquid template language

liquid-template-language page anchor

Studio uses the Liquid template language to insert variables into widgets. You can use Liquid to reference the various context variables available in a Studio flow. Liquid supports both output tags and logic tags.

To insert a variable in a widget, type two opening curly braces ({{). Studio then displays a list of available context variables. Scroll through the list or type the variable name to filter the options.

You can also add logic to widgets with Liquid, such as if/else statements and for loops. The following example checks whether the flow contains a variable for the contact's first name. If the variable exists, it greets the contact by name; otherwise, it uses a generic greeting.

1
{% if flow.data.first_name %}
2
Hello {{flow.data.first_name}}
3
{% else %}
4
Hello friend
5
{% endif %}

Liquid is a powerful templating language. For the full list of tags and actions, see the Liquid Template Language documentation.

(warning)

Variable names and output tags versus logic tags

Variable names only show dropdown options or autocomplete when you're writing output tags ({{...}}). Variable names won't autocomplete inside logic tags ({% ... %}).

(information)

Variable limits

Liquid template variables can render strings up to 16 KB.


Troubleshooting Twilio Studio flows

troubleshooting-twilio-studio-flows page anchor

To learn more about debugging your flow, view the Studio troubleshooting guide.

Twilio Studio provides logs for each Studio flow execution. These logs contain useful information about the steps that a flow runs and can help you debug flows that aren't functioning as you intended.

You can view the Logs for a Studio flow in the Logs tab.


Once you're comfortable navigating a Studio flow and the Studio canvas, use the following resources to continue building: