Templates / Generate LEDES invoices from email attachments with OpenAI, Gmail, and Sheets

Generate LEDES invoices from email attachments with OpenAI, Gmail, and Sheets

Unknown

by AI Solutions ✓ · 3 views · created 2026-08-18 · Invoice Processing, AI Summarization

Unknown. This template uses community nodes we can't verify statically. Uses community nodes that can't be verified statically (unverified community packages are off by default in 3.0). Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 27 nodes and runs when a new email arrives over IMAP. Along the way it connects Google Sheets, OpenAI Chat Model, Gmail and Word2text (community).

How it runs

Trigger: When a new email arrives over IMAP.

  1. Identify File Attachment Type (Code): runs custom JavaScript code
  2. If: checks a condition and branches into true / false
  3. If: checks a condition and branches into true / false
  4. Fetch Invoice Numbers from Sheets (Google Sheets): uses Google Sheets
  5. Extract PDF Text (Extract from File): extracts data from a file (pdf)
  6. Extract Word Document Text (Word2text): uses Word2text
  7. Compute Next Invoice Number (Code): runs custom JavaScript code
  8. Time Entry Extractor Agent (AI Agent): runs an AI agent, with model: OpenAI Time Entry Model
  9. Combine Entries with Invoice (Merge): merges the data from its input branches
  10. Parse Time Entries Data (Code): runs custom JavaScript code

…plus 14 more steps. See the full node list below.

Services it uses

Google SheetsOpenAI Chat ModelGmailWord2text (community)

Before you upgrade to n8n 3.0

We can't fully verify this one: it relies on 1 community package, and n8n 3.0 turns unverified community packages off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).

  • Check that n8n-nodes-word2text is verified or supports 3.0 (used in Extract Word Document Text).

Nodes used (11)

From the author

Quick overview This workflow watches an IMAP inbox for new emails with PDF or Word attachments, extracts legal time entries using OpenAI, generates LEDES 1998B, LEDES XML 2.0, and a PDF invoice (via a Gotenberg HTML-to-PDF endpoint), then logs results to…

Excerpt from AI Solutions's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.