Menu

Flex Conversations

Flex Conversations Beta is not a generally available product and should not be fully deployed in a production environment. Flex Conversations Beta (including all code and related documentation) is provided “AS IS.”


Twilio disclaims all express or implied warranties of any kind with respect to the Flex Conversations Beta release, including but not limited to any implied warranties of merchantability or fitness for a particular purpose. Twilio shall have no liability or obligation to you or any other individual or entity for any damages of any kind or nature whatsoever arising out of or relating to the use of or inability to use the Flex Conversations Beta release, including but not limited to any direct, indirect, incidental, consequential, or special damages, even if Twilio has been advised of the possibility of such damages. With the exception of what is outlined in the Onboarding Guide, Twilio has no obligation to support or maintain the Flex Conversations Beta release. Use of the Flex Conversations Beta release is subject to all of the terms and conditions of the applicable license agreement.

Flex Conversations requires Flex UI 2.0. To check which version of the Flex UI you are running, see Flex UI Versioning. If you're running 1.x.x, follow the migration guide.

Flex Conversations gives your contact center the digital channel capabilities for both customer-initiated (commonly referred to as inbound flows) and business-initiated (commonly referred to as outbound flows) interactions, and provides the orchestration layer for managing and processing those customer interactions. Since it is based on the single Twilio Conversations primitive, the developer experience is improved and the complexity of building async channel workflows is reduced. For more details on the benefits of building on Flex Conversations, see the FAQ page.

While your customers may interact with the contact center using a variety of messaging channels, your agent always responds using the standard Flex agent desktop chat interface.

Under the hood, Flex uses Twilio products to achieve this. These products include:

While Conversations and Messaging Services are responsible for providing the ability to send and receive messages over different channels, the Interactions API gives you the ability to orchestrate agent routing and the ability to add and remove agents to and from a given conversation.

The Flex /Interactions API endpoint supports the following channel types:

  • SMS/MMS
  • WhatsApp
  • WebChat

The following sequence diagram illustrates an example of how Flex handles an inbound SMS contact:

diagram on how to handle inbound sms contact

When you create an interaction, you specify the Twilio Conversation to bind to and the TaskRouter workspace to use for routing. You can optionally declare additional routing attributes according to your interaction type. This will result in a reservation which once accepted, will automatically add that agent to the conversation.

For more information about the Interactions API, please refer to the API documentation.

Architectural Overview

Flex allows agents to work from a single interface even as customers communicate over different channels. While the user experience feels simple, people building contact centers understand the underlying complexity in creating this functionality. This page offers a high-level understanding of how Flex manages omnichannel two-way communications. With Twilio Conversations and the Interactions API, you can create inbound and outbound conversations with your customers. Your agents will have more granular control on the lifecycle of a conversation and can proactively reach out to your customers. For detailed examples and use cases, see the Interactions API documentation.

Flex Conversations requires:

  • A Flex Account/Project
  • Flex UI version 2.0 or newer
  • Conversations Addresses for your phone numbers
  • Flex onboarding sets up default handlers for inbound Chat and inbound SMS. It also configures standard Studio interaction for these to build any chat bot logic prior to agent handover. The default handlers – Chat flow (see the demo app for more information) and Conversation flow – use the "Incoming Conversation" trigger with the Send to Flex widget to handover to the Flex application. You can manage Addresses for your phone numbers using the Twilio Console. Learn more about how to handle inbound SMS and WhatsApp messages.

Inbound flow from a messaging channel

high level inbound flow from a messaging channel

The Conversations Service will create a new Conversation as per the Address configuration for your Flex phone number. In the diagram above, it was configured to invoke a Studio Flow. Once a conversation arrives at Studio, you can design your bespoke flow to handle this conversation. If you decide to send to Flex, use the Send To Flex widget. This widget will call the Interactions endpoint which in turn creates a task and route it to the agent. Learn more about how omnichannel inbound messages work.

Outbound flow on a messaging channel (immediate task creation)

Outbound flow on a messaging channel (immediate task creation)

In this scenario, the agent clicks on start conversation through a Flex plugin or a third-party application. This invokes the Interactions API to create an outbound channel and add the customer to it. Once that orchestration is complete, the agent is able to send and receive messages from the customer.

Outbound flow on a messaging channel (task creation on customer response)

Outbound flow on a messaging channel (task creation on customer response)

This is similar to the previous outbound flow except in this case, you need to create the conversation first and add your scoped webhook integration to handle the reply. Once you’ve done that, you can send a message to the participant. When the participant replies, the scoped webhook will invoke your integration. When your integration is invoked, you can auto-reply to the customer and then forward to Flex by using the Interactions API.

Learn more about how you can send outbound messages with Flex Conversations.

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

Thank you for your feedback!

Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more