Invoices, documents and PDFs

Gmail invoice attachment archiving to Drive and Sheets reconciliation

Short answer

This AI-assisted n8n workflow monitors Gmail for invoice messages carrying file attachments. Qualifying PDFs upload to Google Drive, receive standard names and move into target archive folders. Extracted text passes through an OpenAI LLM chain and structured output parser before appending rows to your reconciliation Sheet.

Catalogue ID
#1764
Functional nodes
14
Connections
14
Trigger
gmailTrigger
AI layer
AI-assisted
Business problem solved

Business problem solved

Supplier invoices scattered across busy Gmail threads force finance teams to rename files by hand, file them into monthly folders and copy totals into reconciliation sheets one invoice at a time.

Trigger

The Gmail trigger inspects incoming emails immediately as they arrive in your billing inbox.

Connected systems

Connected systems

  • Gmail
  • Google Drive
  • OpenAI
  • Structured output parser
  • Google Sheets
  • Self-hosted n8n

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

Workflow architecture

Workflow architecture

  1. 1. Gmail Trigger1 (Trigger) (connects to Setup1)
  2. 2. Setup1 (Service and data) (connects to Only invoice mails with…)
  3. 3. Upload PDF to Drive1 (Service and data) (connects to Rename file1)
  4. 4. Rename file1 (Service and data) (connects to Move to the correct folder1)
  5. 5. Move to the correct folder1 (Service and data) (connects to Gmail, Google Drive)
  6. 6. Gmail (Service and data)
  7. 7. Extract from File2 (Service and data) (connects to Apply Data Extraction Rules)
  8. 8. Google Drive (Service and data) (connects to Extract from File2)
  9. 9. OpenAI Model (AI layer) (connects to Apply Data Extraction Rules)
  10. 10. Structured Output Parser (AI layer) (connects to Apply Data Extraction Rules)
  11. 11. Append to Reconciliation… (Service and data)
  12. 12. Map Output (Service and data) (connects to Append to Reconciliation…)
  13. 13. Apply Data Extraction Rules (AI layer) (connects to Map Output)
  14. 14. Only invoice mails with… (Logic and routing) (connects to Upload PDF to Drive1, Gmail)
  • Trigger
  • AI layer
  • Logic and routing
  • Service and data

Node positions and directed links are generated from the verified catalogue record.

Workflow steps

Workflow steps

  1. 01

    Invoice attachment filter

    Setup rules and a conditional check isolate invoice emails with attachments while routing non-invoice emails separately.

  2. 02

    Drive upload, rename and filing

    Attachments upload over HTTP to Drive, get renamed consistently and move into the target accounting folder.

  3. 03

    Text extraction and structured AI parsing

    Filed documents are read from Drive, extracted into text and parsed by OpenAI into strict invoice fields.

  4. 04

    Output mapping and reconciliation sheet

    Mapped invoice attributes append neatly into your Google Sheets reconciliation table for accounting review.

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 14 functional nodes and 14 connections.

Production layer added by ALTAI

During live deployment, ALTAI adds duplicate invoice-number blocking, unreadable-PDF warning queues, Gmail status labels and accounting audit logs.

Frequently asked

Gmail invoice attachments to Drive and Sheets Frequently asked questions

Yes. The conditional attachment filter checks message criteria before triggering Drive uploads.

Yes. The rename step uses custom naming expressions configured to match your finance folder structure.

The structured parser captures vendor, invoice number, issue date, tax and net total into mapped sheet columns.

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