HVAC Service Dispatch Agent Fleet
Automated job scheduling, technician routing, and parts inventory management for field service companies.
AI Readiness Score
Job history exists but unstructured
Field techs are non-technical
Budget limits to 1-2 agents
Dispatch is highly automatable
Achievable for focused scope
ServiceTitan API is limited
How This System Works
Architecture
The CoolBreeze HVAC system consists of two complementary agents that automate daily operations and customer communications. The Smart Dispatcher serves as the core optimization engine, running daily at 5am to analyze ServiceTitan job data and generate optimal technician routes using Google Maps API. This ensures maximum efficiency before the workday begins. The Customer Updater operates reactively, monitoring ServiceTitan for job status changes and dispatching real-time SMS notifications to keep customers informed throughout the service process. Both agents share a common integration layer with ServiceTitan as the central data source, while each maintains specialized connections to their respective services (Google Maps for routing, Twilio for SMS). The architecture emphasizes reliability and real-time responsiveness, with the batch optimization happening during off-hours and reactive updates flowing immediately as job statuses change.
Data Flow
Data originates in ServiceTitan, which serves as the master system for all job, customer, and technician information. Each morning, the Smart Dispatcher pulls pending jobs with location data, customer priority levels, and technician schedules. This data is enriched with real-time traffic and distance calculations from Google Maps API to generate optimized route sequences. The resulting dispatch assignments are written back to ServiceTitan, updating technician schedules and job assignments. Simultaneously, the Customer Updater maintains a continuous listener on ServiceTitan's webhook events or polls for status changes. When jobs transition states (dispatched, en route, arrived, completed), customer contact information and job details flow to Twilio's SMS API. Formatted status messages are delivered directly to customers' mobile phones, creating a seamless communication loop that reduces call volume and improves customer satisfaction.
Implementation Phases
Establish reliable connection to ServiceTitan API, implement authentication, and build data extraction for jobs, customers, and technicians
Integrate Google Maps API, develop routing algorithms, and implement daily dispatch optimization with ServiceTitan updates
Deploy reactive SMS notifications with Twilio integration and ServiceTitan status monitoring
End-to-end testing, error handling refinement, and production deployment with monitoring
Prerequisites
- -ServiceTitan API access with admin privileges
- -Google Maps API key with routing and distance matrix access
- -Twilio account with SMS messaging enabled
- -Linux server with cron scheduling capabilities
- -Python 3.8+ runtime environment
- -SSL certificates for secure API communications
Assumptions
- -ServiceTitan contains accurate customer phone numbers
- -Technicians start from a central dispatch location each morning
- -Job locations have valid addresses for Google Maps geocoding
- -Customer contact preferences allow SMS communications
- -ServiceTitan API rate limits accommodate daily batch processing
- -Network connectivity supports real-time webhook processing
Recommended Agents (2)
How It Works
- 1Extract Daily Jobs
Query ServiceTitan API for all pending jobs scheduled for current day, including job locations, priority levels, estimated duration, and required technician skills
ServiceTitan REST API - 2Retrieve Technician Data
Fetch available technicians with their skill sets, work hours, and current location/assignments from ServiceTitan scheduling module
ServiceTitan REST API - 3Calculate Route Matrix
Send all job locations to Google Maps Distance Matrix API to get travel times and distances between all location pairs, accounting for current traffic conditions
Google Maps Distance Matrix API - 4Optimize Assignments
Run optimization algorithm considering job priority, technician skills, travel time, and working hours to generate optimal daily routes for each technician
Python optimization library - 5Update Schedules
Push optimized job assignments and route sequences back to ServiceTitan, updating technician schedules and job dispatch times
ServiceTitan REST API
Implementation
```bash
# Create project structure
mkdir coolbreeze-dispatcher
cd coolbreeze-dispatcher
mkdir src config logs data
# Install dependencies
pip install requests googlemaps python-dotenv schedule pandas numpy
# Environment variables (.env)
SERVICETITAN_API_KEY=your_api_key
SERVICETITAN_BASE_URL=https://api.servicetitan.com
GOOGLE_MAPS_API_KEY=your_maps_key
LOG_LEVEL=INFO
DISPATCH_START_LOCATION=company_address
# Main dispatcher (src/smart_dispatcher.py)
import os, requests, googlemaps, json
from datetime import datetime, timedelta
from dataclasses import dataclass
from typing import List, Dict
@dataclass
class Job:
id: str
location: str
priority: int
duration_hours: float
required_skills: List[str]
class SmartDispatcher:
def __init__(self):
self.st_client = ServiceTitanClient()
self.gmaps = googlemaps.Client(key=os.getenv('GOOGLE_MAPS_API_KEY'))
def run_daily_optimization(self):
jobs = self.st_client.get_todays_jobs()
technicians = self.st_client.get_available_techs()
# Build distance matrix
locations = [job.location for job in jobs]
matrix = self.gmaps.distance_matrix(locations, locations, mode='driving')
# Run optimization
assignments = self.optimize_routes(jobs, technicians, matrix)
# Update ServiceTitan
for tech_id, job_list in assignments.items():
self.st_client.update_technician_schedule(tech_id, job_list)
class ServiceTitanClient:
def __init__(self):
self.base_url = os.getenv('SERVICETITAN_BASE_URL')
self.headers = {'Authorization': f'Bearer {os.getenv("SERVICETITAN_API_KEY")}'}
def get_todays_jobs(self):
today = datetime.now().strftime('%Y-%m-%d')
response = requests.get(f'{self.base_url}/jobs?scheduledDate={today}', headers=self.headers)
return [Job(**job) for job in response.json()['data']]
# Setup cron job
# crontab -e
# 0 5 * * * cd /path/to/coolbreeze-dispatcher && python src/smart_dispatcher.py >> logs/dispatcher.log 2>&1
if __name__ == '__main__':
dispatcher = SmartDispatcher()
dispatcher.run_daily_optimization()
```Data Flow
Inputs
- ServiceTitan Jobs API — Daily scheduled jobs with locations, priorities, duration estimates, and skill requirements(JSON array with job objects)
- ServiceTitan Technicians API — Available technician schedules, skill sets, and starting locations(JSON array with technician objects)
- Google Maps Distance Matrix API — Travel times and distances between all job locations(JSON matrix with duration and distance values)
Outputs
- ServiceTitan Scheduling API — Updated technician schedules with optimized job assignments and route sequences(JSON objects with schedule updates)
- System logs — Optimization results, performance metrics, and error details(Structured log files)
Prerequisites
- -ServiceTitan API credentials with scheduling write access
- -Google Maps API key with Distance Matrix API enabled
- -Server with reliable 5am cron execution
- -Python environment with optimization libraries
Error Handling
Retry with exponential backoff, send alert email to operations team, use cached data if available
Implement request batching, cache distance calculations, fallback to previous day's matrix
Log invalid addresses, notify dispatch team, assign jobs manually without optimization
Fallback to simple geographic clustering, alert technical team, maintain existing schedules
Integrations
| Source | Target | Data Flow | Method | Complexity |
|---|---|---|---|---|
| ServiceTitan | Google Maps | Job locations for routing | api | moderate |
Schedule
0 5 * * *Recommended Models
| Task | Recommended | Alternatives | Est. Cost | Why |
|---|---|---|---|---|
| Agent logic / orchestration | Claude Sonnet 4 | GPT-4oGemini 2.5 Pro | $0.003-0.015/call | Excellent for complex routing optimization logic and multi-system orchestration required by the Smart Dispatcher |
| Data extraction / parsing | Claude Haiku | GPT-4o-miniGemini 2.0 Flash | $0.0002-0.001/call | Fast and cost-effective for extracting job data, locations, and priorities from ServiceTitan API responses |
| Content generation | Gemini 2.0 Flash | Claude HaikuGPT-4o-mini | $0.0001-0.001/call | Optimal for generating high-volume customer SMS updates with consistent messaging at low cost |
| Classification / routing | Claude Haiku | Gemini 2.0 FlashGPT-4o-mini | $0.0002-0.001/call | Perfect for quickly classifying job priorities and determining which agent should handle incoming requests |
ROI Projection
Similar Blueprints
Preventive Maintenance Scheduling
Automated HVAC preventive maintenance system that intelligently schedules 2000+ service contracts, optimizes technician routes, and proactively communicates with customers. The system analyzes equipment performance data to predict maintenance needs and prevents costly emergency repairs. Real-time capacity management ensures optimal resource allocation while automated customer communications improve satisfaction and reduce no-shows.
HVAC Dispatch & Technician Routing
An intelligent HVAC dispatch and routing system that automates job assignments, optimizes technician routes, and maintains real-time customer communication. The system integrates with ServiceTitan and QuickBooks to create a seamless workflow from service request to job completion. Advanced routing algorithms minimize travel time while AI-powered agents handle dispatch decisions, inventory tracking, and performance analysis. The result is increased daily service capacity, improved customer satisfaction, and reduced operational overhead.
What's next?
This blueprint is a starting point. Fork it, remix it, or build your own.