SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

How do I split a Studio flow based on a variable?

Objective

This article shows you how to add and configure the Split Based On... widget so your Studio flow branches down different paths depending on a value — a caller's keypress, a reply, or any variable your flow has collected.

 

Product

Studio

 

Environment

Twilio Console

 

User Account Permission/Role(s) Required

Editing a flow requires the Studio flows create and update permissions on the account.

 

Procedure

  1. In the Twilio Console, select Orchestration in the left sidebar.
  2. Select Studio, then Flows.
  3. Select the flow you want to edit to open the Editor tab.
  4. Open the widget library and drag Split Based On... onto the canvas.
  5. Select the new widget to open its configuration panel.
  6. In Variable to test, choose or enter the variable whose value should decide the branch.
  7. Select Save.
  8. Open the Transitions tab and add each branch:
  9. Select New condition.
  10. Enter a name for the branch in Condition name.
  11. Choose a comparison in the operator list, such as Greater Than or Less Than.
  12. Enter the value to compare against in Value.
  13. In Transition to, choose the widget the flow should move to when the condition matches.
  14. Save the condition.
  15. Repeat for each additional branch you need.
  16. In If no condition matches, choose a fallback widget so the flow always has somewhere to go.
  17. Select Publish to make the change live.

 

Additional Information

  • Conditions are evaluated in order, and the first match wins — put your most specific conditions first.
  • Always set If no condition matches. Without it, a value that matches nothing leaves the flow with no path forward.
  • Add the variable you are testing before this widget in the flow, using Set Variables, Gather Input on Call, or Send and wait for reply.

 

 

This content was generated by AI and reviewed, edited, and verified by a human.

Have more questions? Submit a request
Powered by Zendesk