Automated airline ticket refund processing with AI-powered decision making using OpenAI GPT-4o-mini and Camunda Platform.
This project demonstrates a production-ready BPMN process for handling airline ticket refund requests with intelligent automation. Built as a portfolio project showcasing Business Analyst skills, BPMN expertise, and LLM integration capabilities.
Business Context: Travel technology solution for airline companies to automate refund processing, reduce manual workload, and improve customer experience through intelligent decision-making.
- Process Engine: Camunda Platform 7.24.0
- LLM Integration: OpenAI GPT-4o-mini via External Task Worker
- Worker Runtime: Python 3.11 in Docker container
- Deployment: Production-ready setup with error handling and monitoring
- โ Service Tasks (automated processing)
- โ User Tasks (manual review with forms)
- โ Exclusive Gateways (business logic routing)
- โ Error Boundary Events (retry mechanism with 3 attempts)
- โ Timer Boundary Events (SLA monitoring with auto-escalation)
- โ External Tasks (LLM integration point)
- โ Process Variables (state management)
- โ Multiple End Events (different process outcomes)
- Full Refund - Fully automated approval path
- Refund with Penalty - Automatic fee calculation
- Manual Review - Approved - Human decision required (complex cases)
- Manual Review - Rejected - Human rejection with reasoning
- SLA Breach - Automatic escalation after 2-hour timeout
- Error Handling - Payment API failure with retry loop
Challenge: Camunda Community Edition lacks a built-in UI for viewing historical process instances.
Solution: Developed a separate React-based history viewer tool.
โ Camunda History Viewer Repository
Features:
- ๐ Visual timeline of completed process instances
- ๐ Activity-by-activity execution history
- ๐ Process variables inspection
- ๐จ Clean, intuitive React UI
- ๐ Direct REST API integration with Camunda
This companion project demonstrates:
- Problem-solving approach to platform limitations
- Full-stack development skills (React + REST API)
- Understanding of Camunda architecture and API
Used extensively during testing to analyze all 6 test scenarios documented below.
The External Task Worker uses GPT-4o-mini to analyze:
- Ticket class (Economy, Business, First)
- Purchase date vs Flight date
- Days until departure
- Airline refund policies
LLM Decision Categories:
ALLOWED- Full refund with no penaltyWITH_PENALTY- Refund possible but with cancellation feeMANUAL- Requires human review (edge cases)
Performance:
- Response time: ~1-2 seconds per request
- Cost: ~$0.0001 per analysis
- Fallback: Manual review on API errors
- Docker installed
- Camunda Platform 7.x running
- OpenAI API key (get one here)
- Optional: Camunda History Viewer for viewing completed processes
- Clone repository:
git clone https://github.com/DigitLock/camunda-llm-ticket-refund.git
cd camunda-llm-ticket-refund- Configure OpenAI API key:
cd workers/llm-worker
cp .env.example .env
nano .env # Add your API key: OPENAI_API_KEY=sk-proj-...- Start LLM Worker:
cd ../../scripts
./start-worker.sh- Deploy BPMN process to Camunda:
./deploy.sh- Trigger process via Camunda Cockpit or REST API
If scripts don't work, deploy manually:
- Start worker:
cd workers/llm-worker
docker build -t llm-worker:latest .
docker run -d --name llm-worker --network host --env-file .env llm-worker:latest- Deploy BPMN via Camunda Modeler:
- Open
bpmn/ticket-refund-process.bpmn - Deploy to your Camunda instance
- Open
All 6 scenarios tested and verified on Camunda Platform 7.24.0:
| # | Scenario | Elements Used | Duration | Status |
|---|---|---|---|---|
| 1 | Full Refund (Happy Path) | Service Tasks, Gateway | 29ms | โ PASS |
| 2 | Refund with Penalty | Service Tasks, Gateway | 12ms | โ PASS |
| 3 | Manual Review - Approved | User Task, Form, Gateway | 58.4s | โ PASS |
| 4 | Manual Review - Rejected | User Task, Form, Gateway | 6.2s | โ PASS |
| 5 | SLA Breach Timer | Timer Boundary Event (30s) | 130.5s | โ PASS |
| 6 | Error Handling Retry | Error Boundary Event, Loop | 19ms | โ PASS |
Total API Calls During Testing: 15 requests
Total Cost: ~$0.002 USD
Success Rate: 100%
camunda-llm-ticket-refund/
โโโ README.md # This file
โโโ .gitignore # Git exclusions
โโโ bpmn/
โ โโโ ticket-refund-process.bpmn # BPMN 2.0 process definition
โโโ workers/
โ โโโ llm-worker/
โ โโโ llm_worker.py # External Task Worker
โ โโโ requirements.txt # Python dependencies
โ โโโ Dockerfile # Container definition
โ โโโ .env.example # Environment template
โโโ docs/
โ โโโ diagram.png # Process diagram screenshot
โโโ scripts/
โโโ deploy.sh # Deploy process to Camunda
โโโ start-worker.sh # Start worker container
| Component | Technology | Version |
|---|---|---|
| Process Engine | Camunda Platform Community Edition | 7.24.0 |
| Modeling | BPMN 2.0 | - |
| LLM Provider | OpenAI | GPT-4o-mini |
| Worker Language | Python | 3.11 |
| Worker Framework | camunda-external-task-client-python3 | 4.3.0 |
| Containerization | Docker | Latest |
| API Client | openai-python | 1.54.4 |
This project demonstrates:
- Business Analysis: Process decomposition, edge case identification
- BPMN Expertise: Advanced patterns (boundary events, external tasks)
- Integration Skills: REST API, External Task pattern
- AI/LLM Integration: Practical application of LLMs in business processes
- DevOps: Dockerization, production deployment patterns
- Problem Solving: Developed companion tool to overcome platform limitations
Potential improvements for production use:
- Add authentication/authorization
- Implement caching for repeated fare rule queries
- Add metrics and monitoring (Prometheus/Grafana)
- Support multiple LLM providers (Claude, Gemini)
- Add unit tests for worker logic
- Implement circuit breaker pattern for API calls
MIT License - feel free to use for learning and portfolio purposes.
Igor Kudinov
Senior Business Systems Analyst
- 15+ years experience in banking, fintech, and cryptocurrency industries
- Expertise: System migrations, API documentation, BPMN, compliance (AML, Travel Rule)
- Portfolio project demonstrating BPMN modeling and LLM integration
This is a portfolio/demonstration project. Feedback and suggestions are welcome via issues.
Note: This is a demonstration project showcasing technical skills. For production deployment, additional security hardening, monitoring, and testing should be implemented.