Telegram to Google Sheets, expenses logged instantly
You spend money, you think “I’ll log that later,” and later never comes. A week passes, receipts vanish, and your “quick monthly check” turns into an annoying cleanup project.
Freelancers feel it when tax time creeps up. A small business owner feels it when cash flow looks fine, until it doesn’t. Even a marketing lead expensing tools and ads ends up guessing. This Telegram expense logging automation fixes the gap between “spent it” and “tracked it.”
You’ll see how this n8n workflow turns a simple Telegram text or voice note into a categorized row in Google Sheets, then answers questions like “How much did I spend on food this month?” in seconds.
The Problem: Expense Tracking Breaks in Real Life
Manual expense tracking fails for a boring reason: it relies on perfect habits. You’re in a rush, you’re in line, you’re walking into a meeting, and the last thing you want is opening a spreadsheet and formatting a row correctly. So you postpone. Then you forget what the transaction was, which card you used, or which category it belongs in. The cleanup later takes longer than the original entry, and it’s where mistakes slip in (wrong date, duplicated entries, “misc” everywhere).
The friction compounds. Here’s where it breaks down for most people:
- You lose small purchases first, and those “small” ones add up fast over a month.
- Typing categories and payment methods by hand invites inconsistency, so reporting becomes unreliable.
- Editing or deleting a mistake feels like a chore, which means bad data sticks around.
- You can’t easily answer questions on demand, so decisions get made on vibes instead of numbers.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Telegram to Google Sheets, expenses logged instantly
flowchart LR
subgraph sg0["Telegram Incoming Flow"]
direction LR
n0@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Route by Message Type", pos: "b", h: 48 }
n1["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Fetch Voice File"]
n2@{ icon: "mdi:robot", form: "rounded", label: "Audio Transcription", pos: "b", h: 48 }
n3@{ icon: "mdi:brain", form: "rounded", label: "Gemini Chat Engine", pos: "b", h: 48 }
n4@{ icon: "mdi:wrench", form: "rounded", label: "Math Utility", pos: "b", h: 48 }
n5@{ icon: "mdi:database", form: "rounded", label: "Modify Sheet Record", pos: "b", h: 48 }
n6@{ icon: "mdi:database", form: "rounded", label: "Retrieve Sheet Records", pos: "b", h: 48 }
n7@{ icon: "mdi:database", form: "rounded", label: "Append Sheet Record", pos: "b", h: 48 }
n8@{ icon: "mdi:database", form: "rounded", label: "Remove Sheet Record", pos: "b", h: 48 }
n9@{ icon: "mdi:memory", form: "rounded", label: "Session Buffer Memory", pos: "b", h: 48 }
n10@{ icon: "mdi:robot", form: "rounded", label: "Finance Assistant Agent", pos: "b", h: 48 }
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Send Unsupported Reply"]
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Deliver HTML Reply"]
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Telegram Incoming Trigger"]
n0 --> n10
n0 --> n1
n0 --> n11
n4 -.-> n10
n1 --> n2
n9 -.-> n10
n10 --> n12
n8 -.-> n10
n5 -.-> n10
n6 -.-> n10
n7 -.-> n10
n13 --> n0
n2 --> n10
n3 -.-> n10
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n13 trigger
class n2,n10 ai
class n3 aiModel
class n4 ai
class n9 ai
class n0 decision
class n5,n6,n7,n8 database
classDef customIcon fill:none,stroke:none
class n1,n11,n12,n13 customIcon
The Solution: Log, Edit, and Query Expenses From Telegram
This workflow turns Telegram into your finance “inbox.” You send a message to your bot (either a short text like “Lunch 12.50 card food” or a quick voice note), and n8n takes it from there. If it’s audio, the workflow fetches the voice file and transcribes it. Then an AI finance assistant interprets what you meant, extracts the key fields (type, value, category, payment method, description, date), and assigns an ID so each transaction stays manageable. Finally, it writes the transaction into Google Sheets, and it replies back in Telegram with a clean, readable summary formatted in Telegram HTML. No spreadsheet fumbling. No “I’ll do it later.”
The workflow starts with a Telegram trigger and routes your message based on type. AI handles interpretation and categorization, then Google Sheets gets updated (append, modify, retrieve, or remove). You get a formatted Telegram reply with confirmation or answers to queries.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you log 5 expenses a day. Manually, most people spend maybe 3 minutes per expense opening a sheet, finding the next row, entering value, category, payment method, and date, so that’s about 15 minutes daily (and realistically more when you’re tired). With this workflow, you send a Telegram text or voice note in about 1 minute, then wait a moment for transcription and categorization, and it’s already in Google Sheets. That’s roughly 10 minutes back every day, plus fewer “end of month” cleanup sessions.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Telegram Bot for sending text and voice expenses
- Google Sheets to store transactions in a table
- AI model access (get it from your Gemini or OpenAI provider console)
Skill level: Intermediate. You’ll connect accounts, match sheet headers exactly, and test a few real messages.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A Telegram message triggers the workflow. The moment your bot receives a message, n8n starts and checks what kind of message it is (text, voice, or something else).
Voice notes get converted into usable text. If you send audio, the workflow pulls the voice file from Telegram and runs transcription, so the assistant can treat it like a normal expense message.
An AI finance assistant interprets intent. This is the brain of the workflow. It decides if you’re trying to add a transaction, edit one, delete one, or ask a question like “total spend this month,” then it extracts fields like value, category, date, and payment method (card, cash, PIX, and so on). It also uses memory so a short back-and-forth still makes sense.
Google Sheets becomes the system of record. Based on your request, the workflow appends a row, modifies an existing row, removes one, or retrieves matching rows to calculate totals.
You can easily modify categories or the sheet column names to match your existing tracker. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Telegram Trigger
This workflow starts when a new Telegram message arrives and routes it based on message type.
- Add and open Telegram Incoming Trigger.
- Credential Required: Connect your telegramApi credentials.
- Confirm Updates includes
message. - Connect Telegram Incoming Trigger to Route by Message Type.
Step 2: Connect Google Sheets
The agent uses Google Sheets tools to retrieve, append, update, and remove financial records.
- Open Retrieve Sheet Records and set Document to
[YOUR_ID]and Sheet toPágina1(gid=0). - Credential Required: Connect your googleSheetsOAuth2Api credentials to Retrieve Sheet Records.
- Open Append Sheet Record and set Document to
[YOUR_ID]and Sheet toPágina1(gid=0). - Keep the column mapping expressions as provided, for example
{{ /*n8n-auto-generated-fromAI-override*/ $fromAI('id', ``, 'string') }}. - Credential Required: Connect your googleSheetsOAuth2Api credentials to Append Sheet Record.
- Open Modify Sheet Record and set Operation to
update, Document to[YOUR_ID], and Sheet toPágina1(gid=0). - Credential Required: Connect your googleSheetsOAuth2Api credentials to Modify Sheet Record.
- Open Remove Sheet Record and set Operation to
delete, Document to[YOUR_ID], and Sheet toPágina1(gid=0). - Set Start Index to
{{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start_Row_Number', ``, 'number') }}and Number to Delete to{{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Number_of_Rows_to_Delete', ``, 'number') }}. - Credential Required: Connect your googleSheetsOAuth2Api credentials to Remove Sheet Record.
[YOUR_ID] with your real Google Sheets document ID in all four nodes, or the agent tools will fail.Step 3: Set Up the AI Processing and Memory
The agent interprets Telegram messages, transcribes audio, and interacts with Google Sheets using AI tools and memory.
- Open Audio Transcription and confirm Resource is
audioand Input Type isbinary. - Credential Required: Connect your googlePalmApi credentials to Audio Transcription.
- Open Gemini Chat Engine and ensure it remains connected as the language model for Finance Assistant Agent.
- Credential Required: Connect your googlePalmApi credentials to Gemini Chat Engine.
- Open Session Buffer Memory and set Session Key to
{{ $('Telegram Incoming Trigger').item.json.message.from.id }}with Session ID Type set tocustomKey. - Open Finance Assistant Agent and set Text to
{{ $json.content?.parts[0].text || $json.message.text }}. - Confirm the system prompt in Finance Assistant Agent matches your financial assistant instructions and HTML formatting rules.
- Ensure the AI tools Math Utility, Retrieve Sheet Records, Append Sheet Record, Modify Sheet Record, and Remove Sheet Record are connected to Finance Assistant Agent.
Step 4: Configure Routing and Telegram Replies
This step routes message types, fetches voice files, and sends HTML responses back to Telegram.
- Open Route by Message Type and verify the two rules use
{{ $json.message.text }}(Text output) and{{ $json.message.voice }}(Voice output) with Fallback Output set toextra. - Connect Route by Message Type to Finance Assistant Agent for Text, to Fetch Voice File for Voice, and to Send Unsupported Reply for fallback.
- Open Fetch Voice File and set Resource to
fileand File ID to{{ $('Telegram Incoming Trigger').item.json.message.voice.file_id }}. - Credential Required: Connect your telegramApi credentials to Fetch Voice File.
- Confirm Fetch Voice File connects to Audio Transcription, and Audio Transcription connects to Finance Assistant Agent.
- Open Send Unsupported Reply and set Text to
⚠️ Desculpe! Não consigo processar imagens ou vídeos. Por favor, envie sua mensagem em texto ou voz.and Chat ID to{{ $('Telegram Incoming Trigger').item.json.message.from.id }}. - Credential Required: Connect your telegramApi credentials to Send Unsupported Reply.
- Open Deliver HTML Reply and set Text to
{{ $json.output }}and Chat ID to{{ $('Telegram Incoming Trigger').item.json.message.from.id }}. - Credential Required: Connect your telegramApi credentials to Deliver HTML Reply.
Step 5: Test and Activate Your Workflow
Validate the full path from incoming Telegram messages to the AI response and Sheets operations.
- Click Execute Workflow and send a Telegram text message to your bot to trigger Telegram Incoming Trigger.
- Confirm the message flows through Route by Message Type to Finance Assistant Agent and ends at Deliver HTML Reply with a formatted HTML response.
- Send a Telegram voice message and verify it flows through Fetch Voice File → Audio Transcription → Finance Assistant Agent → Deliver HTML Reply.
- Check that Google Sheets tools execute when the agent needs to retrieve or write data.
- When everything works, toggle the workflow to Active to enable production use.
Common Gotchas
- Google Sheets credentials can expire or need specific permissions. If things break, check the credential status in n8n and confirm the Google account can edit that spreadsheet.
- If you’re using voice notes, processing times vary because transcription isn’t instant. If downstream nodes fail on empty responses, increase the wait or add a retry before the AI step.
- Default AI prompts are generic. Add your category list and your “rules” (like how you treat refunds or transfers) early, or you’ll be correcting categories forever.
Frequently Asked Questions
About 30 minutes if your bot and sheet are ready.
No. You’ll mostly be connecting accounts and matching your Google Sheet columns to the expected headers.
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 AI usage costs from your provider (Gemini or OpenAI), which are usually small per message.
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.
Yes, and you should. Most people customize the AI assistant instructions so it only uses your allowed categories (like “food,” “ads,” “software,” “travel”) and your real payment methods (card, cash, PIX). You can also adjust the Google Sheets action nodes (append, modify, retrieve, remove) if your sheet uses different column names or you want extra fields like “client” or “project.” After that, test with ten real messages and tweak until the categorization feels boringly accurate.
Usually it’s the bot token or chat permissions. Recheck the Telegram bot token in n8n credentials, confirm the bot is allowed to message you, and make sure you’re sending to the correct bot (people accidentally test in the wrong chat more often than they admit). If voice messages fail, it can also be that fetching the file from Telegram is blocked or the file ID isn’t being passed through the route correctly.
A lot.
If you want “text or voice in, structured sheet row out,” n8n is usually the better fit because you can handle routing, memory, and more complex logic in one workflow without turning it into a pile of paid steps. Self-hosting is a big deal too if you plan to log everything daily and don’t want to count tasks. Zapier or Make can still work if you only need a simple form-to-sheet pipeline, and you don’t care about editing, deleting, or natural-language queries. The AI assistant part is also easier to shape in n8n because you can control the prompts, tools, and formatting in one place. Talk to an automation expert if you want help picking the simplest option for your setup.
Once this is running, expenses get captured while they’re still fresh. The workflow keeps the sheet clean, and you keep your attention on work (or life), not on chasing transactions.
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.