The Problem
In bail bonds, the first bondsman to reach a defendant's family usually wins the business. Friends & Family Bail Bonds was competing against larger agencies across 14 Pennsylvania counties with more staff dedicated to monitoring court dockets. Their team had to manually cycle through county court websites, checking for new preliminary arraignments throughout the day. Hundreds of cases post daily, but only a fraction meet their criteria. Overnight and weekend cases were missed entirely, handing leads to competitors who checked first thing in the morning. Every case required opening a PDF docket sheet to read bail amounts, charge types, and bail conditions. A tedious process that couldn't scale.
How We Solved It
We built a real-time court monitoring pipeline using Prefect for workflow orchestration, deployed on AWS ECS Fargate for continuous 24/7 operation. Fourteen independent flows, one per judicial district, run on 2-minute cycles. Each flow scrapes the county court search system, parses the HTML results table, then downloads and extracts data from PDF docket sheets using PyPDF2 to pull bail type, bail amount, charges, and posting dates. SmartProxy residential IP rotation prevents rate limiting across high-frequency requests. An intelligent filtering layer eliminates unqualified cases: unsecured bail is excluded, minimum bail thresholds are enforced per county, and specific charge types outside the business model are filtered out. Qualifying leads are color-coded by value and posted as rich Discord embeds to per-county notification channels with defendant name, docket number, bail amount, charges, and direct links to court records. A circuit breaker pattern detects court website outages and pauses scraping during maintenance windows. File-based deduplication on AWS EFS prevents duplicate notifications across consecutive cycles. Per-county error tracking with automatic recovery alerts keeps the operations team informed without alert fatigue.
What We Delivered
- 14 judicial districts monitored simultaneously, 24/7
- New arraignments detected and delivered within 2 minutes
- Qualified leads filtered and prioritized automatically
