Requeue snoozed conversations that reopen while an agent is offline
Last Update: Oct 2024 • Est. Read Time: 5 MINWhen agents sign off for the day to end their shifts, a lot of their conversations may still be in the snoozed status. When those conversations receive a reply from the customer and reopen, It is useful to requeue those conversations so another available agent can get that conversation routed to them. This will help provide your customers an instant reply, rather than making them wait for the original agent to come back online.
This can be set up by configuring a few settings and adding the workflow linked below. This workflow can be adjust to cater to your organization's specific needs and any unique user statuses you may have.
Who can access this feature? | |
User types | Admins and any users with permission to access workflows. |
In this article
Set up workflow
This workflow will be triggered on a conversation update step, and then it will check if the conversation that was update changed from a status of Snoozed to Open. If it has, then the workflow will make an HTTP GET
request and check if the assigned user of the conversation is in an available status or not. Finally, if the assigned user is unavailable, it will unassign the user and put the conversation back in the queue to get routed to another available user to take action.
- Download the JSON code for workflow.
- Go to Settings> Platform > Workflows.
- Select Add Workflow.
- Choose Import Workflow.
- Select Select File.
- Select the JSON code file.
- Select Save.
Create API key
The third step of the workflow is an HTTP GET
request to fetch the available user's current status. For this step to work we will need to create an API key and then add it to the workflow.
- Go to Settings> Security >API Keys
- Select Add API Key.
- Give the API Key a Name.
- Under Role, add
org.user.routing.read
. - Select No Expiration for Expires (in days)
- Select Create
- Copy the token and save it to a secure location to use in the next step.
Add API key to workflow
Now that the API key has been created, it will need to be added to the workflow to support the HTTP GET
request. Add the API key to the workflow, and then create a variable to be used in step three of the workflow.
- In the Workflow Editor, open the Workflow Options menu and select Workflow Variables.
- Give the variable a Name.
- Paste the API Key that was saved earlier in the Value section.
- Select Save.
- On the REST API: Generic steps, select the key icon in the Headers field.
- Select the variable you just created to copy it to your clipboard.
- Replace the existing variable with your new one.
- Select Save.
JSON code for workflow
Save this code sample to your computer, then follow the instructions in Set up workflow. Remember to turn on the workflow on when you're ready to begin using it.
Reactivate on Message Create Workflow
{ "description": "", "name": "requeue", "steps": [ { "transitions": [ { "target": "v1A1LJ-VT", "condition": { "op": "true", "values": [ true ] } } ], "errorCases": [], "id": "yKVhLZnGE", "action": "kustomer.conversation.find-by-id", "params": { "id": "/#steps.1.id" }, "appVersion": "kustomer-^1.9.2" }, { "transitions": [], "errorCases": [], "id": "WAwwZTdZe", "action": "kustomer.conversation.update", "params": { "assignedUsers": [], "id": "/#steps.yKVhLZnGE.id" }, "appVersion": "kustomer-^1.9.2" }, { "transitions": [ { "target": "WAwwZTdZe", "condition": { "op": "eq", "values": [ "/#steps.v1A1LJ-VT.response.statusCode", "404" ] }, "meta": { "name": "Offline?" } } ], "errorCases": [], "id": "v1A1LJ-VT", "action": "kustomer.rest-api.generic", "params": { "uri": "https://***YOUR ORG HERE***.api.kustomerapp.com/v1/routing/users/{{steps.yKVhLZnGE.assignedUsers}}/work-sessions/current", "method": "GET", "headers": { "content-type": "application/json", "Authorization": "Bearer {{{variables.63728ea73c155fd97691173e}}}" }, "json": true }, "appVersion": "kustomer-^1.9.2", "meta": { "displayName": "Check User Work Session" } } ], "trigger": { "transitions": [ { "target": "yKVhLZnGE", "condition": { "op": "and", "values": [ { "op": "eq", "values": [ "/#steps.1.changes.attributes.status.before", "snoozed" ] }, { "op": "eq", "values": [ "/#steps.1.changes.attributes.status.after", "open" ] } ] }, "meta": { "name": "Re-opened" } } ], "eventName": "kustomer.conversation.update", "id": "1", "appVersion": "kustomer-^1.9.2" } }