> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wayak.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Escalation pattern analysis

> Identify systemic issues driving repeated escalations and recommend process fixes

Escalations are not just individual customer problems — they are signals. When the same type of issue gets escalated repeatedly, it points to a systemic failure: a confusing billing page, a recurring product bug, a policy gap, or inadequate agent training. But spotting these patterns manually means exporting ticket data, building pivot tables, and hoping someone has time to analyze the results. Most teams only review escalations reactively, one at a time.

This use case deploys an agent that analyzes escalated tickets across time, category, and root cause. A monthly playbook uses Python to run trend analysis on escalation data, group by root cause, quantify the impact, and deliver a report with recommended actions. You move from fighting individual fires to fixing the systems that cause them.

***

## What you need

<CardGroup cols={2}>
  <Card title="Data sources" icon="database">
    * **Helpdesk system** — Ticket records with escalation flags, escalation reason codes, resolution notes, and timestamps
    * **CRM system** — Customer account data to identify whether escalations cluster around specific segments or tiers
  </Card>

  <Card title="Knowledge spaces" icon="book-open">
    * **Escalation policies** — Upload your escalation criteria, SLA definitions, and routing rules
    * **Product known issues** — Documented bugs, workarounds, and planned fixes so the agent can cross-reference escalations against known problems
  </Card>
</CardGroup>

**Semantic layer:** Define these in your ontology before setting up the agent.

| Component | Name                    | Definition                                                                                                        |
| --------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------- |
| Object    | Escalated Ticket        | Maps to helpdesk tickets with escalation flag set to true. Represents an issue that exceeded frontline resolution |
| Object    | Resolution              | Maps to ticket resolution records. Includes resolution type, time, and agent notes                                |
| Metric    | Escalation Rate         | Escalated tickets divided by total tickets, as a percentage, over a given period                                  |
| Metric    | Mean Time to Escalation | Average minutes between ticket creation and escalation event                                                      |
| Dimension | Root Cause              | Groups escalations by underlying reason: product bug, policy gap, training gap, process failure                   |
| Dimension | Product Area            | Associates escalations with a specific product or feature                                                         |

<Tip>
  See [building a semantic layer](/quickstart/build-semantic-layer) for a step-by-step guide.
</Tip>

***

## Agent setup

<Steps>
  <Step title="Create the agent">
    Go to **Agent Space** > **New agent**.

    | Field    | Value                                                              |
    | -------- | ------------------------------------------------------------------ |
    | **Name** | Escalation Analyst                                                 |
    | **Role** | Escalation and root-cause specialist                               |
    | **Goal** | Identify patterns in escalated tickets and recommend process fixes |
  </Step>

  <Step title="Set the description">
    > You analyze escalated support tickets. Focus on identifying systemic issues — recurring product bugs, confusing documentation, or policy gaps. When presenting findings, group by root cause category and quantify impact (number of tickets, average resolution time, estimated cost). Use a neutral, analytical tone. Always include a recommended action for each pattern you identify. Cross-reference escalations against the known issues list and note when a pattern matches a documented bug.
  </Step>

  <Step title="Scope data access">
    Grant access to:

    * Helpdesk system data source (ticket records with escalation data)
    * CRM system data source (customer segments)
    * Escalation policies knowledge space
    * Product known issues knowledge space
    * Escalated Ticket and Resolution objects in the semantic layer
  </Step>

  <Step title="Add skills">
    <AccordionGroup>
      <Accordion title="Analyze escalation patterns">
        **Trigger:** User asks about escalation trends, root causes, or systemic issues

        1. Identify the time range from the user's request, defaulting to the last 30 days.
        2. Pull all escalated tickets for that period with their reason codes and resolution notes.
        3. Group escalations by root cause category and count occurrences.
        4. Rank root cause categories by frequency, with the highest first.
        5. For the top three categories, calculate average resolution time and identify the most common product area.
        6. Cross-reference against the product known issues knowledge space to flag matches.
        7. Present a summary table with root cause, count, percentage of total escalations, average resolution time, and recommended action.
      </Accordion>

      <Accordion title="Compare escalation rates by segment">
        **Trigger:** User asks whether escalation rates vary by customer type or segment

        1. Pull escalated tickets and total tickets for the specified period.
        2. Join with CRM data to get customer tier and segment.
        3. Calculate escalation rate for each segment.
        4. Identify segments with escalation rates significantly above the overall average.
        5. Present a comparison table with segment, total tickets, escalated tickets, escalation rate, and deviation from average.
      </Accordion>
    </AccordionGroup>
  </Step>
</Steps>

***

## Automation

### Playbook: Monthly escalation trend report

<Steps>
  <Step title="Set the trigger">
    Schedule the playbook to run on the first business day of each month at 8:00 AM.
  </Step>

  <Step title="Build the workflow">
    The playbook analyzes the previous month's escalation data, identifies trends, and generates a report for leadership.

    1. **Query step** — Pull all escalated tickets from the previous calendar month with reason codes, resolution data, and timestamps.
    2. **Query step** — Pull the same data for the month before that (for trend comparison).
    3. **Python code step** — Group escalations by root cause, calculate month-over-month change, and run a trend analysis to identify categories that are increasing.
    4. **Python code step** — Calculate the estimated cost impact by multiplying escalation count by average handle time and agent cost per hour.
    5. **Format step** — Build the report with three sections: overall escalation rate trend, top root causes with month-over-month change, and estimated cost impact.

    <Info>
      The **Python code steps** use Python code blocks to compute trend analysis (percentage change, moving averages) and cost impact estimates. You can customize the agent cost-per-hour variable and add additional statistical measures.
    </Info>
  </Step>

  <Step title="Configure delivery">
    Send the report via email to the VP of Customer Experience and Support team leads. Include the overall escalation rate and trend direction in the subject line.
  </Step>

  <Step title="Test and activate">
    Click **Run now** to test with live data, then toggle to **Active**.
  </Step>
</Steps>

***

## What's next

<CardGroup cols={2}>
  <Card title="SLA monitoring" icon="arrow-right" href="/use-cases/customer-service/sla-monitoring">
    Track response and resolution times and catch at-risk tickets before they breach.
  </Card>

  <Card title="All customer service use cases" icon="list" href="/use-cases/customer-service">
    See the full list.
  </Card>
</CardGroup>
