Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Conversations FAQ and Troubleshooting


(information)

Info

Flex Conversations requires Flex UI 2.0. If you are on Flex UI 1.x, please refer to Messaging in Flex pages.

(information)

Info

Should you build on Flex Conversations or Legacy Messaging Channels?

Flex Conversations is the next generation architecture for async channel capabilities. Because it is based on the single Twilio Conversations primitive, the developer experience is improved and the complexity of building async channel workflows is reduced. This is the platform on which we'll keep adding new functionality and channels in the future.

Furthermore, to help you decide, consider the following:

Will you require attachments for different channels?
Flex Conversations channels support attachments for SMS/MMS, WhatsApp, Chat, Facebook Messenger (Public Beta), and Google Business Messages (Public Beta). On the legacy channels, attachments are only available on Chat channels.

Does your use case require more than one customer in the same engagement?
Unlike legacy messaging, Flex Conversations allows you to have multiple customers during the same engagement.


Can I build my own Messaging Orchestration?

can-i-build-my-own-messaging-orchestration page anchor

Flex Conversations is based on the single Twilio Conversations primitive which reduces the complexity of building async channel workflows. You can configure addresses for your Flex Conversations channels — SMS, WhatsApp, etc. — which you can integrate with Studio or your own backend application.

In order to build your own messaging orchestration, continue to have the number or sender ID configured as a Conversations address. However, you must not use the Send To Flex widget or the Interactions API to route to Flex. You can use the TaskRouter API to create a customer task to route to Flex.

By default, agents are automatically added (upon acceptance) and removed from Conversations tasks (upon completion). To override this behavior, see WebChat Actions. Without the override, the Flex UI will attempt to add agents to your Conversations channels when they accept a task.

Flex will add new features and functionality to support future Conversations use cases. These features may not work with your custom messaging orchestration solution, or your team will need to do additional development to make the new features compatible with your custom solution.

If you don't configure Conversations addresses, remove the addresses. Don't use the Send to Flex Widget.

Additionally, you need to override the "wrapup" and "complete" actions for your custom channels.


How do I route to a specific agent?

how-do-i-route-to-a-specific-agent page anchor

Use known agent routing in your workflow to assign a task to a specific agent. You can also use the Interactions API to specify an agent-initiated interaction as well as add a specific agent to an existing interaction.


How do I auto-accept a task in the Flex UI?

how-do-i-auto-accept-a-task-in-the-flex-ui page anchor

You can auto-accept the task using the Flex Actions Framework, like so:


_10
init(flex, manager) { //auto-accepts tasks
_10
manager.workerClient.on('reservationCreated', reservation => { if
_10
(reservation.task.attributes.autoAnswer === 'true') {
_10
flex.Actions.invokeAction('AcceptTask', {sid: reservation.sid}); //select the task
_10
flex.Actions.invokeAction('SelectTask', {sid: reservation.sid}); } }); }


Can I use custom Task Channels or Channel Types?

can-i-use-custom-task-channels-or-channel-types page anchor

Yes. However, you must tell Flex UI that this Task has Messaging/Chat capabilities. For example:


_10
const myOwnChatChannel = flex.DefaultTaskChannels.createChatTaskChannel(
_10
"my-chat-channel", task => task.channelType === "custom" );
_10
flex.TaskChannels.register(myOwnChatChannel);

Or, using Task Channel name:


_10
const myOwnChatChannel = flex.DefaultTaskChannels.createChatTaskChannel(
_10
"my-chat-channel", task => task.taskChannelUniqueName === "custom1" );
_10
flex.TaskChannels.register(myOwnChatChannel);


How do I update my file attachment configuration for Flex Conversations?

how-do-i-update-my-file-attachment-configuration-for-flex-conversations page anchor

File attachments are enabled by default on your Flex account. If this is not the case, you will need to update your account service configuration with a new entry in the channel_configs array.

GET Flex Configuration

get-flex-configuration page anchor

_10
curl --location --request GET 'https://flex-api.twilio.com/v1/Configuration/' \
_10
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN


_17
{
_17
...,
_17
"channel_configs": [
_17
...,
_17
{
_17
address_type: "web",
_17
cbm_attachments: {
_17
enabled: false,
_17
number_of_attachments: 1,
_17
max_file_size: 16777216,
_17
max_total_file_size: 67108864,
_17
accepted_extensions: [...]
_17
}
_17
},
_17
...,
_17
]
_17
}

POST (Update) Flex Configuration and disable file attachments

post-update-flex-configuration-and-disable-file-attachments page anchor

For a list of address types and accepted file extensions, see Channel Attachment Limits. To disable file attachments for a channel, set "enabled" to false for that specific channel_configs entry. Make sure to specify your account_sid in your POST request.

Update Flex file attachment configuration

update-flex-file-attachment-configuration page anchor

_30
curl --location --request POST 'https://flex-api.twilio.com/v1/Configuration/' \
_30
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \
_30
--header 'Content-Type: application/json' \
_30
--data-raw '{
_30
"account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_30
"channel_configs":[
_30
{
_30
"cbm_attachments":{
_30
"max_file_size":16777216,
_30
"max_total_file_size":67108864,
_30
"accepted_extensions":[
_30
"jpg",
_30
"jpeg",
_30
"png",
_30
"amr",
_30
"mp3",
_30
"mp4",
_30
"pdf",
_30
"heic",
_30
"txt",
_30
"gif"
_30
],
_30
"enabled":false,
_30
"number_of_attachments":1
_30
},
_30
"address_type":"web"
_30
},
_30
...
_30
]
_30
}'

Note that the code sample has been clipped with ... for brevity.


How do I troubleshoot my messaging setup?

how-do-i-troubleshoot-my-messaging-setup page anchor

Let's assume you're testing an inbound SMS message flow that's being handled by Studio. Some questions you can consider are:

Did Twilio receive the incoming message?

  1. Check that the message arrived at Twilio by checking your Programmable Messaging Logs in the Console under Monitor > Logs> Messaging(link takes you to an external page) .
  2. If the message does not appear here, it means that the message has not yet arrived at Twilio. If the incoming message is present, drill into it by clicking the date and verifying that it was handled by the right messaging service.
  3. If you don't see your message in these logs, something is preventing your number from receiving the message. Consider filing a support ticket and contacting your account executive.
  4. Double check that you have your Messaging Service set to perform auto-create as per the setup instructions
  5. You can enable live debugging on the Twilio Function which may give some hints if it's failing here.
  6. For the Flex UI, open the browser console to check for errors. You can also see our troubleshooting guide for Flex UI(link takes you to an external page) .

Did your message trigger a Conversation to be created?

Any message to a Conversations address that is outside of a conversation should cause the auto-create functionality to create a new conversation, add the sender as a participant, and append the message to the newly-created conversation. To find if the sender has an active conversation, use the Conversation Participant resource to find the active conversation. If there is no active conversation for this participant, check that your Conversation address is configured correctly and that the Messaging and Conversations services are also configured correctly.

Does the Conversation have a webhook or Studio configured as the scoped webhook?

If you found an active conversation for the sender in the previous step, check if a Studio or Webhook integration is configured correctly by querying the Conversation Scoped Webhook resource. The configuration should have either a Studio target or webhook target as per the Conversation address. If not, this may be an "orphaned" conversation. If this happens, please consider filing a support ticket.

In the meantime, for orphaned conversations, you could manually send them to Flex by invoking the Interactions API.

Did the message hit your Studio Flow?

All Studio interactions are captured in a Flow's Execution Logs(link takes you to an external page). Find "Messaging Flow" (the default flow created for Flex, or the Chat Flow if you're debugging a web chat interaction) and navigate to Studio logs to see the execution associated with the failed message.

You can inspect error messages in each step of the Studio flow. HTTP Requests and Function Widgets frequently return error codes that can terminate the entire execution.

Did Studio create an Interaction (and Task)?

You can inspect the Studio Flow logs to see the Interaction SID, the Interaction channel SID, and the Task SID.

You can inspect Tasks in the TaskRouter section of the Twilio Console(link takes you to an external page). The Task should have a reference to the relevant Interaction and Conversation SID in its Attributes.

Was the agent able to accept the Reservation?

When an Agent accepts the Reservation related to this Task, the agent user will be added as a Participant to the conversation. The role linked with that Agent user is "agent".

Please do not modify the standard permissions of this role (sendMessage, sendMediaMessage, leaveConversation, editConversationAttributes, editOwnMessage, editOwnMessageAttributes, deleteOwnMessage).

Any Messages sent by the Agent should be visible under the Phone Number / Messaging Logs. Optionally, you can filter messages by Outgoing Messages to more easily find the agent's message.

Once the Agent has completed the Task, Flex will take care of the following:

  1. Task changes status to Completed and is deleted after 10 minutes.
  2. Agent is removed from the Conversation.
  3. The Conversation state is set to closed.

How do I downgrade to Flex UI 1.x and use Legacy Messaging?

how-do-i-downgrade-to-flex-ui-1x-and-use-legacy-messaging page anchor

If you're having trouble with Flex Conversations and need to use Flex UI 1.x and legacy channels for messaging, please ensure you follow these steps:

  • Downgrade your Flex UI version
    From the Flex Versioning and updates(link takes you to an external page) page in the Admin dashboard, select a 1.x.x version from the Version list. Ensure you test your plugins before you confirm the version installation and refresh. To pin to a specific Flex UI version, see "Flex UI Versioning" on the Flex UI Core Concepts page .
  • Remove Conversations addresses from your account
    Navigate to Flex > Manage > Messaging(link takes you to an external page) in the Twilio Console and select the Conversations Addresses tab. Take note of the address details before deleting each Conversations address. Next, select the SMS Numbers tab. Remove addresses with the "Conversations" label in the Status field of each address.
  • Create legacy addresses
    To revert to using Programmable Chat and Proxy for SMS and chat, click Legacy Addresses and follow the steps on Manage SMS Addresses and Manage WebChat Addresses respectively. When creating a legacy address, you can reuse the same Studio Flow(link takes you to an external page) previously associated with a Conversations address. However, you need to ensure that the Send to Flex widget is connected to the "Incoming Message" trigger and that it uses the attributes structure for Messaging and Chat Studio flows.

    studio-flow-incoming-message.
  • Configure your phone number to use the Flex Proxy Service for incoming messages
    After updating the address configuration for your phone number, navigate to Phone Numbers > Manage > Active Numbers(link takes you to an external page) and make sure it is using the Flex Proxy Service for handling inbound messages.
  • If you're running a Flex plugin, check your React version for compatibility
    Flex UI 1.x.x uses React 16.5.2 by default. If your plugin was built on a later version, navigate to Flex Admin dashboard > Developer Setup(link takes you to an external page) and select "Latest" from the React Version dropdown. Click Save to apply the change.

What do I do with "Failed to Fetch session" errors?

what-do-i-do-with-failed-to-fetch-session-errors page anchor

If you see "Failed to fetch session because Could not find any web chat flows for user" errors after downgrading from Flex UI 2.x.x to 1.x.x, please review these downgrade steps.


Rate this page: