FREE N8N TEMPLATE · FINANCE & ADMIN
This n8n workflow takes every attachment from new Gmail messages, reads PDF text, and asks an AI model whether it is an invoice, receipt, contract, identity document or something else. It renames the file in a consistent date, type, party and reference format, saves it to the matching Google Drive folder, and logs it in Google Sheets. Unsure results are marked CHECK and saved to a To sort folder.
- DIFFICULTY
- Beginner
- SET-UP TIME
- About 40 minutes
- NODES
- 9
- CHECKED AGAINST
- n8n 2.41
- Gmail
- OpenAI or Anthropic
- Google Drive
- Google Sheets
LAST REVIEWED OCTOBER 2026
001 / HOW IT WORKS
Step by step, node by node
01Watch Gmail for attachments
The Gmail trigger polls for new messages with attachments and downloads them. Narrow the search query to a label or address so personal email is not processed.
02Make one item per attachment
A Code node splits each email into one item per file and drops small inline images such as logos in email signatures. It keeps the sender, subject, date and a short snippet of the email body.
03Check whether the file is a PDF
An If node sends PDFs to text extraction. Images, Word files and spreadsheets skip extraction and are classified from their file name and the email details.
04Read the PDF text
The Extract from File node pulls the text from each PDF. If a PDF is encrypted or damaged, the node continues without text rather than stopping the run.
05Classify the document with AI
The Information Extractor node asks your chat model for the document type, the other party, the document date, any reference number, a short title and a confidence rating, using clear definitions for each type.
06Build the file name and folder
A Code node maps the type to a Drive folder ID and builds a name like 2026-09-14 - Invoice - Supplier Name - INV-1042.pdf. Low-confidence results get a CHECK prefix and go to the To sort folder.
07Save to Google Drive
The Google Drive node uploads the original file, unchanged, to the chosen folder with the new name. The original email and attachment stay in Gmail.
08Log the filing
Google Sheets records when the file was filed, who sent it, the subject, the original and new names, the type, the confidence and a link to the file in Drive.
THE REAL WORKFLOW YOU IMPORT · NODE NAMES AS THEY APPEAR IN N8N
002 / WHY IT EXISTS
Attachments pile up in inboxes. Invoices sit next to signed contracts, receipts and copies of a new starter's driver licence, all with file names like scan_0042.pdf. When the accountant asks for last quarter's receipts or someone needs a contract, it means searching email and downloading files one by one.
This template is for small offices, practices and bookkeepers who want documents to land in a tidy Drive structure without anyone dragging and dropping. The AI only decides the type and a sensible name; the folders, naming rules and access permissions stay under your control, and low-confidence calls are left for a person to sort.
WHO IT'S FOR
- →Small business owners who keep receipts and invoices in Google Drive
- →Office managers handling a shared admin or accounts inbox
- →Bookkeepers who collect client documents by email
- →Professional services firms that want contracts filed consistently
003 / WHAT YOU NEED
Tick them off as you go. Nothing is saved; it's just a checklist.
004 / SET IT UP
- 01
Import the workflow JSON into n8n and read the Setup Notes sticky note.
- 02
Connect Gmail and change the trigger's search query to the label or address you want to process, then set a polling interval.
- 03
Create the Drive folders and paste their IDs into the FOLDERS list at the top of the Build File Name and Folder node.
- 04
Restrict sharing on the ID documents folder to the people who need it, and keep it separate from folders shared with your accountant.
- 05
Connect Google Drive and Google Sheets, create a Filing log tab with the listed headers, and paste the sheet ID.
- 06
Add your OpenAI credential to the Chat Model node, or replace it with an Anthropic Chat Model connected to Classify Document.
- 07
Forward a handful of real attachments to the inbox, run the workflow manually and check the names, folders and log before activating.
005 / MAKE IT YOURS
- +Add more document types, such as payslips, BAS statements or insurance certificates, by extending the schema, the system prompt and the FOLDERS list.
- +Create year and month subfolders automatically with Google Drive search and create folder nodes before uploading.
- +Send invoices on to the invoice-to-Xero workflow after filing, so bills are entered and the PDF is already in Drive.
- +Apply a Gmail label such as Filed to each processed email so your team can see what has been handled.
- +Post a Slack or email alert when an ID document is filed, so someone can confirm it was expected.
FOR AUSTRALIAN BUSINESSES
Identity documents such as driver licences, passports and Medicare cards are personal information that needs careful handling under the Privacy Act 1988. APP 11 expects reasonable steps to protect it, so give the ID folder restricted sharing and delete copies you no longer need. The workflow only sends PDF text, file names and a short email snippet to the AI model; images, including photographed IDs, are classified from their name alone. Sending document text to an offshore AI API is a cross-border disclosure under APP 8, so review the provider's data terms or self-host n8n in an Australian region. For tax records, the ATO generally expects you to keep them for five years, and a tidy Drive structure makes that easier.
Need it hosted in Australia? →006 / TOOLS IN THIS WORKFLOW
n8n
AUTOMATION & AGENT PLATFORMS
A workflow automation platform that combines a visual node editor with code when you need it. It connects hundreds of apps and APIs and includes AI agent nodes that can call language models, tools and memory. Teams can self-host the free Community Edition on their own servers or use n8n's hosted cloud.
Best for australian organisations that need automation data to stay onshore
Onshore possibleFreemiumIntermediateChatGPT
OpenAI · ASSISTANTS & CHATBOTS
OpenAI's general-purpose AI assistant. It handles writing, coding, file and image analysis, data analysis and web research through a chat interface, with an API for building it into your own systems.
Best for small and mid-sized teams wanting one general assistant for everyday writing and analysis
AU optionFreemiumBeginnerClaude
Anthropic · ASSISTANTS & CHATBOTS
Anthropic's AI assistant, known for careful reasoning, long-document analysis, writing and coding. It can work through large documents and codebases in a single conversation, paid plans include the Claude Code agentic coding tool, and it is available through an API and major cloud platforms.
Best for legal, policy and consulting teams reviewing long documents
Onshore possibleFreemiumBeginnerZapier
AUTOMATION & AGENT PLATFORMS
A no-code automation platform that links a large catalogue of web apps through workflows called Zaps. Beyond triggers and actions it now offers AI agents, chatbots, Tables for storing data, Interfaces for simple forms and pages, and an MCP server that lets AI assistants run Zapier actions.
Best for small businesses automating admin without developers
OffshoreFreemiumBeginner
MORE TEMPLATES
All templates →- 14 NODESAI
FINANCE & ADMIN
Supplier Invoice Email to Xero Draft Bill with AI Extraction
GmailXeroOpenAI or AnthropicGoogle SheetsIntermediate~60 minutes→ - 15 NODES
FINANCE & ADMIN
Tiered Overdue Invoice Reminders from Xero
XeroGmailGoogle SheetsSlackIntermediate~45 minutes→ - 12 NODESAI
SALES & LEADS
Speed to Lead: AI Lead Qualification from Website Form to HubSpot
WebhookOpenAI or AnthropicHubSpotGmailIntermediate~45 minutes→
007 / QUESTIONS
Anything else is quicker to answer on a call. Thirty minutes, free, with the people who would build it.
No. Only PDFs go through text extraction. Images are classified using the file name, email subject and a short snippet of the email body, so the picture itself is never sent to the model. Image files that cannot be identified confidently are marked CHECK for a person.
We set up n8n end to end: hosting in Australia, connecting your systems, testing with real data and handing over documentation.
Book a free call→