A Smarter Way to Using Queue Rules

Are you using Kustomer’s Queues and Routing, and want your Queue Rules to be smarter, fewer, and easier to manage?

This is also for any organization just starting to build out their routing structure and want to spend less management overhead from the get-go.

Granted, you can create up to 100 Queue Rules. But managing 20 is certainly better than having to track and update 100.

The solution? Queue Keys!

When creating a queue, in addition to the Queue Name, you have the option to specify its Queue Key.

A queue key is a way of identifying a queue with a string. Think of this key like a shortcode you can use to refer to that queue.

Here is an example of a queue created with a queue key:

In the above example, you can create other language-based chat queues, such as:

Queue Display Name: Spanish Chat Queue

Queue Key Name: chat.es

Queue Display Name: French Chat Queue

Queue Key Name: chat.fr

Queue Display Name: German Chat Queue

Queue Key Name: chat.de


If you created Queue Rules using no queue keys, you would need 4 queue rules for each of these languages, with each queue rule similar to the below:

Now, this is where using Queue Keys becomes the smarter choice.

When you have a number of queues with a similar purpose but a slight variation, such as the above (chat conversations in various languages), rather than building multiple queue rules, you can just create one rule to route all those chats to their respective queues.

In our example case, a single Queue Rule can simply verify that the conversation channel is chat and what its language is.

Language is a standard conversation attribute, with the name defaultLang, therefore this attribute can be accessed in its raw format as conversation.defaultLang (see the raw formats of attributes in the Klasses section of your instance).

Continuing with our example, I would thus use the queue key chat.{{conversation.defaultLang}}.

I included chat as a string, because chat is the common word in my queue keys (chat.en, chat.es, chat.fr etc) and the language is the variable part, so I enclose that with {{}} and it will render that value when the queue rule finds the respective queue. So chat.{{conversation.defaultLang}} will become chat.fr for a conversation whose channel is chat and whose language is French.

Here is what such a Queue Rule might look like using this queue key:

If no matching queue key is found based on the conversation’s language (e.g. the conversation’s Default Language is Portuguese and you do not have an active queue with the queue key chat.pt, the rendered result would then be just chat. and no queue would be found.  The conversation would then get sent to the Default Queue.

You can easily use Conversation, Customer and Message attributes in queue keys. Simply change the word conversation to the name of the Klass you want to use (e.g. customer.locations or message.preview).  

Last but not least, you can also use custom attributes in queue keys, which is great!

Let’s say you have a custom attribute called Contact Reason in the Conversation Klass. This would look like conversation.custom.contactReasonTree.

And you have 3 contact reasons: Inquiry, Order, and Post-sale.

You may have your queues created with queue keys like the below for inquiries as an example:


Your queue rule to route email conversations based on their Contact Reason would look like the below:


For more details on creating Queue Rules, feel free to check out our Help Article here.
Have fun exploring Queues and Routing!