Scanned invoices to Sheets via OCR

Drive scans read by OCR and OpenAI, saved to Sheets. This n8n template uses a Google Drive trigger that checks every minute for newly created files and determines whether each is a PDF or an image. It attempts direct text extraction first and uses the OCR.Space API for optical character recognition. An OpenAI model identifies the company name, total amount, currency, invoice date and invoice number. Rows are added to Google Sheets with links back to the original scanned documents, and Mailgun sends formatted email notifications that include an HTML table summary. It needs Google Drive, Google Sheets, OpenAI, OCR.Space and Mailgun credentials.

n8nRead on 2026-11-166 steps

Steps

  1. Trigger: File monitoringGoogle Drive
  2. File processing
  3. Text extractionOCR.Space
  4. AI information extractionOpenAI
  5. Output: Data storageGoogle Sheets
  6. Output: NotificationMailgun

Limits

  • Needs OCR.Space and Mailgun accounts.

What it does well

  • Attempts direct text extraction first, then OCR.Space.

Before you import

You need: Google Drive OAuth2, Google Sheets OAuth2, OpenAI, OCR.Space and Mailgun APIs.

Similar templates