Templates / Auto invoice & receipt OCR to Google Sheets – Drive, Gmail, & Telegram triggers

Auto invoice & receipt OCR to Google Sheets – Drive, Gmail, & Telegram triggers

Ready for 3.0

by Daniel Ng ✓ · 4,945 views · created 2025-04-19 · 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.

Worth a look

Nodes used (12)

Google SheetsGoogle DriveTelegramGmail

What it does

The Best Invoice & Receipt OCR Automation - FREE (for a limited time) Automatically process invoices and receipts using Gemini OCR, extracting data directly into Google Sheets from multiple sources including Google Drive, Gmail, and Telegram. This powerful workflow ensures your bookkeeping is always accurate, organized, and efficient, significantly reducing manual effort and potential errors. !AutomateinvoiceOCRtoGoogleSheetsGeminin8nworkflowtemplatescreenshot2.jpeg(fileId:1150) Who is this for? This workflow is ideal for busy entrepreneurs, startup founders, freelancers, small business owners, bookkeepers, and accountants who aim to eliminate manual, repetitive, and error-prone bookkeeping tasks. Whether you regularly manage expenses from physical paper receipts, digital invoices, or email attachments, this workflow will dramatically streamline your bookkeeping processes and save you significant time and effort each month. What problem is this workflow solving? Manual data entry of invoices and receipts is notoriously tedious, incredibly time-consuming, and highly susceptible to human error. Mistakes in bookkeeping can lead to financial inaccuracies, compliance issues, and wasted resources. By automating the extraction of invoice data, this workflow streamlines your financial management process, significantly improves accuracy, reduces operational overhead, and allows you to redirect valuable resources and attention toward strategic, revenue-generating business activities. What this workflow does This template provides a powerful, automated solution for invoice and receipt data extraction using Google's Gemini API for OCR (Optical Character Recognition) via direct HTTP requests. 1. Main Flow (Google Drive Trigger): The main workflow triggers (Google Drive Trigger New Files) whenever a new file (PDF or image) is added to a designated Google Drive folder. It uses a SplitInBatches node (Loop Over Items) to process incoming files one by one. For each file, it: Downloads the file (Google Drive Get Receipt). Converts it to base64 (Move file to base64 string). Sends the file data and a detailed prompt to the Gemini API (gemini-2.0-flash model specified in the Prompt node, sent via the Gemini API HTTP Request node). The prompt requests structured JSON output with specific fields and formatting (like comma decimal separators, no currency symbols, and a dedicated currency field). Parses the JSON response (JSON to string, Parse string nodes). Appends the extracted data (Invoice Date, Category, Sender, Currency, etc.), along with the original filename and a link to the file, to a specified Google Sheet (Add to Google Sheets). Includes Wait nodes to help manage potential rate limits. 2. Supplementary flow 1 (Gmail Trigger): An additional trigger (Gmail Trigger) monitors your Gmail account for emails with a specific label. When a matching email with attachments arrives: It loops through emails and attachments. It renames the attachment using the format YYYY-MM-DDSenderUsername (e.g., 2025-04-19some.sender) using the Create File Name node. It saves the renamed attachment to the designated Google Drive folder (Google Drive Save Files), which then triggers the core OCR process above. 3. Supplementary Trigger 2 (Telegram Trigger): Another optional trigger (Telegram Trigger Image) allows you to forward photos of physical receipts to your configured Telegram bot: It renames the image file using the format YYYY-MM-DDTelegram (e.g., 2025-04-19Telegram) via the Create File Name For Telegram node. It saves the renamed image to the designated Google Drive folder (Google Save Files 2), also triggering the core OCR process. Setup 1. Credentials: Add the following credentials in n8n, using the names specified in the template or your own: Google OAuth2: For Google Drive, Google Sheets, Gmail. Telegram: For the Telegram bot trigger Gemini API Key: Obtain a free API key from Google AI Studio. You will need to paste this key directly into the Query Paramete

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.