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
| Mode | Setting | Primary effect |
|---|---|---|
| Queue | Queue → Active | Visitors may wait in a position queue when agents hit a concurrent chat limit |
| Routing | Routing → Active | Assigns conversations without visitor queue UI; agents typically see only their own chats |
| Hide conversations | Hide conversations of other agents | Manual 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 insb_queue_check_and_runfollow 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
| Setting | Purpose |
|---|---|
| Active | Enable queue mode |
| Concurrent chats | Max active (non-archived) conversations per agent before additional users wait |
| Response time (minutes) | Minutes per queue position for wait-time estimate |
| Sound | Play a sound when it is the visitor’s turn |
| Message | Queue status text; supports \{position\} and \{minutes\} merge fields |
| Your turn message | Sent when the user reaches the front and an agent is assigned |
How the visitor queue works
- User sends a message while all eligible agents are at Concurrent chats capacity → user enters the queue.
- Widget shows position and estimated wait: position × response time (for example position 5 × 4 minutes = 20 minutes).
- Merge fields
\{position\}and\{minutes\}in Message are replaced in real time. - When an agent archives a conversation, capacity frees and the next queued user is assigned.
- 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
- Open the chat in multiple browsers (Chrome, Firefox, private/incognito, etc.) to simulate several users and agents.
- Reset a visitor session: browser console →
SBF.reset()→ Enter.
Routing
Settings → General → Routing
| Setting | Purpose |
|---|---|
| Active | Enable automatic proportional assignment |
| Disable online status check | Distribute 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_agentwithrouting/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.
| Setting | Purpose |
|---|---|
| Active | Agents see only conversations assigned to them (plus rules below) |
| Agents menu | Show agent assignment menu in Conversations sidebar |
| Routing if offline | When 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 conversations | Agents 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
| Setting | Purpose |
|---|---|
| Active | Show agents on dashboard; visitor must pick an agent before chatting |
| One conversation per agent | Only one open conversation per agent |
| Display online agents only | Hide offline agents from the list |
| Dashboard title | Heading above the agent list |
Assign an agent to a conversation
| Method | Details |
|---|---|
| Queue / Routing | Automatic via sb_routing_find_best_agent |
| Admin UI | Agents menu in Conversations |
| Chatbot Q&A — Set data | Payload key agent |
| Chatbot flows — Actions | Action agent with agent user ID |
| Dashboard agents menu | Settings → Chat → Agents menu → Active |
| Automations → More | Set Agent on matching URL/path rules |
| JavaScript | var SB_DEFAULT_AGENT = ID; before embed (numeric agent user ID) |
| API | update-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).