Templates / Automated expense tracking from emails & Telegram with Gemini AI & Google Sheets

Automated expense tracking from emails & Telegram with Gemini AI & Google Sheets

Ready for 3.0

by Alex · 1,140 views · created 2025-08-20 · AI Summarization, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Worth a look

Nodes used (10)

TelegramGoogle Gemini Chat ModelBasic LLM ChainStructured Output ParserGmailGoogle SheetsInformation Extractor

What it does

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. This n8n template automatically parses bank transaction emails (HDFC, Indian Bank, Indian Overseas Bank, UPI apps like Google pay, Paytm, etc.) - The from email(bank name/UPI apps) is changable, classifies them using Gemini AI, and logs them into a structured Google Sheets budget tracker. It helps you consolidate expenses, compare against monthly budgets, and get real-time alerts when limits are exceeded. 📝 Problem Statement Tracking expenses manually from different bank emails and UPI apps is frustrating, time-consuming, and error-prone. Small transactions often slip through, making budget control difficult. This workflow solves that by: Automatically extracting financial data from Gmail. Categorizing expenses using AI parsing. Saving all data into Google Sheets in a structured way. Comparing with monthly budgets and raising alerts. Target Audience: Individuals who want personal budget automation. Families managing shared household spending. Small teams looking for a lightweight financial log. ⚙️ Setup Prerequisites An n8n instance (self-hosted or cloud). A Google account with Gmail + Google Sheets enabled. Pre-created Google Sheets file with 2 tabs: Expenses Budgets A configured Gemini API connection in n8n. 📊 Google Sheets Template Expenses Tab (columns in order): Timestamp | Date | Account | From | To | Type | Category | Description | Amount | Currency | Source | MessageId | Status Budget Tab (columns in order): Month | Category | Budget Amount | Notes | UpdatedAt Yearly Summary Tab (auto-calculated): Year | Month | Category | Total Expense | Budget | Variance | Alert Variance = Budget - Total Expense Alert = ⚠️ Over Budget when spending > budget 🚀 How It Works Gmail: Gmail Trigger captures new bank/UPI emails. Gemini AI Parser extracts structured details (date, amount, category, etc.). Filter Node ensures only valid financial transactions are logged. Information extractor will extract the information like Date, account, transaction type(Credit/Debit), description, currency, status, messageId, from email, to email, category -> checks if the transaction is 'Credit' or 'Debit' then appends the details to the respective google sheet Budget Validator checks against monthly allocations. If the expense is above the budget is raises an alert and will send a email to the connected account. For sending email I wrote a Google Sheet App script: function myFunction() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var monthly = ss.getSheetByName("MonthlySummary"); var yearly = ss.getSheetByName("YearlySummary"); // Get values from Monthly Summary var totalExpense = monthly.getRange("D2").getValue(); var budget = monthly.getRange("E2").getValue(); // Get current date info var now = new Date(); var month = Utilities.formatDate(now, "GMT+5:30", "MM"); var year = Utilities.formatDate(now, "GMT+5:30", "yyyy"); var status = (totalExpense > budget) ? "Alert" : ""; // Append to Yearly Summary yearly.appendRow(year, month, totalExpense, status); // If budget exceeded, send alert email if (status === "Alert") { var emailAddress = "YOUR EMAIL"; var subject = "⚠️ Budget Exceeded - " + month + "/" + year; var body = "Your total expenses this month (" + totalExpense + ") have exceeded your budget of " + budget + ".\n\n" + "Please review your spending."; MailApp.sendEmail(emailAddress, subject, body); } // 🔄 Reset Monthly Summary var lastRow = monthly.getLastRow(); if (lastRow > 3) { // assuming headers in first 2-3 rows monthly.getRange("A4:C" + lastRow).clearContent(); } // Reset total in D2 monthly.getRange("D2").setValue(0); } Monthly summary auto-calculates the expense and updates the expense for every month and budgets(sum all budgets if there are more than 1 budgets). Yearly Summary auto-updates and raises over-budget alerts. Telegram: Takes input from a telegram bot which is connected to the n8n workflow telegram trigger. Ge

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.