Aysali logo

Admin

Queue and Routing distribute conversations across your team automatically. Both assign chats to online agents in proportion to current workload (fewest active conversations first). Admins are excluded from assignment and always see all conversations.

Configure under Settings → General in the Aysali Bot admin panel.

Overview

ModeSettingPrimary effect
QueueQueue → ActiveVisitors may wait in a position queue when agents hit a concurrent chat limit
RoutingRouting → ActiveAssigns conversations without visitor queue UI; agents typically see only their own chats
Hide conversationsHide conversations of other agentsManual routing: agents see own + optionally unassigned threads

Queue and routing work with Departments. Assignment respects department on the conversation and on each agent profile.

Shared behavior

  • Online agents only — by default only agents marked online receive new assignments (sb_get_online_user_ids('agent') or Pusher presence).
  • Proportional load — sb_routing_find_best_agent() picks the online agent with the fewest active conversations (status codes 0, 1, 2).
  • No agents online — conversation stays unassigned until an agent comes online; when an agent loads the admin area, unassigned chats can auto-assign (sb_routing_assign_conversations_active_agent).
  • Archive to complete — agents mark work done by archiving (status 3). Active conversations are those not archived or deleted.
  • Agent inbox scope — with routing/queue/hide active, agents normally search and filter only their assigned conversations, but can still open all conversations of one user.
  • Human takeover — when chatbot human takeover is enabled, queue on the widget is deferred until takeover (queue_human_takeover); routing queue checks in sb_queue_check_and_run follow the same rule.
  • Agents menu (admin) — the agent assignment panel on the right in Conversations appears when routing is on, queue is on (for admins), or Hide conversations → Agents menu is enabled.

Agent online / offline

Hover the profile image (bottom-left of the admin area) and click the status label in the profile pop-up to switch between online and offline.


Queue

Settings → General → Queue

SettingPurpose
ActiveEnable queue mode
Concurrent chatsMax active (non-archived) conversations per agent before additional users wait
Response time (minutes)Minutes per queue position for wait-time estimate
SoundPlay a sound when it is the visitor’s turn
MessageQueue status text; supports \{position\} and \{minutes\} merge fields
Your turn messageSent when the user reaches the front and an agent is assigned

How the visitor queue works

  1. User sends a message while all eligible agents are at Concurrent chats capacity → user enters the queue.
  2. Widget shows position and estimated wait: position × response time (for example position 5 × 4 minutes = 20 minutes).
  3. Merge fields \{position\} and \{minutes\} in Message are replaced in real time.
  4. When an agent archives a conversation, capacity frees and the next queued user is assigned.
  5. At turn zero, Your turn message is sent and queue UI clears.

Queue timeout (1 minute)

If a queued user leaves (closes browser) for more than 1 minute, their slot expires in the queue store. When they return, queue position resets. The conversation may remain unassigned (visible to admins only until assigned).

Offline message vs queue UI

If the Offline message bot message is active for the check, queue progress UI may be suppressed (sb_execute_bot_message('offline', 'check')) — use offline message settings to avoid showing queue updates in specific scenarios.

External channels (WhatsApp, Messenger, etc.)

Messaging apps assign through sb_routing_find_best_agent immediately on inbound messages; visitors do not see the web queue widget. Concurrent limits behave differently from live chat — conversations are assigned to online agents proportionally without the visitor-facing queue. If no agent is available, threads stay unassigned until someone comes online.

Testing the queue

  1. Open the chat in multiple browsers (Chrome, Firefox, private/incognito, etc.) to simulate several users and agents.
  2. Reset a visitor session: browser console → SBF.reset() → Enter.

Routing

Settings → General → Routing

SettingPurpose
ActiveEnable automatic proportional assignment
Disable online status checkDistribute among all agents (not only online); when an agent returns online, unassigned conversations assign to them

Routing-only behavior

  • New conversations assign to the least-loaded available agent.
  • Agents can manually route conversations to another agent from the right panel in Conversations (when permitted).
  • Reopened archived chats — if the user messages again and the assigned agent is offline, routing reassigns to another agent (sb_update_conversation_agent with routing / routing-unassigned).

Manual routing

Settings → General → Hide conversations of other agents

Automatically activated when Queue or Routing is on. Controls agent visibility and manual pickup.

SettingPurpose
ActiveAgents see only conversations assigned to them (plus rules below)
Agents menuShow agent assignment menu in Conversations sidebar
Routing if offlineWhen user reopens an archived chat and assigned agent is offline, reassign to another online agent (routing mode only, not when queue is active)
View unassigned conversationsAgents see unassigned threads; replying auto-assigns the conversation and removes it from other agents’ views in real time

Enable View unassigned conversations to let agents pick up open chats manually.


Agents menu

Two related features:

Admin Conversations panel

Right-side Agents list to assign selected conversations to an agent. Enabled when queue/routing is active or Hide conversations → Agents menu is on. Select multiple conversations (keyboard shortcuts) then choose an agent.

Chat dashboard (visitor)

Settings → Chat → Agents menu

SettingPurpose
ActiveShow agents on dashboard; visitor must pick an agent before chatting
One conversation per agentOnly one open conversation per agent
Display online agents onlyHide offline agents from the list
Dashboard titleHeading above the agent list

Assign an agent to a conversation

MethodDetails
Queue / RoutingAutomatic via sb_routing_find_best_agent
Admin UIAgents menu in Conversations
Chatbot Q&A — Set dataPayload key agent
Chatbot flows — ActionsAction agent with agent user ID
Dashboard agents menuSettings → Chat → Agents menu → Active
Automations → MoreSet Agent on matching URL/path rules
JavaScriptvar SB_DEFAULT_AGENT = ID; before embed (numeric agent user ID)
APIupdate-conversation-agent with conversation_id and agent_id

JavaScript example

<script>
  var SB_DEFAULT_AGENT = 12;
</script>

API example

{
  "function": "update-conversation-agent",
  "conversation_id": 1057,
  "agent_id": 12
}

Special values routing and routing-unassigned re-run automatic routing (admin/agent API).