Flow block: Set routing criteria - Amazon Connect

Flow block: Set routing criteria

  • Sets routing criteria on a contact.

  • Predefined attributes are used to set routing criteria on contacts of any channel, such as Voice, Chat, and Task. A routing criteria is a sequence of one or more routing steps.

  • A routing step is a combination of one or more requirements, for example, Language:English >= 4 AND Technology:AWS Kinesis >= 2 and an expiration duration. A routing step may also be set as non-expiring.

  • A requirement is a condition created using a predefined attribute name, it’s value, comparison operator and proficiency level. For example, Technology:AWS Kinesis >= 2.

  • The following flow types support this block:

    • Inbound flow

    • Customer queue flow

    • Transfer to Agent flow

    • Transfer to Queue flow

  • The Set Routing Criteria block needs to be used with the Transfer To Queue block, as the latter will transfer the contact to the Amazon Connect queue and activate the routing criteria specified on the contact.

  • Routing criteria set on the contact will not take effect if the contact is transferred into an agent queue. For more information, see Routing using agent proficiencies.

Prerequisites for Setting Routing Criteria

To set the routing criteria on a contact, you must first complete the following:

  1. Create Predefined attributes.

  2. Assign proficiencies to agents using predefined attributes that were previously created

How routing criteria works

When a contact is transferred to a standard queue, Amazon Connect will activate the first step specified in the routing criteria of the contact. An agent is joined to the contact only when it meets the requirements specified in the active routing step of the contact. If no such agent is found till the expiration duration of the step, then Amazon Connect will move to the next step specified in the routing criteria until one of them is satisfied. When all steps have expired, the contact will be offered to the longest available agent who has the queue in their routing profile. Note that a routing step will never expire in case expiration duration is not specified on the routing step.

You can use the following items in a routing criteria:
  • Choose from the following:

    • A single attribute.

    • Two – eight attributes using the AND condition.

    • Two attributes using the OR condition. You can only use OR when setting attributes dynamically. For more information, see Using the flow block.

In addition, attributes and routing criteria must have the following;

  • Each attribute must have an associated proficiency level.

  • Each proficiency level must use the β€œ>=” comparison operator.

  • Each step of the criteria must have a timed expiration timer.

  • The last step of the criteria can have a timed or non-expiring expiration timer.

Using the flow block

You can set the desired routing criteria either manually in the contact flow block UI or dynamically based on the output from the Invoke AWS Lambda Function block.

Using the set routing criteria flow block.

Using the flow block

Using this option, you can set routing criteria on contacts as specified in the `Set Routing Criteria` block manually. See the example of a flow below to where the predefined attribute is added to a routing step manually by picking the attribute and value from a dropdown list.

Set routing criteria flow block manually.

As needed, you can configure predefined attribute value dynamically using JSONPath reference even in this option. For example, you can specify `$.External.language` JSONPath reference instead of hard coding a AWS DynamoDB value on the `Technology` requirement of all of the contacts. For more information on JSONPath reference, see List of available contact attributes and their JSONPath reference.

Set routing criteria dynamically

You can set routing criteria on a contact dynamically based on the output from the Invoke AWS Lambda function block.

  • In the Invoke AWS Lambda function block, configure the Lambda function to return the routing criteria in JSON format and set the response validation as JSON. For more information on using the Invoke AWS Lambda function, see the Invoke AWS Lambda functions documentation.

  • In the Set Routing Criteria block, choose Set dynamically option with the above Lambda attributes - Namespace as External and Key as specified in above Lambda response. For example, the key would be MyRoutingCriteria as it points to the routing criteria in the sample Lambda response in the following section.

Sample Lambda function for setting routing criteria

The following Lambda example uses AndExpression to return routing criteria:

export const handler = async(event) => { return { "MyRoutingCriteria": { "Steps": [ { "Expression": { "AndExpression": [ { "AttributeCondition": { "Name": "Language", "Value": "English", "ProficiencyLevel": 4, "ComparisonOperator": "NumberGreaterOrEqualTo" } }, { "AttributeCondition": { "Name": "Technology", "Value": "AWS Kinesis", "ProficiencyLevel": 2, "ComparisonOperator": "NumberGreaterOrEqualTo" } } ] }, "Expiry": { "DurationInSeconds": 30 } }, { "Expression": { "AttributeCondition": { "Name": "Language", "Value": "English", "ProficiencyLevel": 1, "ComparisonOperator": "NumberGreaterOrEqualTo" } } } ] } } };

The following Lambda example uses OrExpression to return routing criteria:

export const handler = async(event) => { return { "MyRoutingCriteria": { "Steps": [ { "Expression": { "OrExpression": [ { "AttributeCondition": { "Name": "Technology", "Value": "AWS Kinesis Firehose", "ProficiencyLevel": 2, "ComparisonOperator": "NumberGreaterOrEqualTo" } }, { "AttributeCondition": { "Name": "Technology", "Value": "AWS Kinesis", "ProficiencyLevel": 2, "ComparisonOperator": "NumberGreaterOrEqualTo" } } ] }, "Expiry": { "DurationInSeconds": 30 } } ] } } };

What are the statuses of a routing step and why are they needed?

  1. Inactive: When the routing criteria is activated the first step immediately becomes Inactive. The routing engine executes the criteria one step at a time as per the expiration timer.

    1. Every step starts as Inactive Until the previous step expires.

  2. Active: When a step is actively being executed for a match the status is set to Active

  3. Expired: When Amazon Connect does not find an agent during the duration of a step and the timer expires, the routing engine moves on to the next step. The previous step is considered Expired.

  4. Joined: Whenever an agent is successfully matched with a contact for a particular step, the step status will be set as Joined

  5. Interrupted: If a contact has been waiting for too long or an operations leader may decide to interrupt the flow and change the routing criteria. This can be done while a particular step is active, for example, a task has been waiting for 24 hours and a manager wants to change the criteria. The step status will then be set to Interrupted.

  6. Deactivated: When a customer drops a call or a connection is dropped, routing will stop.

Scenarios

See these topics for scenarios that use this block: