Templates / Extract invoice data from Gmail to Airtable with Mistral OCR and GPT-4.1-mini

Extract invoice data from Gmail to Airtable with Mistral OCR and GPT-4.1-mini

Ready for 3.0

by Safa Khan ✓ · 268 views · created 2026-02-17 · Invoice Processing, 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-10-19.

What this workflow does

This AI workflow has 16 nodes and runs on Gmail events. Along the way it connects OpenAI Chat Model, Gmail and Airtable. It also calls api.imgbb.com over HTTP.

How it runs

Trigger: On Gmail events.

  1. If: checks a condition and branches into true / false
  2. host image (HTTP Request): calls api.imgbb.com (POST)
  3. Search Existing Invoices (Airtable): search
  4. Check for Duplicates (Switch): routes items into branches
  5. Download Invoice (HTTP Request): calls an HTTP API
  6. Extract text (Mistral AI): uses Mistral AI
  7. Analyze Invoices (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
  8. Validate Data (If): checks a condition and branches into true / false
  9. upload invoice & details (Airtable): create
  10. Invalid Data Handler (Edit Fields (Set)): sets 5 fields: error, step, invoiceSubject…

…plus 1 more step. See the full node list below.

Services it uses

OpenAI Chat ModelGmailAirtable

HTTP calls to: api.imgbb.com

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.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).

Nodes used (12)

From the author

This n8n template demonstrates how to automatically process invoice attachments from email using OCR and AI. When an invoice is received in Gmail, the workflow extracts structured invoice data and stores it in Airtable while preventing duplicates. This…

Excerpt from Safa Khan'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.