This template is built for solo attorneys, small law firms, and legal billing coordinators who receive timesheet documents by email and need to produce LEDES-compliant e-billing files for client billing management systems. If you have an IMAP inbox, an OpenAI API key, a self-hosted Gotenberg instance, and a Microsoft 365 account, you can have AI-processed LEDES invoices delivering automatically in under 30 minutes of setup.
The workflow monitors an inbox for emails with PDF or Word timesheet attachments, extracts all time entries using GPT-4o, assigns UTBMS task codes, auto-increments an invoice number, and returns a PDF invoice, LEDES 1998B file, and LEDES XML 2.0 file to the original sender — all without any manual data entry.
An IMAP — Watch Inbox trigger monitors for unread emails with attachments. Classify Attachment detects whether the file is a PDF or Word document and routes it to the correct extractor.
Extract — PDF Text or Extract — Word Text pulls the raw text content from the attachment and passes it to the AI pipeline.
AI Agent — Extract Time Entries uses GPT-4o to parse all time entries from the document, capture date, timekeeper, hours, rate, description, client, and matter fields, and assign the best-fit UTBMS ABA task code (A101–A111) for each line. If rate or timekeeper information is missing, configurable defaults are applied automatically.
AI Agent — Extract Sender Info runs a second GPT-4o-mini pass over the email body and signature to extract the sender's name, address, and contact details for the "Remit To" section of the invoice.
Excel — Read Invoice Numbers queries your timesheets.xlsx tracking workbook via Microsoft Graph API to find the last issued invoice number and increment it automatically.
Merge — Time Entries + Invoice Number combines the AI-extracted data with the new invoice number, then fans out to four parallel generation nodes.
Generate — LEDES 1998B, Generate — LEDES XML 2.0, Generate — Invoice HTML, and Prep Excel Rows run simultaneously to produce all outputs. All brand variables — logo URL, firm name, colors — are defined as named constants at the top of the Invoice HTML Code node for easy one-time customization.
Convert to PDF sends the finished HTML to your self-hosted Gotenberg instance, returning a print-ready US Letter PDF — no third-party PDF service required.
Send Invoice Email delivers all three billing files as attachments via Gmail OAuth2 back to the original sender. Excel — Append Time Entries and Excel — Append Invoice Number update your tracking workbook with the full LEDES row data and the new invoice record.
timesheets.xlsx workbook, worksheet, and table.'INV-' prefix to match your firm's invoice numbering convention.logoUrl and the brand color constants to match your firm identity.@page CSS rules and table-based layout for reliable PDF rendering.Visit automatedintelligentsolutions.com for more information, support, and workflows.