# About Auto-Distribution of Dialogs Between Operators

Auto-distribution of dialogs allows automatically assigning dialogs to operators in a status that allows working with dialogs. The system considers various criteria for fair load distribution and efficient use of operator resources.

---

## Context and Problem

In many cases, dialogs need to be fairly distributed between operators:
- Large number of incoming requests requires quick processing
- Different operators have different skills and load
- Fair load distribution is needed
- Optimization of response time to client requests

Auto-distribution solves this task by allowing the system to automatically assign dialogs to operators considering various criteria.

---

## Key Concepts

### Operator Selection Criteria

Determining the operator to whom the dialog will be assigned happens considering:
- Operator status (online)
- Dialog limit per channel (settings)
- General dialog limit (settings)
- Automatic distribution method (settings)

### Automatic Distribution Methods

**By Default:**
- Considers number of dialogs per operator
- Considers time of closing last dialog
- New dialog is distributed to operator with least number of dialogs

**By Number of Dialogs:**
- Considers only number of dialogs per operator
- New dialog is distributed to operator with least number of dialogs

**By Date of Last Dialog:**
- Considers time of assigning operator's last dialog
- New dialog is distributed to operator who started last dialog earliest

---

## Approach Options

### Different Distribution Methods

**By Default:**
- ✅ Pros: Considers multiple factors, fair distribution
- ❌ Cons: May be more complex to understand

**By Number of Dialogs:**
- ✅ Pros: Simplicity, clarity
- ❌ Cons: Does not consider time of last dialog

**By Date of Last Dialog:**
- ✅ Pros: Even distribution by time
- ❌ Cons: Does not consider number of dialogs

**Why We Use Different Methods:**
Different methods suit different scenarios and client needs, allowing choosing the best option for a specific situation.

---

## Adopted Solutions

### Auto-Distribution by Weight

Weight indicates the importance of the dialog in the queue: the higher the weight — the earlier it will be distributed to an operator. Weight can be specified:
- In topics in operator panel
- When connecting through `weight` parameter (has higher priority)

### Dialog Limits

Thanks to the ability to set limits on operators for each channel, you can optimize team work:
- **General Limit (`max_dialogs`):** Maximum number of simultaneous dialogs
- **Per Channel Limit (`channels_quota`):** Additional restrictions on number of dialogs from specific channels

**Note:** If you need stricter enforcement of operator limits under high load, ask your administrator: instance settings may offer strengthened quota control for your deployment so operators do not exceed the configured limits.

### Auto-Distribution of Tickets

The system supports automatic distribution of tickets between operators, similar to dialog distribution, considering operator skills (skill groups) and their current load.

---

## Implications for Users and Implementation

### For Integrators

When configuring auto-distribution, it's important to:

1. **Choose distribution method** — depending on needs and priorities
2. **Configure limits** — for each operator separately
3. **Set weight** — for prioritizing important dialogs
4. **Configure tickets** — if ticket auto-distribution is needed

### Common Errors

**Error:** Dialogs are distributed unfairly  
**Problem:** Distribution method is incorrectly chosen or limits are not configured  
**Solution:** Check distribution method and configure limits for operators

**Error:** Important dialogs are not processed first  
**Problem:** Weight is not set for important dialogs  
**Solution:** Add weight in topics or when connecting through `weight` parameter

**Error:** Operators are overloaded  
**Problem:** Limits are not set or they are too high  
**Solution:** Configure limits for operators according to their capabilities

---

## Related Documents

- **Explanation:** [Automatic Connection of Free Operator](/en/operatorline/explanation/auto-connect-free-operator.md) — configuring automatic connection
- **Explanation:** [Connecting Chat with Operator](/en/operatorline/explanation/connect-chat-to-operator.md) — configuring connection to operator

