Automated AI Expense Tracker: Gmail to Google Sheets
detail.loadingPreview
This workflow automates the often tedious process of tracking expenses by extracting spend details directly from your Gmail inbox. It intelligently processes both email bodies and password-protected PDF attachments, leveraging AI to categorize and structure your financial data before automatically logging it into a Google Sheet.
About This Workflow
Streamline your financial management with this powerful n8n workflow designed to automatically capture and categorize expense information. It diligently monitors your Gmail account for incoming invoices and payment confirmations, capable of extracting crucial details from email bodies (via specific HTML selectors) and even password-protected PDF attachments. Utilizing the advanced Google Gemini AI model, the workflow intelligently parses unstructured text into a predefined, structured schema, identifying key data points like date, amount, service, category, currency, and payment card. Finally, all extracted and structured expense records are seamlessly added to your designated Google Sheet, providing you with an organized and up-to-date overview of your spending without manual data entry.
Key Features
- Automated Gmail Monitoring: Watches specific Gmail labels for new invoices and payment emails every minute.
- Advanced Data Extraction: Extracts expense details from both email HTML content and password-protected PDF attachments.
- AI-Powered Categorization: Leverages Google Gemini to intelligently parse and categorize unstructured spend data into a structured JSON schema.
- Customizable Expense Schema: Defines precise fields like date, amount, service, category, currency, and card, with custom enums for robust classification.
- Seamless Google Sheets Integration: Automatically logs all parsed expense records into a Google Sheet for easy tracking and analysis.
How To Use
- Connect Gmail: Link your Gmail account to the "Get invoice" and "Get payment" nodes. Update the
labelIdsin the filters to match the labels you use for invoices and payment confirmations. - Configure PDF Extraction: If your invoices or payment documents are password-protected PDFs, update the
passwordfield in both "Extract invoice" and "Extract payment" nodes with the correct password. - Adjust HTML Extraction (Optional): If your email bodies contain spend details in a specific HTML structure, adjust the
cssSelectorin the "HTML" node (e.g.,".spend-table") to accurately capture the information. - Refine AI Schema: Review the JSON schema in the "Structured Output Parser1" node. Customize
category,currency, andcardenumvalues to fit your specific needs and ensure accurate AI parsing. - Set Up Google Sheets: Connect your Google Sheets account to the "Send" node. Specify the Spreadsheet ID and Sheet Name where you want to log your expenses. Verify that the column mapping (
date,amount,details, etc.) aligns with your sheet's headers.
Apps Used
Workflow JSON
{
"id": "fe847531-a8f9-42b1-b9b7-16e7b7d465bd",
"name": "Automated AI Expense Tracker: Gmail to Google Sheets",
"nodes": 17,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: fe847531-a8f9...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Workflows
Discover more workflows you might like
Google Sheets to Icypeas: Automated Bulk Domain Scanning
This workflow streamlines the process of performing bulk domain scans by integrating your Google Sheets data directly with the Icypeas platform. Automate the submission of company names from your spreadsheet to Icypeas for comprehensive domain information, saving valuable time and effort.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.