Rate this page:

Using Chat and TaskRouter together | Appendix | Web Sequence Diagrams

If you want to customize any of the flows described here for your own use, you can paste the below descriptions into and edit from there.

Using chat and TaskRouter together

title Chat with TaskRouter

Customer->+App: Customer starts chat session in UI
App->Twilio: Chat channel is created
App->-Twilio: Task is created in Taskrouter
note right of App: Chat information is \n stored in task attributes
note right of Twilio: Taskrouter searches for available agent
Agent->+Twilio: Agent comes online
alt If Using SDK
Twilio->Agent: Task is assigned to agent 
else If using assignment callbacks
Twilio-->-App: Task is assigned to agent
Agent->Twilio: Agent joins chat channel
note over Agent, Customer: Agent & Customer chat
Customer->+App: Customer ends chat in UI
App->+Twilio: Task marked complete
Twilio->Agent: Agent marked as available
App->Twilio: Chat channel closed
Twilio->App: Chat session ended
Twilio->-App: store chat transcript in  CRM

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 Community Forums or browsing the Twilio tag on Stack Overflow.


        Thank you for your feedback!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

        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