Skip to main content

Log receipts from Telegram to Google Sheets and query spending with Gemini

Workflow preview

Workflow preview
100%
Log receipts from Telegram to Google Sheets and query spending with Gemini preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow logs receipt photos from Telegram into Google Sheets using Google Gemini for data extraction, and exposes an MCP server tool that lets clients like Claude or ChatGPT qu...

Best for

  • Invoice Processing automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.mcptrigger, @n8n/n8n-nodes-langchain.toolworkflow, n8n-nodes-base.stickynote, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.googlesheets, n8n-nodes-base.code, n8n-nodes-base.telegramtrigger, n8n-nodes-base.telegram

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Țugui Dragoș.

Original n8n.io source

1.1 Workflow description

Title
Log receipts from Telegram to Google Sheets and query spending with Gemini
Workflow name
Log receipts from Telegram to Google Sheets and query spending with Gemini

Quick Overview

This workflow logs receipt photos from Telegram into Google Sheets using Google Gemini for data extraction, and exposes an MCP server tool that lets clients like Claude or ChatGPT query your spending by month and category.

How it works

  1. Triggers when you send a receipt photo to your Telegram bot.
  2. Downloads the highest-resolution image from the Telegram message and sends it to Google Gemini to extract receipt details as JSON.
  3. Parses and normalizes the extracted fields (date, amount, currency, vendor, category, note) and adds a timestamp.
  4. Appends the expense as a new row in Google Sheets and replies in Telegram with a confirmation message.
  5. Exposes an MCP Server HTTP/SSE endpoint that MCP clients can call to query spending.
  6. When queried, reads all expenses from the same Google Sheet, filters by the requested month and category, and returns totals, a category breakdown, and matching transactions.

Setup

  1. Create a Telegram bot with @BotFather and add your Telegram credential so the workflow can receive messages, download photos, and send confirmations.
  2. Add a Google Gemini API credential for the Google Gemini node.
  3. Create a Google Sheet with headers: Date, Amount, Currency, Vendor, Category, Note, LoggedAt, then set the document ID and sheet name in both Google Sheets nodes (Append to Expense Sheet and Read Expenses).
  4. After importing, open the Query Spending tool configuration and re-link it to your own copy of the “Personal Finance Query Spending (MCP Tool)” sub-workflow, then save that sub-workflow.
  5. Activate the MCP Server workflow to generate the Production URL, then configure that URL in your MCP client (Claude Desktop/ChatGPT/Cursor).
  6. For production use, enable Bearer authentication on the MCP server trigger and set the same token in your MCP client.

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 - MCP Server: Personal Finance

Type / Role
@n8n/n8n-nodes-langchain.mcpTrigger - mcpTrigger
Config choices
Version 1.1

Block 2 - Query Spending

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2.2

Block 3 - Sticky Note 1024f92c

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

Block 4 - Sticky Note e32fcb47

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

Block 5 - Sticky Note bec4f349

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

Block 6 - Sticky Note 08915f35

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

Block 7 - Receive Query Parameters

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

Block 8 - Read Expenses

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

Block 9 - Filter and Summarize

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

Block 10 - Sticky Note b5714413

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

Block 11 - Sticky Note 4dc72d23

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

Block 12 - Sticky Note 7d4d6f62

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

Block 13 - Receive Receipt Photo

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

Block 14 - Download Photo

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

Block 15 - Extract Receipt Data with Gemini

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

Block 16 - Parse Extracted JSON

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

Block 17 - Append to Expense Sheet

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

Block 18 - Confirm in Telegram

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

Block 19 - Sticky Note 045354c6

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

Block 20 - Sticky Note 7f8b9c55

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

Block 21 - Sticky Note c1b7bdd3

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

Block 22 - Sticky Note 2c2dbff3

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

Block 23 - Sticky Note 5cb9151a

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

Block 24 - Template Overview

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

3. Summary Table

Workflow Log receipts from Telegram to Google Sheets and query spending with Gemini
Complexity advanced
Nodes 24
Categories Invoice Processing, AI RAG
Author Țugui Dragoș
Published 07 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16166/16166.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 Log receipts from Telegram to Google Sheets and query spending with Gemini do?

Quick Overview This workflow logs receipt photos from Telegram into Google Sheets using Google Gemini for data extraction, and exposes an MCP server tool that lets clients like Claude or ChatGPT qu...

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 Invoice Processing, AI RAG use case.