Templates / Extract invoice data with Google Gemini, Google Sheets, and Telegram

Extract invoice data with Google Gemini, Google Sheets, and Telegram

Ready for 3.0

by Hồ Đình Huy ✓ · 178 views · created 2026-05-25 · Invoice Processing, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (8)

Google SheetsGoogle GeminiTelegram

What it does

Quick overview This workflow accepts invoice PDFs or images from an n8n Form or Telegram, uses Google Gemini to OCR and extract structured invoice fields and line items, appends the results to Google Sheets, and sends a success or rejection notification via Telegram. How it works 1. Receives an invoice file upload either from an n8n Form or from a Telegram bot message. 2. Validates that the incoming file exists and is a supported PDF or image format, otherwise prepares a rejection message. 3. Uploads the file to Google Gemini and routes it to Gemini document analysis for PDFs or image analysis for images. 4. Parses Gemini’s JSON response, normalizes dates and numeric fields, and ensures line items are present as an array. 5. Splits the extracted line items into rows and appends the invoice data to an Invoices worksheet in Google Sheets. 6. Builds a processing summary and sends a Telegram notification for success, or sends the prepared rejection message for invalid files. Setup 1. Add a Google Gemini (PaLM) API credential and select a Gemini model (for example, models/gemini-2.5-flash) in the Gemini nodes. 2. Add a Google Sheets OAuth2 credential and replace REPLACEWITHGOOGLESHEETID with your spreadsheet ID, ensuring an Invoices sheet exists. 3. Add a Telegram bot credential, set REPLACEWITHTELEGRAMCHATID, and (optionally) message your bot once so it can send you notifications. 4. If using the n8n Form entry point, open the form URL for the “invoice” path and use it as the upload page for PDF/image invoices.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.