Skip to content

Amazon Connect Routing Criteria Customisation

0

I'm trying to customize the Amazon Connect Routing Criteria block to route chats to a specific agent based on their agent ID. I have a Lambda function that returns the following:

routing_criteria = { "MyRoutingCriteria": { "Steps": [ { "Expression": { "UserIdCondition": { "UserIds": [user_id] } }, "Expiry": { "DurationInSeconds": 60 } }, { "Expression": { "AttributeCondition": { "Name": "Language", "Value": "English", "ProficiencyLevel": 1, "ComparisonOperator": "NumberGreaterOrEqualTo" } } } ] } } The goal is:

Route to the specific agent (user_id) if available.

If the agent is unavailable, wait 60 seconds and then fall back to default routing.

If the same customer returns within 4 hours, they should be routed to the same agent again.

However, this response doesn't seem to be working in the Routing Criteria block, and there's very limited documentation on routing by agent ID (UserIdCondition). Has anyone successfully used this approach, or is there a supported way to implement this?

1 Answer
0

To route chats to a specific agent based on their agent ID in Amazon Connect, you need to adjust your routing criteria structure. The issue with your current implementation is that you're using "UserIdCondition" which isn't the correct format for agent-specific routing.

Here's how to properly structure your routing criteria:

{
"RoutingCriteria": {
"Steps": [
{
"Expression": {
"AttributeCondition": {
"ComparisonOperator": "Match",
"MatchCriteria": {
"AgentsCriteria": {
"AgentIds": ["user_id_here"]
}
}
}
},
"Expiry": {
"DurationInSeconds": 60
}
},
{
"Expression": {
"AttributeCondition": {
"Name": "Language",
"Value": "English",
"ProficiencyLevel": 1,
"ComparisonOperator": "NumberGreaterOrEqualTo"
}
}
}
]
}
}

Key changes to note:

  1. The top-level key should be "RoutingCriteria" not "MyRoutingCriteria"
  2. For agent-specific routing, use "AttributeCondition" with "ComparisonOperator": "Match" and "MatchCriteria" containing "AgentsCriteria"
  3. The agent ID should be in an array under "AgentIds"

For the requirement to route returning customers to the same agent within 4 hours, you'll need to:

  1. Store the customer-agent pairing in a database (like DynamoDB)
  2. Use a Lambda function to check if the customer has interacted with an agent in the last 4 hours
  3. If found, retrieve that agent ID and use it in your routing criteria
  4. If not found, proceed with your default routing logic

Remember that the agent must be in Available status and have the queue the contact is in assigned to their Routing Profile to receive the contact.
Sources
UpdateContactRoutingData - Amazon Connect
Route contacts to the last agent the customer interacted with on an outbound call. | AWS re:Post

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.