Templates / Archive and index legal PDFs from Gmail with Gemini, Sheets and Google Drive

Archive and index legal PDFs from Gmail with Gemini, Sheets and Google Drive

Ready for 3.0

by Oka Hironobu ✓ · 8 views · created 2026-07-19 · Document Extraction, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 16 nodes and runs on Gmail events. Along the way it connects Gmail, Google Gemini Chat Model, Google Sheets and Google Drive and 1 more.

How it runs

Trigger: On Gmail events.

  1. Extract Document Text (Extract from File): extracts data from a file (pdf)
  2. Extract Filing Metadata with Gemini (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model; output parser: Filing Metadata Parser
  3. Build Compliant File Name (Code): runs custom JavaScript code
  4. Report Extraction Failure (Slack): uses Slack
  5. Check Required Metadata (If): checks a condition and branches into true / false
  6. Index for Legal Search (Google Sheets): append
  7. Report Incomplete Metadata (Slack): uses Slack
  8. Mark Email as Filed (Gmail): mark as read
  9. Route by Document Type (Switch): routes items into 3 branches
  10. Archive to Invoices Folder (Google Drive): uses Google Drive

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

Services it uses

GmailGoogle Gemini Chat ModelGoogle SheetsGoogle DriveSlack

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (12)

From the author

Quick Overview This workflow monitors Gmail for unread emails with PDF attachments, uses Google Gemini to extract Japan Electronic Books Preservation Act filing metadata, logs a searchable index in Google Sheets, and archives documents into Google Drive…

Excerpt from Oka Hironobu'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.