TaskRouter gives you the option to evaluate against worker Activity state.
worker.activity_name in ['Generally Available', 'High Value Tasks']
This allows you to target or exclude agents based on the Activity that they are in.
With activity-based routing, you can:
You can write TaskRouter Expressions using Activity Name or Activity SIDs, and you can compare against a single value or an array of values.
Activity | Description |
---|---|
worker.activity_name | The Friendly Name of the Activity Resource |
worker.activity_sid | The SID of the Activity Resource |
Operator | Description |
---|---|
== | Compares to a single Activity Name or SID |
in | Checks if the value is in an array of Activity Names or SIDs |
You can mix and match these Activity references and operators to create various expressions, like:
worker.activity_name in ['Generally Available', 'High Value Tasks']
worker.activity_sid == 'WAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
This example contains two expressions:
1{2task_routing: {3filters: [4{5filter_friendly_name: "General Routing",6expression: "high_value == false",7targets: [8{9queue: "WQxyz1",10expression: "worker.activity_name == 'General Avail'",11priority: "50"12}13]14}15{16filter_friendly_name: "High value Tasks",17expression: "high_value == true",18targets: [19{20queue: "WQxyz2",21expression: "worker.activity_name == 'Limited Avail' OR22worker.activity_name == 'General Avail'",23priority: "100"24}25]26},27]28}29}30