OCR Receipt Data Extraction to Google Sheets - n8n Workflow

Automate receipt data entry using this powerful n8n workflow. Extract YAPE or general receipt details via Telegram OCR and instantly save them to Google Sheets using OpenAI.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Individuals and small businesses needing automated expense tracking.

  • Users who frequently receive digital receipts (like YAPE) and want to streamline data entry.

  • Developers looking for advanced examples of integrating Telegram, AI agents, and Google Sheets within an n8n workflow.

  • Anyone seeking ready-to-use n8n templates for OCR processing.

Overview

Managing expense receipts manually is time-consuming and prone to errors. This specialized n8n workflow provides a seamless, end-to-end solution for capturing, analyzing, and logging financial data. By simply sending a photo of a receipt via Telegram, the user initiates a powerful process. This n8n automation uses advanced OCR capabilities (via an OpenAI n8n node) to read the text, and then an AI Agent (powered by DeepSeek) structures that raw text into clean, usable data (date, vendor, amount). Finally, the structured data is logged immediately into a designated Google Sheet. This makes the n8n template an invaluable tool for financial management, ensuring high accuracy and instant logging without manual intervention.

How it Works

The entire process is initiated by the n8n trigger, the Telegram Listener, which monitors for new messages.


  1. Trigger and Classification: The Telegram Listener n8n trigger captures an incoming message. The workflow then uses a Switch n8n node to classify the input, determining if it is a command (like /start) or a photo receipt.

  2. Image Handling: If a photo is detected, a custom Code n8n node (🗂️Select Best Quality Image) ensures the highest resolution image attachment is selected for maximum OCR accuracy. The Telegram n8n node then downloads this high-quality receipt image.

  3. OCR Extraction: The downloaded image is passed to the OpenAI n8n node (📄 Extract Text with OCR), which uses vision capabilities to perform Optical Character Recognition, transforming the image content into raw text.

  4. AI Structuring: The raw text is fed into a Langchain Agent n8n node (🤖 AI Data Processor), which uses a specialized Language Model (🧠 AI Model for Processing) to parse the text and extract specific fields (e.g., total amount, transaction date, vendor name), outputting clean, structured data.

  5. Data Preparation and Storage: The Google Drive n8n node first ensures the target spreadsheet exists. A subsequent Code n8n node (🔄 Prepare Data for Insertion) prepares the AI-structured data payload for the spreadsheet. The Google Sheets n8n node then appends this new row of receipt data to the specified sheet.

  6. Confirmation: Finally, the Telegram n8n node sends a confirmation message back to the user, summarizing the extracted data and confirming that the entry was successful in Google Sheets.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON and paste it into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Telegram Bot Setup: Configure the '🛎️Telegram Listener' and all '✉️ Send' Telegram n8n node instances with your existing Telegram Bot credentials. Ensure the trigger webhook is correctly configured to listen for messages.

  3. OpenAI/AI Credential Setup: Configure the '📄 Extract Text with OCR' n8n node with your OpenAI API key, ensuring you use a model capable of vision (like GPT-4 Vision).

  4. Google Credentials: Set up credentials for the Google Drive and Google Sheets n8n nodes. You will need permissions to find and write to the target spreadsheet.

  5. Specify Sheet Details: In the '📑 Insert Data into Google Sheets' n8n node, input the exact Spreadsheet ID and Sheet Name where the receipt data should be logged.

  6. Activate: Save the n8n workflow and toggle it 'Active' to start listening for incoming receipt images on Telegram.

Node Details

🛎️Telegram Listener (n8n trigger): The starting point of the n8n workflow. It monitors for all incoming messages sent to the connected Telegram Bot.
🔀 Message Classifier (Switch n8n node): Routes the execution path based on the type of Telegram message received (command vs. image).
🗂️Select Best Quality Image (Code n8n node): Custom JavaScript n8n code used to iterate through the photo array provided by Telegram metadata and identify the file_id corresponding to the largest/highest-quality version of the receipt image.
🖼️Download High-Quality Image (Telegram n8n node): Downloads the actual image file content using the file ID extracted in the previous step, making it available for subsequent OCR processing.
📄 Extract Text with OCR (OpenAI n8n node): Takes the binary image data and uses an AI model (like GPT-4 Vision) to perform OCR, converting the receipt image into machine-readable text.
🤖 AI Data Processor (Langchain Agent n8n node): This crucial n8n node acts as an intelligent agent, utilizing the raw OCR text and prompt engineering to extract and structure key receipt details into a usable format.
🧠 AI Model for Processing (DeepSeek n8n node): Provides the underlying language model used by the AI Agent to perform the specialized data structuring tasks.
📑 Insert Data into Google Sheets (Google Sheets n8n node): The final action n8n node. It appends the clean, AI-verified receipt data as a new row in the designated Google Sheet, completing the automated logging process.

Related n8n Workflows

Paid

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

JASP402 | Developer Fullstack y QA Automation | Apasionado por la automatización con n8n. Creo workflows personalizados y eficientes para optimizar tus procesos. He desarrollado frameworks y librerías para potenciar la automatización. ¡Conecta conmigo para descubrir cómo puedo ayudarte!

Featured*