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.
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.
Define a new TaskRouter Workflow that assigns the task to the agent when the Task attribute contact_uri matches that of a specific agent.
You can auto-accept the task using the Flex Actions Framework.
Let’s assume you’re testing an inbound 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, 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. 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.
Is the Proxy Session linked to a Chat Channel?
Navigate to Programmable Chat in the Twilio Console, 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. 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. 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 (
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 maintenance:
- Task changes status to
Completedand is deleted after 10 minutes.
- Agent is removed from the Chat Channel.
- The Chat Channel status is set to
- Corresponding Proxy Session is deleted.