🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Gmail + Telegram to Google Sheets, expenses logged

Lisa Granqvist Partner Workflow Automation Expert

Expense tracking falls apart in boring ways. You miss a small UPI charge, you forget a cash note you texted yourself, and suddenly your “budget” is just a hopeful spreadsheet you update once a month.

This expense logging automation hits busy founders and household managers hardest, but marketing leads running team cards and ops folks reconciling tools feel it too. The outcome is simple: your transactions get captured, categorized, and logged without the daily copy-paste grind.

You’ll see how this n8n workflow pulls transactions from Gmail and Telegram, uses AI to structure the details, and writes everything into Google Sheets so your budget tracker stays current.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Gmail + Telegram to Google Sheets, expenses logged

The Problem: Expense tracking breaks when it’s manual

If your spending comes from multiple places (bank alerts, UPI apps like Google Pay or Paytm, card swipes, and random “I’ll log it later” notes), manual tracking becomes a weekly cleanup project. You hunt through Gmail, copy amounts into a sheet, guess categories, then try to remember what “₹430 to XYZ” actually was. One missed email turns into two. Then your budget review is based on incomplete data, which is honestly worse than having no tracker at all because it gives false confidence. Even when you do log everything, small formatting errors and duplicated entries creep in.

The friction compounds. Here’s where it usually breaks down.

  • You spend about 10 minutes per transaction copying details from Gmail into a sheet, and it adds up fast across a month.
  • UPI and bank emails all look different, so your categories end up inconsistent and your reports get messy.
  • Telegram “quick notes” are easy to send and easy to forget, which means cash expenses and odd purchases slip through.
  • Budget checks happen after the damage is done because nobody is recalculating totals every day.

The Solution: AI-classified expenses from Gmail and Telegram into Sheets

This workflow watches two inputs: new finance-related emails in Gmail and expense/budget messages sent to a Telegram bot. When a message arrives, it runs the content through an AI parser (Gemini models inside n8n, with an OpenAI Chat Model also present in the workflow) that extracts the fields you actually need for tracking: date, amount, category, description, source, and status. Then it decides what you meant (a budget update or an expense) and appends a clean row to the correct Google Sheets tab. For Gmail transactions, it also detects the account/source based on the sender address or UPI patterns, filters out irrelevant emails, and splits credit vs. debit so your tracker stays structured. Finally, you get a confirmation message in Telegram, and your sheet stays ready for monthly and yearly summaries.

The workflow starts when Gmail or Telegram triggers fire. AI turns unstructured text into consistent columns, then Google Sheets becomes your single log. If your totals exceed the budget you set in the Budgets tab, you can raise an alert (the workflow supports alerts, and the provided approach includes a Google Sheets Apps Script for email notifications).

What You Get: Automation vs. Results

Example: What This Looks Like

Say you have about 2 bank/UPI transaction emails a day and you also drop 1 manual expense note into Telegram. Manually, that’s roughly 10 minutes per item to open the message, read it, format a row, and pick a category, or about 30 minutes a day (around 15 hours a month). With this workflow, you spend maybe 2 minutes sending a Telegram note when needed, and Gmail entries happen on their own while you work. You still review the sheet sometimes, but the daily logging basically disappears.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Google Sheets to store Expenses and Budgets tabs.
  • Gmail for incoming bank and UPI transaction emails.
  • Telegram Bot to submit manual expenses or budgets quickly.
  • Gemini API key (get it from Google AI Studio or your Google Cloud project).

Skill level: Intermediate. You will connect accounts, paste API keys, and do light setup in Google Sheets (tabs and columns) without writing code in n8n.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

Gmail or Telegram kicks it off. A Gmail trigger watches for new messages, while a Telegram trigger listens for messages sent to your bot. Two inputs, one tracker.

Finance-only filtering happens early. A small code-based filter checks sender patterns (HDFC, Indian Bank, Indian Overseas Bank, and common UPI formats) so you don’t log random inbox noise. If it can’t match the sender to a known source, it skips the entry.

AI turns messy text into clean columns. The workflow sends the email body or Telegram message to an AI “structuring” chain, then a structured parser extracts consistent fields like date, amount, account, type (credit/debit), and category. This is the part that makes the sheet usable long-term.

Google Sheets becomes the system of record. Expenses go to the Expenses tab (with separate branches for credit and debit), budgets go to the Budgets tab, and Telegram posts back a confirmation so you know it logged successfully.

You can easily modify the sender detection and categories to match your own banks and budget structure. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Triggers

This workflow starts from Telegram messages and Gmail alerts, so both trigger nodes must be configured first.

  1. Open Telegram Intake Trigger and connect your Telegram bot to listen for Updates set to message.
  2. Credential Required: Connect your telegramApi credentials in Telegram Intake Trigger (this is required even though it is not preconfigured).
  3. Open Gmail Intake Trigger and confirm Poll Times is set to everyHour.
  4. Credential Required: Connect your Gmail OAuth credentials in Gmail Intake Trigger (not configured in the template).
⚠️ Common Pitfall: If Telegram or Gmail credentials are missing, the triggers will never fire even if the workflow is active.

Step 2: Connect Google Sheets

All finance entries are appended to the Budgets and Expenses sheets in the Finances spreadsheet.

  1. Open Append Budget Sheet Row and set Document to [YOUR_ID] and Sheet to Budgets.
  2. Map the column values in Append Budget Sheet Row to expressions like {{$json.output.Month}}, {{$json.output['Budget Amount']}}, and {{$json.output.UpdatedAt}}.
  3. Credential Required: Connect your googleSheetsOAuth2Api credentials in Append Budget Sheet Row (not configured in the template).
  4. Open Append Expense Sheet Row and confirm the Document is [YOUR_ID] and Sheet is Expenses.
  5. Ensure Append Expense Sheet Row maps fields like {{$json.output.Amount}}, {{$json.output.Category}}, and {{$json.output.MessageId}}.
  6. Credential Required: Connect your googleSheetsOAuth2Api credentials in Append Expense Sheet Row, Append Credit Expense Row, and Append Debit Expense Row.
Use the same Google Sheets credential for all Google Sheets nodes to prevent permission mismatches across the Budgets and Expenses sheets.

Step 3: Set Up the AI Parsing Chain

The workflow uses multiple Gemini chat engines and structured parsers to interpret budgets and expenses from Telegram and Gmail inputs.

  1. Open Gemini Chat Engine A and add your Gemini credentials for use by Telegram Message Parser.
  2. Credential Required: Connect your googlePalmApi credentials in Gemini Chat Engine A (not configured in the template).
  3. Confirm Telegram Message Parser uses Text set to {{$json.message.text}} and its system message includes the required JSON-only output rules.
  4. Verify Budget Detail Extractor and Expense Detail Extractor use Text set to {{$json.text}} and Prompt Type set to define.
  5. Ensure Gemini Chat Engine B and Gemini Chat Engine C are connected as the language models for Budget Detail Extractor and Expense Detail Extractor respectively.
  6. Credential Required: Gemini Chat Engine B and Gemini Chat Engine C must use googlePalmApi credentials (already configured).
  7. For the structured parsers, keep Expense Schema Parser and Budget Schema Parser schemas as provided. Credentials for these parsers must be added to their parent nodes (Budget Detail Extractor and Expense Detail Extractor), not the sub-nodes.
  8. Confirm LLM Email Structuring uses Text set to {{$json.snippet}} and is connected to Gemini Chat Engine D, which already has googlePalmApi credentials configured.
  9. Confirm Parse Email Details uses Text set to {{$json.text}} and is connected to Gemini Chat Engine E with googlePalmApi credentials configured.
⚠️ Common Pitfall: If the AI nodes return extra text around JSON, Initial Budget vs Expense Check will fail because it expects strict JSON output.

Step 4: Configure Filtering and Routing Logic

Routing nodes determine whether the input is a budget or expense and where expense entries should be stored.

  1. In Filter Finance Email Sources, keep the existing JavaScript to whitelist finance email senders and identify the account value.
  2. Confirm Initial Budget vs Expense Check uses the condition {{ JSON.parse($json.text.replace(/```json\n?|```/g, '').trim()).type }} equals budget.
  3. Ensure Final Budget vs Expense Gate checks {{$json.output.type}} equals budget before writing to the budgets sheet.
  4. Verify Credit vs Debit Branch checks {{$json.output.type}} equals Credit to route to Append Credit Expense Row; the false branch routes to Append Debit Expense Row.

Step 5: Configure Output Notifications

After a row is appended, the workflow sends a Telegram confirmation to the originating user.

  1. Open Send Telegram Confirmation and confirm Chat ID is set to {{$('Telegram Intake Trigger').item.json.message.from.id}}.
  2. Update the confirmation Text message if needed, keeping the spreadsheet URL updated: https://docs.google.com/spreadsheets/d/[YOUR_ID]/edit?usp=sharing.
  3. Credential Required: Connect your telegramApi credentials in Send Telegram Confirmation (already configured).

Step 6: Test and Activate Your Workflow

Run end-to-end tests from both Telegram and Gmail to validate routing and sheet updates.

  1. Click Execute Workflow and send a Telegram message like “Set budget for groceries 5000” to trigger Telegram Intake Trigger.
  2. Verify a new row appears in the Budgets sheet via Append Budget Sheet Row and a Telegram response is sent by Send Telegram Confirmation.
  3. Send a test bank alert email to the Gmail inbox used by Gmail Intake Trigger and confirm Filter Finance Email Sources passes it through.
  4. Check that the entry is routed through Credit vs Debit Branch and appended by either Append Credit Expense Row or Append Debit Expense Row.
  5. Once verified, switch the workflow to Active for production use.
Successful runs will create a new Google Sheets row and send a Telegram confirmation back to the original Telegram user.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Google Sheets credentials can expire or need specific permissions. If things break, check the n8n credential connection status and that the spreadsheet is shared with the connected Google account first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this expense logging automation?

About an hour if your Google Sheet is already prepared.

Do I need coding skills to automate expense logging?

No. You’ll mostly connect accounts, add API keys, and map columns in Google Sheets.

Is n8n free to use for this expense logging automation workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Gemini/OpenAI API costs, which are usually small per message but depend on your usage.

Where can I host n8n to run this expense logging automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this expense logging automation workflow for new banks or categories?

Yes, and you should. The “Filter Finance Email Sources” code step is where you add or change sender patterns (banks, UPI apps), and the AI extraction steps can be updated to include your own categories like Travel, Groceries, Subscriptions, or Client Meals. Many people also tweak the “Budget vs Expense” checks so Telegram messages like “budget food 12000” or “spent 450 coffee” route correctly. Once it’s dialed in, it stays consistent.

Why is my Gmail connection failing in this expense logging automation?

Usually it’s an auth issue: the Gmail OAuth token expired, the connected Google account changed, or the trigger lost permission after a security review. Reconnect the Gmail credential in n8n and confirm the workflow is allowed to read the inbox. Also check the filter logic: if the sender doesn’t match your bank/UPI patterns, the workflow may be “working” but intentionally outputting nothing.

How many transactions can this expense logging automation handle?

For most personal and small-team use, it’s plenty.

Is this expense logging automation better than using Zapier or Make?

Often, yes, because this workflow needs branching logic (budget vs. expense, credit vs. debit) and AI parsing, and those flows can get pricey or awkward on simpler tools. n8n is flexible with “if” gates, merging paths, and structured extraction, so you can keep everything in one automation instead of juggling multiple Zaps. Another big reason is self-hosting, which can make high-volume logging affordable when you have lots of transaction emails. That said, if you only need “Telegram message → add row to sheet,” Zapier or Make might feel faster to set up. If you’re torn, Talk to an automation expert and get a clear recommendation.

Once this is running, your sheet stops being a “someday” admin task and starts reflecting reality. The workflow takes the repetitive logging off your plate so you can make decisions with current numbers.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal