Using SMS 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 websequencediagrams.com and edit from there.
1title 2-way SMS with TaskRouter23Customer->+App: Customer sends text4App->Twilio: Look for open tasks from this sender5alt New Conversation6App->Twilio: Create New Chat Channel7App->Twilio: Add Customer # to Channel8App->Twilio: Create Task w/ Channel id \nas attribute9note over Twilio, Agent:10TaskRouter searches11for available agent12end note13Twilio->+Agent: Reservation Request14Agent->Twilio: Accept and Join Chat Channel15else Existing Conversation16Twilio->App: Return task, extract chat \nchannel from attribute17App->Twilio: Push Message into Channel18Twilio->Agent: MessageAdded19end20note left of Agent: Agent Replies21Agent->Twilio: add message to channel22Twilio->App: messaged added23note over App:24If message added by agent25pull contents of message26end note27App->Customer: send text reply28note over Customer, Agent: Customer or Agent Ends Conversation29App<->Twilio: Store Chat transcript in CRM30App->Twilio: Close Chat Channel31App->Twilio: Move task to wrapup32Agent->Twilio: Move task to complete