🚨 Important Lab Dependency
This mission requires configuration created in the following missions:
- NO DEPENDENCY
Mission 3: Last Agent Routing
Story
A common request for returning customers calling into a contact center is to work with the last person with which they had a good experience. This may be because they are already familiar with what the customer needs, or it may just be that the customer is familiar with the agent and enjoyed their last interaction. With the new Auto CSAT feature in the Webex Contact Center we can automatically account for this request and route to the last agent which had a high Auto CSAT with the customer.
[Important!] Since this is a lab environment where you will act as both the customer and the agent, accurately scoring a call will be challenging. Additionally, Auto CSAT has not been taught due to the insufficient number of calls required for AI to learn and generate proper scoring. In this lab, we will use a Global Variable to store the score, which is also used for Auto CSAT teaching. With a sufficient number of provided scores, Auto CSAT will eventually be able to score calls automatically.
Note
[Important!] Auto CSAT is preconfigured for you on Control Hub. Please avoid changing the configuration.
Call Flow Overview
- New call comes into the flow.
- Call the Search API to find the last agent with which they had a good Auto CSAT.
- If the Auto CSAT is greater or equal 4 and agent is available, we will route the call to that agent.
- If the agent is not available or if no recent good AutoCSAT scores exist for the caller, we will route the call to the queue for the next available agent.
Mission Details
Your mission is to:
- Create a new flow from the scratch.
- Build a Search API query to request information from Analyzer database and parse it into flow variables.
- Prioritize the call if conditions match and route the call to agent.
Preconfigured elements
- Wait treatment Subflow which will provide Music in Queue and Queue Messages.
- Auto CSAT flow CCBU_PostCallSurvey_AutoCSAT has been created to help contact centers efficiently gather customer feedback through a simple automated post-call survey using DTMF tones.
Build
-
Create a new flow from scratch named LastAgentRouting_Your_Attendee_ID and add these flow variables:
Agent ID variable:
-
Name: agentID
-
Type: String
-
Default Value: leave it empty
Variable to write HTTP Response into it:
-
Name: JSONResponse
-
Type: String
-
Default Value: leave it empty
String type AutoCSAT variable:
-
Name: AutoCSATVar
-
Type: Decimal
-
Default Value: 0.0
-
Turn on Agent Viewable toggle
-
Desktop Label: Auto CSAT
-
-
Add a Play Message node
-
Connect the New Phone Contact node edge to this Play Message node
-
Turn on Enable Text-To-Speech toggle
-
Select the Connector: Cisco Cloud Text-to-Speech
-
Click the Add Text-to-Speech Message button
-
Delete the selection for Audio File
-
Text-to-Speech Message: Welcome to the last agent routing mission.
-
-
Add an HTTPRequest node for our query
-
Activity Label: GraphQL_Query
-
Connect the output node edge from the Play Message node to this node
-
Select Use Authenticated Endpoint
-
Connector: WxCC_API
-
Request Path: /search
-
Method: POST
-
Content Type: GraphQL
-
Copy this GraphQL query into the Request Body:
query lastagentSearch($from: Long!, $to: Long!, $filter: TaskDetailsFilters) { taskDetails(from: $from, to: $to, filter: $filter) { tasks { csatScore autoCsat origin owner { id name } doubleGlobalVariables(name: "AutoCSAT_GV"){ name value } } } }- Copy the following variables into the GraphQL Variables:
{ "from": "{{now() | epoch(inMillis=true) - 15000000}}", "to": "{{now() | epoch(inMillis=true)}}", "filter": { "and": [ {"lastEntryPoint": {"id": {"equals": "{{NewPhoneContact.EntryPointId}}" }}}, { "status": { "equals": "ended" } }, { "origin": { "equals": "{{NewPhoneContact.ANI}}" }}, { "doubleGlobalVariables": { "name": { "equals": "AutoCSAT_GV" }, "value": { "gte": 4 } } } ] } }Parse Settings:
-
Content Type: JSON
-
Output Variable:
agentID - Path Expression:
$.data.taskDetails.tasks[0].owner.id
Click on + Add New to add new output variable
- Output Variable:
AutoCSATVar - Path Expression:
$.data.taskDetails.tasks[0].doubleGlobalVariables.value
Example of expected response [Optional]
-
-
Add Set Variable node
-
Activity Label: GraphQL_Response
-
Connect GraphQL_Query to this node
-
We will connect Set Variable node in next step
-
Variable: JSONResponse
-
Set To Variable: GraphQL_Query.httpResponseBody
-
-
Add a Case node
-
Activity Label: Case_If_AgentIDEmpty
-
Connect the output node edge from teh GraphQL_Response node to this node
-
Select Build Expression
-
Expression:
{{agentID is empty}} -
Change Case 0 to true
-
Change Case 1 to false
-
We will connect the true and false in future steps.
-
-
Add a Condition node
-
Activity Label: CheckCSATValue
-
Connect false exit of Case node to this node
-
We will connect the True and False output edges in future steps.
-
Expression: {{AutoCSATVar>=4.0}}
-
-
Add a Queue To Agent node
-
Connect the True node edge of the CheckCSATValue condition node created in previous step to this Queue To Agent node.
-
Agent Variable: agentID
-
Agent Lookup Type: ID
-
Turn on Set Contact Priority
-
Select Static Priority
-
Static Priority Value: P1
-
Reporting Queue: Your_Attendee_ID_Queue
-
Park Contact if Agent Unavailable toggle should remain off
-
Static Recovery Queue: Your_Attendee_ID_Queue
-
-
Add a Queue Contact node
-
Connect the False node edge from the CheckCSATValue condition node created in Step 6 to this node
-
Connect true node edge of Case_If_AgentIDEmpty node created in Step 5 to this node
-
Connect Default node edge of Case_If_AgentIDEmpty node created in Step 5 to this node
-
Connect Queue To Agent Output and Error node edges created in previous step to this Queue Contact
-
Select Static Queue
-
Queue: Your_Attendee_ID_Queue
-
-
Add a Subflow node and DisconnectContact node
-
In the Activity Library pane on the left side of the screen, click Subflows
-
Find the Subflow names WaitTreatment and drag it onto the flow canvas like you would any other node.
-
Add a DisconnectContact node
-
Connect the output node edge from this node to the DisconnectContact node.
-
Connect the Queue Contact node edge that we created in previous step to the WaitTreatment subflow node
Click on WaitTreatment subflow node and configure the following settings:
-
Subflow Label: Latest
-
Make sure Enable automatic updates is turned on
-
-
Navigate to Event Flows and add GoTo node to the canvas.
-
Connect AgentDisconnect event node edge to this GoTo node
Click on the GoTo node and configure the following settings: -
Destination Type: Flow
-
Static Flow: CCBU_PostCallSurvey_AutoCSAT
-
Choose Version Label: Latest
-
-
Validate and publish the flow:
-
Enable the Validation toggle in the bottom right corner of the flow designer window to check for any potential flow errors and recommendations.
-
If there are no Flow Errors after validation is complete, click on Publish Flow next to it.
-
In the pop-up window, ensure that the Latest label is selected in the Add Version Label(s) list, then click Publish Flow.
-
-
Map your flow to your inbound channel
-
Navigate to Control Hub > Contact Center > Channels
-
Locate your Inbound Channel (you can use the search): Your_Attendee_ID_Channel
-
Select the Routing Flow: LastAgentRouting_Your_Attendee_ID
-
Select the Version Label: Latest
-
Click Save in the lower right corner of the screen

-
Testing
-
Your Agent Desktop session should still be active. If it is not, launch Desktop using the cross-launch link in Control Hub.
-
On your Agent Desktop, set your status to Available.
- Using Webex App, place a call to your Inbound Channel number Your_Attendee_ID_Channel
- You should be offered a call, click on the Answer button. (You may want to mute the mic on both Webex App and the Agent Desktop).
- End the call from Agent Desktop and you should hear an invitation to rate your experience with us on a scale of 1 to 5.
- Select 5 on Webex App keypad.
- In your flow, open the flow debugger and select the latest call from the list (on top of the list).
- Trace the steps taken in the flow.
- Select GraphQL_Query and scroll down the details panel on the right-hand side to Modified Variables. They should be empty since there are no CSAT scores at the moment you made the first call.
- Case_If_AgentIDEmpty should exit via true node edge as the GraphQL_Query had no response, hence the call arrived to your agent via Your_Attendee_ID_Queue and not via QueueToAgent node.
-
Make sure your agent status is set to Available
-
Using Webex App, place another call to your Inbound Channel number Your_Attendee_ID_Channel
- You should be offered the call, click on the Answer button.
- If everything set correctly you should see Auto CSAT set to 5.0
- End the call and select any wrap up reason if asked.
- In your flow, open the flow debugger and select the latest call from the list (on top of the list).
- Trace the steps taken in the flow
- Select GraphQL_Query and scroll down the details panel on the right-hand side to Modified Variables. You should see that now agentID and AutoCSATVar have assigned values.
- Select GraphQLResponse. In details panel on the right-hand side you should see Modified Variables has a JSON response.
- Case_If_AgentIDEmpty should exit via false node edge as the GraphQL_Query is not empty.
- CheckCSATValue is now either equals 5 which matches the condition hence the call arrived to your agent via QueueToAgent node.
Congratulations, you have succesfully completed Last Agent Routing mission! 🎉🎉














