Advanced Actions

Assigning Chat to a specific agent or based on rules

Using this action, you can specify the Assignee of the chat based on your business logic. To use this node, you need to follow these steps

  1. Add a Dynamic Node in your playbook at the stage we want to initiate the assignment.

  2. Add the code that creates an Action Node using the code

To assign directly to a specified agent

return {
actions: [
{
"type": "ASSIGN_AGENT",
"assignment_type": "DIRECT",
"assignee": <id of the agent>
}
]
}

As of now, we do not have agent ids visible in front end. So, you can request the list of agent ids from our support by writing to [email protected]

To assign the chat based on a rule - assign only to Online Agents

return {
actions: [
{
"type": "ASSIGN_AGENT",
"assignment_type": "RULE_BASED",
"assign_rule": {
"agent_type": [
"Owner",
"Admin",
"Member"
],
"status": "ONLINE"
},
"reassign_attempt" : 2,
"reassign_delay" : 120
}
]
}

If the action could not find any agent matching the rule, the chat remains unassigned.

Assign Agent Action Node Schema

Field Name

Field Type

Description

Required

type

String

Fixed value - ASSIGN_AGENT

Yes

assignment_type

String

One of the two values DIRECT - directly assigning chat to a specified agent RULE_BASED - assigning chat based on rules

Yes

assignee

String

The id of the agent to whom the chat has to be assigned

When assignment_type = DIRECT

assign_rule

JSON Object

Contains the rule to assign the agent

When assignment_type = RULE_BASED

  • agent_type

Array of String

Type of agent role to which the chat has to be assigned.

Possible values - Owner, Admin, Member

At least one value is required when assignment_type = RULE_BASED

  • status

String

To specify if only online agents are to be assigned or offline agents can be assigned chats too.

Possible values - DEFAULT, ONLINE, OFFLINE

DEFAULT means assign irrespective of their online status

Optional.

Default value = DEFAULT

reassign_attempt

Number

Number of re-attempts after the first assign attempt fails. This only happens in rule based assignment when no agent is found as per the rule

Optional.

Default value = 0

reassign_delay

Number

Delay in secons between each re-assign attempt.

Optional.

Default value = 60