---
name: intelligent-ticket-routing
description: "Route tickets to the most qualified agent based on expertise, workload, availability, and historical performance. Use when configuring skill-based routing, setting up workload balancing, implementing language matching, or building follow-the-sun routing for global teams. Triggers on phrases like 'ticket routing', 'agent assignment', 'skill-based routing', 'workload balancing', 'auto-assign tickets', 'follow-the-sun', 'language matching', 'routing algorithm', 'queue management'."
---

# Intelligent Ticket Routing & Agent Assignment

Route every ticket to the optimal agent using a multi-factor algorithm that balances skill match, workload, availability, historical performance, and customer preferences.

## Workflow

### Phase 1: Routing Configuration

1. **Define agent skill profiles**:
   - Technical competencies (database, API, frontend, mobile, integrations)
   - Product expertise (by product line, module, version)
   - Language fluency (primary, secondary, certification level)
   - Customer tier authorization (enterprise-only agents, VIP handlers)
   - Soft skills (de-escalation, executive communication, training)
2. **Set routing algorithm parameters**:
   - Primary: skill match (40%)
   - Secondary: workload balance (25%)
   - Tertiary: historical performance with similar issues (20%)
   - Quaternary: customer preference/agent relationship (10%)
   - Tertiary constraint: time zone alignment (5%)
3. **Configure queue hierarchy**:
   - Primary queue → secondary queue → overflow queue → manual pool
   - Backstop routing when no agent matches (team lead assignment)
   - Auto-queue when all agents at capacity (wait time estimation)

### Phase 2: Real-Time Routing Engine

1. **Incoming ticket evaluation**:
   - Extract category, priority, language, customer tier from ticket metadata
   - Identify required skill set from category mapping
   - Check for customer-specified agent preference
2. **Agent availability scan**:
   - Query online agents with matching skills
   - Filter by current workload (active ticket count vs. capacity)
   - Filter by availability status (online, away, DND, offline)
   - Check time zone alignment for expected follow-up windows
3. **Score & rank candidates**:
   - Calculate composite routing score for each eligible agent
   - Rank by score; assign to top candidate
   - If no match within 30 seconds: escalate to team lead pool
4. **Assignment & notification**:
   - Assign ticket with routing reason code
   - Push notification to agent (Slack, email, desktop, mobile)
   - Start SLA timer; update queue dashboard

### Phase 3: Dynamic Re-routing & Load Management

1. **Automatic re-routing triggers**:
   - Agent goes offline/away → reassign to next eligible agent
   - SLA breach risk (no activity for 50% of SLA) → reassign
   - Agent workload exceeds threshold → redistribute new tickets
   - Customer explicitly requests different agent
2. **Overflow management**:
   - Queue depth monitoring with capacity alerts
   - Auto-scale: wake on-call agents when queue > threshold
   - Overflow routing to secondary team or general pool
   - Customer communication: estimated wait time updates
3. **Performance tracking**:
   - Track routing accuracy (did first assignment resolve?)
   - Monitor re-routing rate (target: <15%)
   - Agent satisfaction with routing fairness

## Templates

### Routing Algorithm Configuration

```
INTELLIGENT ROUTING CONFIGURATION
===================================
Version: [4.0] | Last Updated: [Date]

ROUTING FACTORS & WEIGHTS:
┌─────────────────────────────┬────────┬──────────────────────────────┐
│ Factor                      │ Weight │ Configuration                │
├─────────────────────────────┼────────┼──────────────────────────────┤
│ Skill Match                 │ 40%    │ Exact match = 40,            │
│                             │        │ Partial match = 25,          │
│                             │        │ No match = 0                 │
│ Current Workload            │ 25%    │ 0-2 active = 25 points,      │
│                             │        │ 3-5 active = 15 points,      │
│                             │        │ 6+ active = 5 points         │
│ Historical Performance      │ 20%    │ FCR rate with similar issues │
│                             │        │ (>80% = 20, 60-80% = 12,    │
│                             │        │ <60% = 5)                    │
│ Customer Relationship       │ 10%    │ Same agent handled before    │
│                             │        │ (+10 if >3 prior tickets)    │
│ Time Zone Alignment         │ 5%     │ Same timezone = 5 points,    │
│                             │        │ Within 2 hours = 3 points    │
└─────────────────────────────┴────────┴──────────────────────────────┘

QUEUE HIERARCHY:
  Level 1: Specialized team queue (exact skill match)
  Level 2: General team queue (partial skill match)
  Level 3: Overflow pool (any available agent)
  Level 4: Manual assignment (team lead decision)
  Backstop: Auto-assign to least-loaded agent (any category)

CAPACITY RULES:
  Max concurrent tickets per agent: 8
  Max P0/P1 tickets per agent: 2
  Cool-down period after P0 assignment: 30 minutes
  Away status: pause new assignments for 15 minutes
  Offline: reassign all active tickets within 10 minutes

RE-ROUTING TRIGGERS:
  - No agent activity > 50% of SLA time → reassign
  - Agent status change (online → offline) → immediate reassign
  - Workload exceeds 1.5x capacity → pause new routing to agent
  - Customer requests different agent → manual override
```

### Agent Skill Profile Template

```
AGENT SKILL PROFILE — [Agent Name]
====================================
Employee ID: [ID] | Team: [Team Name] | Start Date: [Date]

TECHNICAL COMPETENCIES:
  Database:        ██████████░░ Expert (9/10)
  API/Integration: ████████░░░░ Advanced (7/10)
  Frontend/UI:     ██████░░░░░░ Intermediate (5/10)
  Mobile Apps:     ████░░░░░░░░ Basic (3/10)
  Security:        ███████░░░░░ Proficient (6/10)

PRODUCT EXPERTISE:
  Product A (Core Platform): Certified ✓
  Product B (Analytics):     Proficient
  Product C (Mobile):        Basic
  Product D (Enterprise):    Certified ✓

LANGUAGES:
  English: Native
  Spanish: Fluent (certified)
  French:  Conversational

AUTHORIZATIONS:
  Enterprise tier support: ✓
  VIP/Executive handling:  ✓
  Security incident response: ✗ (training pending)
  Refund processing (>$1000): ✗ (manager approval required)

PERFORMANCE METRICS (Last 90 Days):
  First Contact Resolution: 78% (team avg: 72%)
  Average Handle Time: 12.3 min (team avg: 14.1 min)
  CSAT Score: 4.6/5.0 (team avg: 4.3/5.0)
  Tickets Resolved: 342 (team avg: 298)
  Routing Accuracy: 91% (assigned → resolved without re-route)
```

## Integration Points

- **Ticketing systems**: Zendesk, Freshdesk, Intercom, Jira Service Desk, Front
- **CRM**: Salesforce, HubSpot (customer tier, history, preferences)
- **WFM (Workforce Management)**: NICE, Verint, Calabrio (scheduling, capacity)
- **Communication**: Slack, Microsoft Teams, Twilio (agent notifications)
- **Analytics**: Tableau, Power BI (routing dashboards, agent scorecards)
- **Agent desktop**: Zendesk Agent Workspace, Front Inbox
- **Timezone services**: World Time API, holiday calendar integrations
- **HR systems**: Workday, BambooHR (agent skill profile data)

## Edge Cases

| Scenario | Handling |
|----------|----------|
| All qualified agents offline | Route to overflow pool; notify team lead; extend SLA with customer notification |
| Agent capacity exceeded team-wide | Activate overflow routing; page on-call agents; auto-reply with wait estimate |
| Customer requests unavailable agent | Assign to backup agent; notify customer; offer callback option |
| Multi-language ticket | Language detection → route to fluent agent; if none, use translation layer |
| Agent on PTO/unexpected absence | Pre-assignment redistribution; auto-reassign active tickets within 15 min |
| VIP customer + no specialist available | Escalate to team lead; bypass skill matching for authority-based routing |
| Ticket requires cross-team collaboration | Assign to primary owner; auto-cc secondary team; create linked tickets |
| Round-robin vs skill-based conflict | Skill-based takes priority; round-robin only among equal-scored candidates |

## Output

### Routing Dashboard

```
ROUTING PERFORMANCE — Real-Time Dashboard
==========================================
As of: 2025-01-15 10:30 UTC

ROUTING METRICS:
  Tickets routed today: 347
  Auto-assigned: 318 (91.6%)
  Manual assignment: 22 (6.3%)
  Overflow pool: 7 (2.0%)
  Average routing time: 1.4 seconds

AGENT UTILIZATION:
  Online agents: 28 / 35 total
  Average active tickets/agent: 4.2 (capacity: 8)
  Highest workload: Agent Sarah (7/8 — approaching limit)
  Lowest workload: Agent Tom (1/8 — eligible for overflow)

QUEUE DEPTH:
  Engineering queue:    12 tickets (avg wait: 2 min)
  Billing queue:         5 tickets (avg wait: <1 min)
  General Support:      18 tickets (avg wait: 4 min)
  Overflow pool:         3 tickets (avg wait: 8 min)

ROUTING QUALITY (Last 7 Days):
  First-assignment resolution rate: 73.4%
  Re-routing rate: 11.2% (Target: <15%)
  Agent satisfaction (routing fairness): 4.2/5.0
  Average handles before resolution: 1.8

TOP ROUTING PATTERNS:
  1. API issues → DevOps team (94% accuracy)
  2. Billing questions → Finance support (91% accuracy)
  3. Mobile bugs → Mobile team (89% accuracy)
  4. Enterprise VIP → Senior agents (97% accuracy)
```
