CUSTOMER ACQUISITION + AUTOMATION PLATFORM
I built both the system that finds the customers and the system that sells and delivers to them.
A production customer-acquisition and business-automation system, built for a LegalTech firm (NDA). Daily public court data becomes qualified leads. A customer's purchase becomes a finished, fingerprinted document. 42 production workflows run it all on one self-hosted n8n backbone.
ARCHITECTURE SHOWN WITH SENSITIVE DETAILS REMOVED
THE SHIFT
From manual handoffs to one automated backbone.
BEFORE
AFTER — ONE BACKBONE
THE ACQUISITION ENGINE
Public data in. Qualified leads out.
Every day, public court-record exports become a prioritized, deduplicated lead queue — parsed, classified, enriched, and synced to the CRM with no manual triage. Watch the data flow through.
Daily public court-record exports — zipped, caret-delimited flat files with separate lookup tables.
n8n watches for each day's export drop and hands the file to the processing backend.
A custom Node.js / TypeScript backend parses the caret-delimited feed into structured records.
Filters to active matters filed within 180 days and detects trigger events in the docket.
Each eligible record is classified into one of four lead profiles with priority tiers.
Lookup tables convert raw codes — party types, case types, judges — into human-readable labels.
Batch upsert logic keeps the queue free of duplicates, no matter how often the feed re-delivers.
Structured leads land in the database behind a CRUD API, synced onward to the CRM.
The team starts from a prioritized, deduplicated lead queue — no manual triage.
ENGINEERING DECISIONS
Data engineering, not a visual automation.
The pipeline looks simple from the outside. These are the decisions that make it hold up in production.
01
CUSTOM EXPORT PARSING
PROBLEM
The source data isn't an API — it arrives as zipped, caret-delimited flat files.
CONSTRAINT
Party types, case types, and judges live in separate lookup tables, not in the records themselves.
DECISION
A dedicated Node.js/TypeScript parser with lookup-table joins, instead of forcing a generic import tool onto a legal export format.
RESULT
Every record lands structured, labeled, and queryable.
02
RULES-BASED CLASSIFICATION
PROBLEM
Most records in the daily feed are not viable leads.
CONSTRAINT
Eligibility depends on case status and docket events — service returned, motion to withdraw — not keywords.
DECISION
Business rules filter to active matters, detect trigger events, and classify each eligible record into one of four lead profiles with priority tiers.
RESULT
The queue ranks itself — the team starts from the highest-priority profile, not from raw records.
03
DEDUPLICATION BY BATCH UPSERT
PROBLEM
The same party can appear in the feed day after day.
CONSTRAINT
Re-importing daily files must never create duplicate leads downstream.
DECISION
Batch upsert keyed on record identity instead of blind inserts.
RESULT
A deduplicated queue, no matter how often the feed re-delivers the same records.
04
AI-ASSISTED STRUCTURED EXTRACTION
PROBLEM
Parts of the source data are unstructured text.
CONSTRAINT
Downstream workflows need structured, validated fields — not free-form model output.
DECISION
AI extraction constrained to structured outputs, applied only where deterministic parsing can't do the job.
RESULT
Messy source text becomes fields the rest of the pipeline can trust.
05
COST-AWARE API USAGE
PROBLEM
External APIs meter both rate and cost.
CONSTRAINT
Large daily batches can't treat third-party APIs as unlimited resources.
DECISION
Chunked requests, rate-limited processing, and API calls only at the stages where they earn their cost.
RESULT
Full daily feeds processed without burning quota or budget.
06
PRODUCTION n8n ORCHESTRATION
PROBLEM
A pipeline that runs unattended has to fail loudly, not silently.
CONSTRAINT
Stages span n8n, a custom backend, storage, and third-party APIs.
DECISION
n8n orchestrates every stage with explicit gates, retries, and status polling on long-running jobs; processed files are archived as the completion signal.
RESULT
Failures surface immediately, and a glance at the archive shows exactly what has run.
ACQUISITION → DELIVERY
The automation continues after acquisition.
Finding the customer is half the system. When a lead becomes a customer and buys, the same platform takes over: intake, document generation, and delivery — untouched by hand.
THE DELIVERY ENGINE
A purchase becomes a finished, fingerprinted PDF without manual document processing.
A completed intake questionnaire triggers the Document Factory: template merged, converted to PDF, stamped with per-buyer fingerprint metadata, stored, and delivered by email. Hover the subsystems — then open the Document Factory to watch a document run through.
42 PRODUCTION WORKFLOWS · ONE BACKBONE
SURVEYJS · SUPABASE · N8N · DOCXTEMPLATER · GOTENBERG · PDF-LIB · BREVO
- SELF-HOSTED n8n
- HOSTINGER VPS
- TRAEFIK
- CREDENTIAL MANAGEMENT
- IP WHITELISTING
- MONITORING / LOGGING
AT REVIEW TIME:49 TRACKED EXECUTIONS0 FAILURES~1.0S AVG RUNTIME
ENGINEERING PATTERNS
Not just automation. Engineering.
Idempotency
Search-then-insert and reuse-or-create patterns prevent duplicate records, events, folders, and resources.
Retries
Retry-on-fail with backoff for API failures and rate limits.
Error Handling
IF-gated branches and dedicated error responses keep failures explicit and manageable.
Pagination / Chunking
Large API datasets are ingested in bounded pages, so no single run can blow up.
AI Extraction
Gemini turns raw documents into structured, validated records before they touch the database.
THE PLATFORM
42 workflows. One automation platform.
42
PRODUCTION WORKFLOWS
DOCUMENTS
Intake data becomes finished, branded, fingerprinted PDFs — untouched by hand.
- Document Factory (intake → PDF)
- Template data merge
- Footer & branding microservice
- Metadata fingerprinting
+ ADDITIONAL PRODUCTION WORKFLOWS
INTEGRATIONS
Everything the platform talks to.
Twenty services and tools, orchestrated by one n8n backbone. Hover a system to trace its connection.
n8n
+ GMAIL · DOCXTEMPLATER · COURTLISTENER · MIAMI-DADE CLERK API · REST APIS · JAVASCRIPT
Have a manual workflow you'd like to automate?
Tell me what your team does by hand today. I'll map the workflow and the integrations it needs.