Automated Case Document Pipeline for a Multi-Jurisdiction Law Firm

Pedro Muรฑoz
Published

0
  • Project creator

A law firm handling cases across national and international jurisdictions was drowning in manual admin. Someone had to read every incoming email, work out which case it belonged to, and file the attachments by hand before anyone could act on them. I built the system that does that automatically, end to end, with the level of care legal documents actually require.

How it works:

๐Ÿ“ง Inbound email is triggered and automatically classified by case, no manual sorting
๐Ÿ“Ž Attachments are matched to the correct case file automatically, even across parallel active cases
๐Ÿงพ Documents are extracted and summarized so the team gets the gist without opening every file
๐Ÿ” Highly sensitive material is processed under restricted boundaries: strict limits on what reaches third-party services, agreed with the firm before a single document moved

Built to actually hold up:

๐Ÿง  n8n orchestrates the entire pipeline, from the moment an email lands to the moment a summarized case file is ready
๐Ÿงฉ Custom logic beyond what n8nโ€™s built-in nodes cover (classification rules, case-matching) written in TypeScript
๐Ÿ—‚๏ธ Supabase (PostgreSQL) for structured case data
โ˜๏ธ Cloud Run functions, written in Python, handle extraction from encrypted files, format conversion, and information extraction
๐Ÿ” A FIFO queue guarantees per-client message ordering, so a burst of emails from one client doesnโ€™t get processed out of sequence
๐Ÿ“ˆ The same queue absorbs peak load without over-provisioning infrastructure the rest of the time

Orchestrated end to end in n8n. Built in close coordination with the firm to get the confidentiality boundaries right before the automation touched a real case.