30 Minutes to 5 Minutes — Mission-Critical AI System Rebuilt for Reliability
The Law Practice Exchange
The Law Practice Exchange runs the #1 marketplace for buying and selling law firms in the US. Its AI-powered valuation system was timing out at 30+ minutes and failing mid-process regularly. We rebuilt the entire system with the Responses API, parallel processing, background execution, and vector stores for better AI accuracy.
The Problem
The core product was slow and breaking regularly.
LPE's law firm valuation system was built on Google Apps Script and the OpenAI Assistants API. Both choices created cascading problems.
Google Apps Script has a hard 30-minute execution limit. The valuation workflow consistently ran 30+ minutes and frequently hit the timeout — leaving valuations incomplete. The workflow was also sequential: if any step failed, everything after it failed. There was no parallel processing, no retry logic, no graceful recovery.
The API layer was later modernized from the OpenAI Assistants API to the Responses API. For clarity, Responses launched on March 11, 2025; OpenAI deprecated Assistants on August 26, 2025 and scheduled shutdown for August 26, 2026. An earlier version of this case study incorrectly cited August 2024.
Users had to keep their browser tab open throughout the process. If the tab closed, the process failed. AI quality was also inconsistent — the model had insufficient context (no vector stores) and was making errors in deliverables sent to paying clients.
- Execution time 30+ minutes — frequently hitting Apps Script timeout
- Sequential workflow — one failure breaks all downstream steps
- User must keep browser tab open or process fails
- AI making errors in client deliverables due to insufficient context
- Legacy Assistants API integration later migrated to the Responses API
What We Built
Complete system rebuild: migration to n8n for background execution, OpenAI Responses API with vector stores, and parallel processing throughout.
Backend migration: Apps Script ? n8n
Moved the entire workflow out of Google Apps Script into n8n. n8n runs server-side with no execution time limit. Workflows run in the background — users trigger the valuation and can close their browser immediately. They receive a notification when it's complete.
API migration: Assistants API ? Responses API + Vector Stores
Migrated from the deprecating OpenAI Assistants API to the OpenAI Responses API. Added vector stores loaded with deep context: historical valuation data, market comparables, legal practice area benchmarks, and domain-specific best practices. The AI now has dramatically more relevant context to work with on each valuation.
Parallel processing architecture
Rewired the workflow for parallel execution. Steps that don't depend on each other now run simultaneously. Financial data collection, client data retrieval, and market data lookups all happen at the same time instead of sequentially. This alone cut execution time by more than half.
Webhook-based execution model
The user triggers the workflow via a minimal Apps Script UI button. A webhook fires to n8n. The entire process runs in the background. The user gets a notification — email or Slack — when the valuation is complete and ready to review.
Technical Breakdown
Ready to be next?
Tell me where your biggest bottleneck is.
30-minute audit call. I'll map out exactly what to automate, what it costs, and what you'll get back. No fluff.