Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Finance, Invoices & Accounting

Finance, Invoices & Accounting

Log Telegram receipt photos to Google Sheets with Gemini expense extraction

Runs when a receipt is sent to a Telegram bot, uses Gemini to extract vendor, amount, date and category, saves confident entries to Google Sheets and asks users to confirm low-confidence ones.

What it does

## AI Receipt Processor ### How it works This workflow lets users send receipt photos or documents to a Telegram bot. Gemini extracts the vendor, amount, date, expense category, payment method, and confidence score. High-confidence expenses are saved directly to Google Sheets. Low-confidence expenses are stored temporarily in an n8n Data Table and the user is asked to confirm or change the category in Telegram. ### Requirements - Telegram bot credentials - Google Gemini credentials - Google Sheets credentials - an n8n Data Table named pending_expenses - a Google Sheet for storing expenses ### Setup steps 1. Connect Telegram credentials to the trigger and all Telegram nodes. 2. Connect Google Gemini credentials to both Gemini nodes and select a Gemini model. 3. Make a copy of the provided Expense template and select it in all three Google Sheets nodes - https://docs.google.com/spreadsheets/d/129ZEubOfaVA1pOjbVCb9GgZQXbC48XTGpH7Zve5hBU0/edit?usp=sharing 4. Map these Google Sheets columns: - Date - Vendor - Amount - Payment type - Expense Category 5. Create an n8n Data Table named pending_expenses with: - request_id — Number - resume_url — String - vendor — String - amount — Number - date — Date/Time - category — String - payment_method — String 6. Select this Data Table in all Data Table nodes. 7. If you are self-hosting n8n, ensure your instance is publicly reachable for Telegram updates and wait/resume URLs. 8. Activate the workflow and send a receipt photo or document to your Telegram bot. ### Customization You can customize the confidence threshold, Gemini extraction prompt, expense categories, Telegram messages, Google Sheets columns, and category confirmation buttons. The default confidence threshold is 0.65. The default categories are Food, Transport, Shopping, Services, and Other.

The steps

  1. Telegram Message Trigger
  2. Route by Telegram Input
  3. Download Telegram Photo
  4. Download Telegram Document
  5. Handle Unsupported Text Input
  6. Analyze Receipt Photo with Gemini
  7. Analyze Receipt Document with Gemini
  8. Parse Photo Analysis JSON
  9. Parse Document Analysis JSON
  10. Check Photo Analysis Confidence
  11. Check Document Analysis Confidence
  12. Append Photo Expense to Sheets
  13. Append Document Expense to Sheets
  14. Save Pending Expense to Data Table

28 steps in total.

Similar automations