Skip to main content

Track expenses from Telegram to Google Sheets with GPT-4.1 Mini

Workflow preview

Workflow preview
100%
Track expenses from Telegram to Google Sheets with GPT-4.1 Mini preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Telegram Expense Tracker to Google Sheets with GPT 4.1 [![Watch the video](https://s3.ap southeast 1.amazonaws.com/automatewith.me/track expenses from telegram to google sheets with gpt 41 mini+...

Best for

  • Personal Productivity automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.if, n8n-nodes-base.telegram, n8n-nodes-base.code, n8n-nodes-base.googlesheets, @n8n/n8n-nodes-langchain.agent

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Trung Tran.

Original n8n.io source

1.1 Workflow description

Title
Track expenses from Telegram to Google Sheets with GPT-4.1 Mini
Workflow name
Track expenses from Telegram to Google Sheets with GPT-4.1 Mini

đź“’ Telegram Expense Tracker to Google Sheets with GPT-4.1

> A lightweight automation that lets users log daily expenses via a Telegram bot and instantly saves them into Google Sheets—perfect for anyone looking to manage spending on the go with AI-powered structure and ease.

👤 Who’s it for

This workflow is for anyone who wants to log their daily expenses by simply chatting with a Telegram bot. Ideal for:

  • Individuals who want a quick way to track spending
  • Freelancers who log receipts and purchases on the go
  • Teams or small business owners who want lightweight expense capture

⚙️ How it works / What it does

  1. User sends a text message on Telegram describing an expense
    (e.g., “Bought coffee for 50k at Highlands”)

  2. Message format is validated

    • If the message is text, it proceeds to GPT-4.1 Mini for processing.
    • If it's not text (e.g. image or file), the bot sends a fallback message.
  3. OpenAI GPT-4.1 Mini parses the message and returns:

    • relevant: true/false
    • expense_record: structured fields (date, amount, currency, category, description, source)
    • message: a friendly confirmation or fallback
  4. If valid:

    • The bot replies with a fun acknowledgment
    • The data is saved to a connected Google Sheet
  5. If invalid:

    • A fallback message is sent to encourage proper input

🛠️ How to set up

1. Telegram Bot Setup

  • Create a bot using BotFather on Telegram
  • Copy the bot token and paste it into the Telegram Trigger node

2. Google Sheet Setup

  • Create a Google Sheet with these columns:
    Date | Amount | Currency | Category | Description | SourceMessage
    
  • Share the sheet with your n8n service account email

3. OpenAI Configuration

  • Connect the OpenAI Chat Model node using your OpenAI API key
  • Use GPT-4.1 Mini as the model
  • Apply a system prompt that extracts structured JSON with:
    • relevant, expense_record, and message

4. Add Parser

  • Use the Structured Output Parser node to safely parse the JSON response

5. Conditional Logic Nodes

  • Is text message?
    • Checks if the message is in text format
  • Supported scenario?
    • Checks if relevant = true in the LLM response

6. Final Actions

  • If relevant:
    • Send confirmation via Telegram
    • Append row to Google Sheet
  • If not relevant:
    • Send fallback message via Telegram

âś… Requirements

  • Telegram bot token
  • OpenAI GPT-4.1 Mini API access
  • n8n instance (self-hosted or cloud)
  • Google Sheet with access granted to n8n
  • Basic understanding of n8n node configuration

đź§© How to customize the workflow

Feature How to Customize
Add multi-currency support Update system prompt to detect and extract different currencies
Add more categories Modify the list of categories in the system prompt
Track multiple users Add username or chat ID column to the Google Sheet
Trigger alerts Add Slack, Email, or Telegram alerts for specific expense types
Weekly summaries Use a cron node + Google Sheet query + Telegram message
Visual dashboards Connect the sheet to Looker Studio or Google Data Studio

Built with 💬 Telegram + 🧠 GPT-4.1 Mini + 📊 Google Sheets + ⚡ n8n

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 2 - OpenAI Chat Model2

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 3 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 4 - Supported scenario?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 5 - Acknowledge the expense

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 6 - Send un-supported scenario message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 7 - Transform the output to expense record

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Log expense record to google sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 9 - Budget Buddy Telegram Agent Text

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.1

Block 10 - Is text message?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 11 - Un-supported message type

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 12 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note11

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Track expenses from Telegram to Google Sheets with GPT-4.1 Mini
Complexity advanced
Nodes 23
Categories Personal Productivity, AI Summarization
Author Trung Tran
Published 04 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6970/6970.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Track expenses from Telegram to Google Sheets with GPT-4.1 Mini do?

Telegram Expense Tracker to Google Sheets with GPT 4.1 [![Watch the video](https://s3.ap southeast 1.amazonaws.com/automatewith.me/track expenses from telegram to google sheets with gpt 41 mini+...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI Summarization use case.