Steadybase
Temporal Workflows

Ticket Resolution Workflow

AI-powered ticket analysis with SLA tracking and automatic escalation.

Ticket Resolution Workflow

A 2-step Temporal workflow that analyzes support tickets using AI and tracks SLA compliance with automatic escalation.

Workflow Definition

interface TicketResolutionInput {
  ticketId: string;
  subject: string;
  description: string;
  priority: 'P1' | 'P2' | 'P3' | 'P4';
  accountId: string;
}
 
interface TicketResolutionOutput {
  analysis: string;
  classification: string;
  resolution: string | null;
  slaBreached: boolean;
}

Steps

AI Analysis Activity: analyzeTicket

AI analyzes the ticket content to:

  • Classify the issue type (bug, feature request, configuration, billing)
  • Assess severity and impact
  • Search memory for similar past tickets
  • Suggest potential resolution paths

Wait for Resolution or SLA Breach Signal-based wait

The workflow waits for either:

  1. A resolve signal indicating the ticket has been resolved
  2. The SLA timer to expire, triggering automatic escalation
const resolved = await condition(
  () => ticketResolved,
  slaTimeout  // Based on priority
);
 
if (!resolved) {
  await escalateToRevOps(ticketId, 'SLA breach');
}

SLA Timers

PriorityResponse SLAResolution SLAEscalation
P1 (Critical)15 minutes4 hoursVP Support → CTO
P2 (High)1 hour24 hoursSupport Manager
P3 (Medium)4 hours72 hoursRevOps Queue
P4 (Low)24 hours1 weekStandard Queue

Signals

SignalParametersPurpose
resolve{ resolution, resolvedBy }Mark ticket as resolved

Queries

QueryReturns
statusCurrent state, SLA countdown, analysis results

Escalation Flow

Ticket Created → AI Analysis → Waiting for Resolution

                    ┌─────────────────┴─────────────────┐
                    │                                   │
              Signal: resolve                    SLA Timer Expires
                    │                                   │
                    ▼                                   ▼
               Resolved                     Escalate to RevOps

                                            Notification sent
                                            (WebSocket + Slack)

On this page