Support Ticket Classification System
Use LangGraph with Azure OpenAI to automatically classify support tickets into predefined categories with confidence scores. UiPath Action Center integration for human approval step.
Debug
- Clone the repository:
git clone cd samples\ticket-classification
- Install dependencies:
pip install uv uv venv -p 3.11 .venv .venv\Scripts\activate uv sync
- Create a
.envfile in the project root with the following configuration:
UIPATH_URL=https://alpha.uipath.com/ada/byoa UIPATH_ACCESS_TOKEN=xxx AZURE_OPENAI_API_KEY=xxx AZURE_OPENAI_ENDPOINT=xxx
uipath run <entrypoint> <input> [--resume]
Run
To classify a ticket, run the script using UiPath CLI:
uipath run agent '{"message": "GET Assets API does not enforce proper permissions Assets.View", "ticket_id": "TICKET-2345"}'Resume
To resume the graph with approval:
uipath run agent true --resumeInput Format
The input ticket should be in the following format:
{
"message": "The ticket message or description",
"ticket_id": "Unique ticket identifier",
"assignee"[optional]: "username or email of the person assigned to handle escalations"
}Output Format
The script outputs JSON with the classification results:
{
"label": "security",
"confidence": 0.9
}Deployment Guide
This guide walks you through deploying and running the ticket classification agent on the UiPath Cloud Platform.
Prerequisites
- Access to UiPath Cloud Platform
- Python 3.11 or higher
- Git
1. Repository Setup
# Clone the repository git clone https://github.com/UiPath/uipath-langchain-python.git cd uipath-langchain-python/samples/ticket-classification
2. Action App Deployment
The Ticket Classification Agent utilizes HITL (Human In The Loop) technology, allowing the system to incorporate feedback directly from supervisory personnel. We'll leverage UiPath Action Center for this functionality.
Follow these steps to deploy the pre-built application using UiPath Solutions Management:
-
Upload Solution Package
- Navigate to UiPath Solutions Management
- Drag and drop generic-escalation-app-solution-1.0.0.zip to the upload area
- Click the Upload button
-
Initiate Deployment
- Wait for the package to be processed and ready for deployment
-
Select Destination
- Choose a destination folder or install as root folder under tenant
-
Complete Configuration
- Follow the solution configuration wizard prompts
-
Activate the Apps
- After deployment, activate the apps following the UiPath documentation
-
Verify and Configure
- Navigate to the solution folder to verify the escalation app creation
- Copy the folder path for configuration
- Update the
FOLDER_PATH_PLACEHOLDERstring inmain.py(line 148) with the copied folder path
3. Agent Setup and Publishing
- Set Up Python Environment
# Install UV package manager pip install uv # Create and activate virtual environment uv venv -p 3.11 .venv # Windows .venv\Scripts\activate # Unix-like Systems source .venv/bin/activate # Install dependencies uv sync
- UiPath Authentication
Note: After successful authentication in the browser, select the tenant for publishing the agent package.
๐ Select tenant:
0: DefaultTenant
1: Tenant2
2: Tenant3
...
Select tenant: 2
- Package and Publish
# Create and publish the package
uipath pack
uipath publishSelect the feed to publish your package:
๐ Select package feed:
0: Orchestrator Tenant Processes Feed
1: Orchestrator Folder1 Feed
2: Orchestrator Folder2 Feed
3: Orchestrator Personal Workspace Feed
...
Select feed number: 3
Note: When publishing to personal workspace feed, the process will be auto-created for you.
4. Running and Monitoring the Agent
-
Start the Agent
- Navigate to your agent in the UiPath workspace
- Click "Run" to start a new job
-
Monitor Progress
- Track the agent's progress using the details side panel
-
Handle Human-in-the-Loop Tasks
- When a ticket is classified, a Resume Condition tab will appear
- Use this link to navigate to UiPath Action Center for human intervention
For detailed information about UiPath Action Center and its features, refer to the official documentation.











