Skip to contentSkip to navigationSkip to topbar
On this page

Flex Messaging FAQ and Troubleshooting


(information)

Info

This guide is for Flex UI 1.x.x and channels that use Programmable Chat and Proxy. If you are using Flex UI 2.x.x or you are starting out, we recommend that you build with Flex Conversations.


Can I build my own Messaging Orchestration?

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

In order to build your own messaging orchestration, you need to ensure that the Flex Message handlers are not configured for relevant Numbers or Chat Channels, Chat Services, or Chat Webhook. Instead of using the Flex Message handlers, you can configure your channels to use your custom handler.

You'll also need to override default Flex orchestration with the ChatOrchestrator object available in Flex UI version 1.9 and greater. Without the override, the Flex UI will attempt to add Agents to Chat Channels when they accept a task. Since you would not be using Flex Message Handlers, adding the Agent to the channel will fail.

(error)

Danger

Flex will add new features and functionality to support future Messaging 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.


How do I route my outbound tasks to a specific agent?

how-do-i-route-my-outbound-tasks-to-a-specific-agent page anchor

Define a new TaskRouter Workflow that assigns the task to the agent when the Task attribute contact_uri matches that of a specific agent.

Example Workflow:

A view of a TaskRouter workflow in the Twilio console.

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:

1
init(flex, manager) {
2
//auto-accepts tasks
3
manager.workerClient.on('reservationCreated', reservation => {
4
if (reservation.task.attributes.autoAnswer === 'true') {
5
flex.Actions.invokeAction('AcceptTask', {sid: reservation.sid});
6
//select the task
7
flex.Actions.invokeAction('SelectTask', {sid: reservation.sid});
8
}
9
});
10
}
11

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:

1
const myOwnChatChannel = flex.DefaultTaskChannels.createChatTaskChannel(
2
"my-chat-channel",
3
task => task.channelType === "custom"
4
);
5
flex.TaskChannels.register(myOwnChatChannel);

Or, using Task Channel name:

1
const myOwnChatChannel = flex.DefaultTaskChannels.createChatTaskChannel(
2
"my-chat-channel",
3
task => task.taskChannelUniqueName === "custom1"
4
);
5
flex.TaskChannels.register(myOwnChatChannel);

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?
Navigate to the phone numbers section of the Twilio Console(link takes you to an external page), find your Contact Center number that user sent the message to, go to Messages tab and make sure your filter includes Incoming messages. 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.

Did your message hit Proxy and create a new Session or initiate an existing session?
There should be a Session and related Interaction in the Flex Proxy Service(link takes you to an external page). If you don't see an Interaction, make sure that the Session status is still Open. If you don't see a Session, you may need to configure your number in the Flex messaging manager(link takes you to an external page).

Is the Proxy Session linked to a Chat Channel?
Navigate to Programmable Chat in the Twilio Console(link takes you to an external page), pick the Flex Chat Service instance and find the Channel. It contains all interactions from the customer side and from the Contact Center side.

If you don't see a chat channel, or don't see any interactions in the chat channel, consider filing a support ticket and contacting your account executive.

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) 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 a Task in TaskRouter?
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 Chat Channel in its Attributes.

Was the agent able to accept the Reservation?
When an Agent accepts the Reservation related to this Task, a new Chat User will be visible in that Chat Channel as a Member. The role linked with that Agent user is "agent".

Please do not modify the standard permissions of this role (sendMessage, sendMediaMessage, leaveChannel, editChannelAttributes, 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 find the agent's message.

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

  1. Task changes status to Completed and is deleted after 10 minutes.
  2. Agent is removed from the Chat Channel.
  3. The Chat Channel status is set to inactive.
  4. The corresponding Proxy Session is deleted.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.