Search code examples
twiliotwilio-apitwilio-taskrouter

How to offer a task to a specific worker on Twilio


I'm using Twilio's TasksRouter.

I have 3 TaskQueues in my workspace and new tasks are being forwarded to the correct TaskQueue but I would also like them to be offered to a specific worker in that queue.

I thought that the task attributes are supposed to do that but even when my task has attributes such as {user_id: 123} the task is still offered to a worker with attributes like {user_id: 999}

Is that the correct approach? How else can I offer a task to a specific worker?

Thanks!


Solution

  • Twilio developer evangelist here.

    In order to send a task to a specific worker you need to set up a condition in your TaskRouter workflow based on the user_id attribute that you have given the task. You can set it to match the attribute and direct the task to a queue that is manned by just that worker.