Paolo Ronco
PORTFOLIO
Automatically fetch, store, and extract key information from invoices received via email from your ISP or utility provider (electricity, gas, telecom, water, etc.).The workflow saves the invoices to Google Drive (or optionally to your personal FTP/SFTP server) and logs all invoice details into Google Sheets via AI-powered extraction.
👨🏻💻GitHub: paoloronco/n8n-templates
👥 n8n Community Template: Coming Soon
Before configuring the workflow, you’ll need:
[email protected]
20-SaveInvoices-Templates.json
Automated Invoice Archiving
You should now see a flow that includes nodes like:
The sticky notes in the canvas will help you visually understand each section.
This workflow uses the Gmail nodes:
Tip: Use a dedicated Gmail account or label for invoices if possible. That makes testing and monitoring easier.
Used by:
https://drive.google.com/drive/folders/ABC123...
/folders/
Do the same credential selection for Delete a file1.
If you don’t need FTP, you can disable or remove this node. If you do:
sftp
ftp
/home/user/invoices/
This pair of nodes is responsible for turning raw PDF text into structured JSON (vendor, date, amount, line items, taxes, etc.).
gpt-4.1
gpt-4.1-mini
llama-3
Note: The system prompt and extraction instructions are already configured in the template to return structured JSON with vendor_name, invoice_date, total_amount, line_items, tax fields, etc. You can tweak the prompt if your invoices follow specific formats.
vendor_name
invoice_date
total_amount
line_items
This node appends one row per processed invoice into a Google Sheet.
Vendor
Type
Date
Amount
You can extend with more columns later (e.g., Invoice Number, Tax, etc.), but these four are what the template uses by default.
Invoice Number
Tax
https://docs.google.com/spreadsheets/d/DOCUMENT_ID/edit#gid=...
{{$json.vendor_name}}
{{$json.line_items[0].description}}
{{$json.invoice_date}}
{{$json.total_amount}}
Now let’s walk through the main nodes in execution order and confirm what you may need to change.
Node: Schedule Trigger
Configure:
Node: Get many messages
Node: Filter-contains_attachment
This node uses a simple “exists” condition on the binary data of the previous node. Normally you don’t need to change anything.
Node: Gmail-Get_Invoice
downloadAttachments
The template already uses the ID from the Get many messages node, so there’s nothing else to edit.
Node: GoogleDrive-upload-file
{{ $json.from.value[0].name }}-{{ $json.date }}
Node: downloadFile (HTTP Request)
webContentLink
This node should work as-is; no configuration is usually required.
Node: FTP-upload-octopus
/invoices/
.pdf
If you don’t have or don’t want FTP:
Node: Delete a file1
You can:
It references the uploaded file ID from GoogleDrive-upload-file, so it should work without changes (as long as that node is configured).
Node: Delete a message
If you want to keep the emails in your inbox:
Otherwise, leave it enabled – it uses the message ID from Get many messages.
Node: Extract from File1
pdf
If your invoices are image-only PDFs, you’ll need OCR support (e.g., via another service). For standard text-based invoices, this node is sufficient.
Nodes: OpenRouter Chat Model1 → AI_Agent-fields
invoice_number
tax_details
line_total
You can adjust the prompt to match your country’s invoice formats, additional fields, or specific tax rules.
Node: Code_extractFields (Code node)
You usually don’t need to edit this node. It returns a clean JSON object that the Google Sheets node can consume.
Node: GoogleSheets_save
To capture more fields:
Before making it active on a schedule, test it manually.
Get many messages
Filter-contains_attachment
Gmail-Get_Invoice
binary
GoogleDrive-upload-file
Extract from File1
AI_Agent-fields
GoogleSheets_save
If something fails:
Once you’re happy with the test:
Once the base workflow is working, you can expand it:
Merge
Delete a message
Processed-Invoices
tax_breakdown
You now have a fully documented, production-ready Automated Invoice Archiving workflow in n8n, with detailed configuration for Gmail, Google Drive, FTP/SFTP, AI, and Google Sheets. Once active, it should quietly keep your invoices organized and your spending data ready for analysis.
No spam, guaranteed.Unsubscribe anytime
By subscribing you agree to our privacy policy
Check your inbox or spam folder to confirm your subscription.
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Post Comment