Extract and validate invoice data from Gmail to Google Sheets with EmpirioLabs
UnknownWhat this workflow does
This workflow has 13 nodes and runs on Gmail events. Along the way it connects Gmail, Google Sheets and Empiriolabs (community).
How it runs
Trigger: On Gmail events.
- Invoice settings (Edit Fields (Set)): sets 6 fields: spreadsheet_url, sheet_name, reviewer_email…
- Split the attachments (Code): runs custom JavaScript code
- Read the document (Empiriolabs): read (document)
- Text found? (If): checks a condition and branches into true / false
- Check the invoice (Code): runs custom JavaScript code
- Extract the invoice fields (Empiriolabs): create (chat)
- Read the invoice log (Google Sheets): uses Google Sheets
- Compare with the log (Code): runs custom JavaScript code
- New or changed? (If): checks a condition and branches into true / false
- Log the invoice (Google Sheets): append or update
…plus 2 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102)
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-empiriolabs is verified or supports 3.0 (used in Read the document, Extract the invoice fields).
- Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (7)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Empiriolabs
n8n-nodes-empiriolabs.empiriolabs - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Gmail
n8n-nodes-base.gmail
From the author
Quick Overview This workflow watches Gmail for emails with invoice attachments, uses EmpirioLabs AI to OCR each PDF or image and extract key invoice fields, then logs validated results to Google Sheets and emails a reviewer when an invoice is missing required…