n8n Telegram Receipt Processing & Expense Logging Engine — n8n Telegram Receipt Processing Engine Overview

n8n Telegram Receipt Processing & Expense Logging Engine

AI / LLM
n8n
Gemini AI
Telegram
Google Drive
Google Sheets
AI Vision
Platformn8n v1.x

Self-hosted workflow engine

Vision ModelGemini (Temp=0)

Deterministic multimodal JSON extraction

IngestionTelegram Webhook

Instant mobile photo ingestion

Payload BridgeBinary Re-attachment

Edit Fields node bridges state across branches

About the Project

n8n Telegram Receipt Processing & Expense Logging Engine is a multimodal vision automation workflow built in n8n. It allows users to snap receipt photos from Telegram and instantly log structured financial data into Google Sheets while archiving files in Google Drive. Workflow Execution & Architecture: 1. Ingestion & Multimodal Vision Extraction: Interception via Telegram Webhook. Binary payload is passed to Google Gemini vision configured with temperature=0 and a strict JSON prompt contract (merchant_name, amount, date). 2. Expense Audit Logging: Parsed JSON data is automatically appended to a central expense tracking table in Google Sheets. 3. Binary State Bridging & Drive Archival: Searches Google Drive for a date-partitioned folder ("YYYY-MM-DD"). If missing, provisions the folder on demand. Uses an Edit Fields node to re-attach binary context across conditional branches, uploading receipts as timestamped files ("receipt_YYYY-MM-DD_HHmmss.ext").

Challenges

Solving binary payload state loss when branching across n8n conditional (If) nodes. Solved by implementing an Edit Fields bridge node to re-attach binary payload streams before Google Drive upload.

Learnings

Gained deep expertise in n8n binary data manipulation, Google Gemini multimodal vision zero-temperature prompt structuring, and idempotent cloud storage folder provisioning.

What I'd Do Differently

Temperature 0 makes the extraction deterministic, not correct. A blurry or folded receipt still returns confidently wrong values that land straight in the expense sheet with nothing flagging them. I would add a validation pass — does the amount parse, is the date plausible, does the merchant string look like a name — and push failures to a review queue instead of the ledger. The binary-payload loss I fixed with an Edit Fields bridge node was also a symptom rather than the disease: I was branching before the upload, and restructuring the order would have removed the problem instead of working around it.

Development Journey

Phase 1: IngestionStep 1

Telegram Photo Webhook Ingestion

Receives image payloads directly from Telegram client messages.

Phase 2: Vision OCRStep 2

Gemini Multimodal Data Extraction

Extracts merchant name, transaction date, and total amount with zero-temperature JSON enforcement.

Phase 3: Audit LoggingStep 3

Google Sheets Expense Logging

Parses JSON output and appends structured rows into expense ledger.

Phase 4: Cloud StorageStep 4

Idempotent Drive Archival & Binary Bridge

Re-attaches binary data via Edit Fields node and uploads timestamped receipt file into daily Drive folder.

    Meshary AI

    Gemini 2.5 Flash

    Portfolio Assistant

    Hello! I'm Meshary AI, your interactive portfolio assistant powered by Gemini. Ask me anything about Meshary's software projects, n8n automation workflows, or technical skills!

    12:33 PM