⚖️ LEDES Invoice Converter
AI-Powered Legal Billing Automation
This workflow monitors an email inbox for timesheet attachments (PDF or Word), extracts time entries using AI, and automatically generates three billing formats plus a branded PDF invoice — all returned to the sender by email.
How it works
- Email trigger watches for new unread emails with attachments
- Classify Attachment detects PDF vs. Word (.docx/.doc)
- AI Agent (GPT-4o) extracts all time entries and assigns UTBMS task codes
- Second AI Agent extracts remit-to billing information from the email body/signature
- Invoice Number lookup queries your Excel tracker and increments automatically
- Four outputs generated in parallel: LEDES 1998B (.txt), LEDES XML 2.0 (.xml), branded PDF invoice, and Excel time record rows
- Confirmation email sent back to the original sender with all three billing files attached
- Excel records updated with time entries and new invoice number
Setup
- Configure your IMAP credential on the Email Trigger node
- Configure your OpenAI credential on both Chat Model nodes
- Configure your Gmail OAuth2 credential on the Send Invoice Email node
- Configure your Microsoft Excel OAuth2 credential on the three Excel nodes
- Point the Excel nodes at your own
timesheets.xlsx workbook, worksheet, and table names
- Configure Gotenberg HTTP Basic Auth credential on the Convert HTML to PDF node
- Update the logo URL in Generate Invoice HTML if using your own branding
Customization
- Adjust the
LGT- invoice number prefix in Get Next Invoice Number
- Modify UTBMS task code defaults in the AI Agent system prompt
- Update branding colors and logo in Generate Invoice HTML
⚠️ Community Node Required
n8n-nodes-word2text must be installed on a self-hosted n8n instance.
This workflow will not run on n8n Cloud unless you replace the Word2Text node with an alternative.