AI-Powered Ticket Urgency Classification System
Ticket Urgency Classification
An intelligent ticket classification system based on RAG architecture that retrieves historical cases via vector search to automatically determine ticket urgency, supporting automated logging and anomaly alerts.
Workflow Overview
This is an intelligent customer service ticket urgency classification system based on the RAG (Retrieval-Augmented Generation) architecture. The workflow receives ticket data via a Webhook, stores and retrieves historical ticket information using the Pinecone vector database, leverages Anthropic Claude large language model for intelligent analysis and classification, logs the processed results into Google Sheets, and sends alert notifications through Slack in case of errors.
Core Features
The workflow implements an end-to-end automated ticket processing pipeline:
- Data Ingestion & Preprocessing: Receives ticket data via a POST Webhook
- Text Embedding: Splits ticket content into chunks and converts them into vector representations
- Knowledge Base Management: Stores and retrieves relevant ticket information in the Pinecone vector database
- Intelligent Analysis: Uses an AI Agent combined with historical data to assess urgency levels
- Result Logging: Automatically writes classification results to Google Sheets
- Exception Monitoring: Sends real-time Slack alerts when errors occur
Detailed Node Analysis
1. Webhook Trigger (Entry Node)
Node Type: n8n-nodes-base.webhook
Configuration:
- HTTP Method: POST
- Path:
ticket-urgency-classification - Position: (-300, 0)
Functionality: Serves as the workflow trigger, listening for incoming ticket data from external systems. When a new ticket is created, its details are sent to this node via a POST request.
Output Connections:
- Main output flows to Text Splitter (text chunking)
- Also connects to Window Memory (session memory)
2. Text Splitter (Text Chunker)
Node Type: @n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter
Configuration:
- Chunk Size: 400 characters
- Overlap Length: 40 characters
- Position: (-130, 0)
Functionality: Splits the received ticket text into fixed-size chunks for subsequent vectorization. A 40-character overlap ensures contextual continuity and prevents critical information loss at chunk boundaries.
Output Connections:
- Main output to Embeddings
- AI text splitter output to Pinecone Insert
3. Embeddings (Vector Embedding)
Node Type: @n8n/n8n-nodes-langchain.embeddingsCohere
Configuration:
- Model:
embed-english-v3.0 - Position: (70, 0)
- Credentials: Cohere API
Functionality: Converts text chunks into vector representations using Cohere's embedding model, which is optimized for English text and captures semantic meaning effectively.
Output Connections:
- AI embeddings output connects simultaneously to:
- Pinecone Insert (vector storage)
- Pinecone Query (vector retrieval)
4. Pinecone Insert (Vector Storage – Insert)
Node Type: @n8n/n8n-nodes-langchain.vectorStorePinecone
Configuration:
- Mode: insert
- Index Name:
ticket_urgency_classification - Position: (270, 0)
- Credentials: Pinecone API
Functionality: Stores the vector representation of tickets in the Pinecone vector database, building a knowledge base of historical tickets. Each new ticket is added to the index for future similarity-based retrieval.
5. Pinecone Query (Vector Retrieval – Query)
Node Type: @n8n/n8n-nodes-langchain.vectorStorePinecone
Configuration:
- Index Name:
ticket_urgency_classification - Position: (270, -180)
- Credentials: Pinecone API
Functionality: Retrieves the most similar historical tickets from the Pinecone vector database by calculating vector similarity, providing semantically relevant cases as references for classification.
Output Connection: AI vector store output to Vector Tool
6. Vector Tool (Vector Utility)
Node Type: @n8n/n8n-nodes-langchain.toolVectorStore
Configuration:
- Tool Name: Pinecone
- Description: Vector context
- Position: (450, -180)
Functionality: Wraps vector retrieval capabilities into a tool callable by the AI Agent, enabling the agent to actively query relevant historical ticket information.
Output Connection: AI tool output to RAG Agent
7. Window Memory (Sliding Window Memory)
Node Type: @n8n/n8n-nodes-langchain.memoryBufferWindow
Version: 1.3
Position: (450, -40)
Functionality: Provides short-term memory for the AI Agent by preserving recent conversation context, enabling the agent to understand contextual relationships across multi-turn interactions.
Output Connection: AI memory output to RAG Agent
8. Chat Model (Language Model)
Node Type: @n8n/n8n-nodes-langchain.lmChatAnthropic
Position: (450, -340)
Credentials: Anthropic API
Functionality: Uses Anthropic Claude as the reasoning engine for the Agent. Claude interprets ticket content, analyzes relevant historical cases, and determines urgency levels.
Output Connection: AI language model output to RAG Agent
9. RAG Agent (Retrieval-Augmented Generation Agent)
Node Type: @n8n/n8n-nodes-langchain.agent
Configuration:
- Prompt Type: define
- Text: "Handle data"
- System Message: "You are an assistant for Ticket Urgency Classification"
- Position: (720, -40)
Functionality: The core decision-making node of the workflow. This Agent integrates the language model, vector retrieval tool, and memory system to:
- Analyze current ticket content and characteristics
- Invoke the vector tool to retrieve similar historical cases
- Make intelligent judgments leveraging contextual memory
- Output the urgency classification result
Output Connections:
- Main output to Append Sheet
- Error output to Slack Alert
10. Append Sheet (Data Logging)
Node Type: n8n-nodes-base.googleSheets
Configuration:
- Operation: append
- Document ID: SHEET_ID
- Sheet Name: Log
- Column Mapping: Status
- Position: (930, -40)
- Credentials: Google Sheets OAuth2 API
Functionality: Automatically appends the Agent’s classification results to a log sheet in Google Sheets, providing auditable historical records for future data analysis and model optimization.
11. Slack Alert (Error Notification)
Node Type: n8n-nodes-base.slack
Configuration:
- Channel: #alerts
- Message Template: "Ticket Urgency Classification error: {$json.error.message}"
- Position: (930, 120)
- Credentials: Slack API
Functionality: Handles workflow errors. When the RAG Agent encounters an exception, it automatically sends detailed error messages to the Slack #alerts channel, ensuring timely team response and issue resolution.
12. Sticky Note (Annotation)
Node Type: n8n-nodes-base.stickyNote
Configuration:
- Content: "Placeholder for Ticket Urgency Classification"
- Height: 530px
- Width: 1100px
- Color: 5
- Position: (-480, -240)
Functionality: A visual annotation providing documentation for the workflow.
Data Flow Analysis
Main Flow
- Ticket Reception → Webhook Trigger receives external ticket data
- Text Processing → Text Splitter chunks → Embeddings vectorizes
- Knowledge Storage → Pinecone Insert saves vectors to database
- Similarity Retrieval → Pinecone Query fetches relevant historical cases
- Intelligent Analysis → RAG Agent performs comprehensive analysis and classification
- Result Logging → Append Sheet writes results to Google Sheets
Auxiliary Flows
- Context Memory: Webhook → Window Memory → RAG Agent
- Tool Invocation: Pinecone Query → Vector Tool → RAG Agent
- Model Support: Chat Model → RAG Agent
- Exception Handling: RAG Agent (onError) → Slack Alert
Technology Stack
- Workflow Engine: n8n
- Vector Database: Pinecone
- Embedding Model: Cohere embed-english-v3.0
- Language Model: Anthropic Claude
- Data Storage: Google Sheets
- Notification System: Slack
- Architecture Pattern: RAG (Retrieval-Augmented Generation)
Key Advantages
- Intelligent Automation: Uses AI to automatically determine ticket urgency, minimizing manual intervention
- Context-Aware: Enhances classification accuracy by retrieving semantically similar historical cases
- Scalable: Knowledge base grows automatically as more tickets are processed, continuously improving model performance
- Traceable: All classification results are logged in Google Sheets for auditing and analysis
- Highly Reliable: Automatic error alerts ensure stable system operation
Use Cases
- Automated customer service ticket routing
- Priority sorting for IT operations incident tickets
- Urgency assessment of customer feedback
- Intelligent routing of support requests
- Any scenario requiring automated text classification