メニュー

Expand
ページを評価:

Activity Based Routing

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:

  • Route high-value Tasks to Workers even when they are scheduled to not receive general Tasks.
  • Transfer Tasks to Agents who are in Activities that are excluded from routing.
  • Designate an Activity that allows an agent to only accept a particular type of task.

Expressionの構文

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 概要
worker.activity_name The Friendly Name of the Activity Resource
worker.activity_sid The SID of the Activity Resource

Operator 概要
== 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:

Look for a match in an array of friendly names

worker.activity_name in ['Generally Available', 'High Value Tasks']

Check for equality with an activity SID

worker.activity_sid == 'WAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

サンプル

High Value Task Routing

This example contains two expressions:

  1. TaskRouter should route general Tasks to generally available Workers.
  2. For high-value Tasks, TaskRouter can route to general workers OR a collection of workers who are available for high-value Tasks only.
{
  task_routing: {
    filters: [
      {
        filter_friendly_name: "General Routing",
        expression: "high_value == false",
        targets: [
          {
            queue: "WQxyz1",
            expression: "worker.activity_name == ’General Avail’",
            priority: "50"
          }
        ]
      }
      {
        filter_friendly_name: "High value Tasks",
        expression: "high_value == true",
        targets: [
          {
            queue: "WQxyz2",
            expression: "worker.activity_name == ’Limited Avail’ OR
                         worker.activity_name == ’General Avail’",
            priority: "100"
          }
        ]
      },
    ]
  }
}

次のステップ

ページを評価:

ヘルプが必要ですか?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        
        
        

        フィードバックくださりありがとうございます!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        ステップ1

        Get link

        Get a free personal referral link here

        ステップ2:

        Give $10

        Your user signs up and upgrade using link

        ステップ3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more