Invoices, documents and PDFs

Gmail ZIP, PDF and XML invoice extraction to Google Sheets

Short answer

This n8n workflow captures supplier invoice emails from Gmail, unpacks ZIP archives and separates PDF and XML attachments automatically. An AI extraction agent and calculator tool parse line items, tax figures and totals into a strict schema. Source documents are archived in Google Drive while structured rows land in Google Sheets.

Catalogue ID
#1765
Functional nodes
22
Connections
24
Trigger
gmailTrigger
AI layer
AI-assisted
Business problem solved

Business problem solved

Finance teams spend hours opening mixed ZIP, PDF and XML attachments from suppliers and typing line items into spreadsheets by hand. One mistyped figure during month-end close stalls reconciliation across accounts.

Trigger

The Gmail trigger starts the workflow whenever a new email with invoice attachments arrives in the monitored label.

Connected systems

Connected systems

  • Gmail
  • Google Drive
  • Google Sheets
  • OpenAI
  • Calculator and schema parser
  • Self-hosted n8n

Every workflow is deployed on your own server with documentation, a run log and an error queue.

Workflow steps

Workflow steps

  1. 01

    Attachment fetch and ZIP unpacking

    Email attachments are downloaded, ZIP archives are unpacked and PDF or XML invoice files are filtered for processing.

  2. 02

    Text extraction and schema parsing

    The file extraction node reads document content while the structured parser maps vendor, dates, tax and line items cleanly.

  3. 03

    Arithmetic cross-check

    A calculator tool checks subtotals, tax amounts and invoice totals so extraction discrepancies surface before posting.

  4. 04

    Drive archive and sheet entry

    The original file is stored in Google Drive and structured invoice rows are appended to Google Sheets with the archive link.

Error queue and human approval

Error queue and human approval

Built-in state in the catalogue workflow

The verified catalogue workflow contains zero node-level error flags across its 22 functional nodes and 24 connections.

Production layer added by ALTAI

During live deployment, ALTAI adds an accounting review queue whenever totals disagree, duplicate invoice-number protection, unreadable attachment alerts and an audit log.

Frequently asked

Email PDF and XML invoice extraction workflow Frequently asked questions

Production deployments check vendor and invoice number pairs in the run log so repeated emails route to a warning queue instead of duplicating entries.

The calculation check flags the mismatch immediately and routes the invoice to an accounting approval queue rather than posting unverified numbers.

Yes. The structured JSON output can connect directly to Exact, Xero, Twinfield or your internal ERP during deployment.

File-type and content filters keep only supported invoice documents and skip unrelated files safely.

Mert Can Gundogdu
The founder takes the call, not a sales team
Next step

We write the proposal after we have found the problem together

In a thirty-minute call we listen to how you work and talk through where time and customers are slipping away. If you do not need a digital fix, we will tell you that too.

30 minutes · no preparation needed

The call and the week of discovery are both free.Read the terms

Chat on WhatsApp