Templates / Process Telegram invoice OCR with OCR.space, OpenAI, Sheets and Drive

Process Telegram invoice OCR with OCR.space, OpenAI, Sheets and Drive

Ready for 3.0

by theworkflowdev ✓ · 113 views · created 2026-06-14 · 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.

What this workflow does

This AI workflow has 16 nodes and runs on Telegram events (message). Along the way it connects Telegram, OpenAI Chat Model, Google Sheets and Google Drive. It also calls api.ocr.space over HTTP.

How it runs

Trigger: On Telegram events (message).

  1. Download Telegram Invoice File (Telegram): work with file
  2. Detect File Type (Code): runs custom JavaScript code
  3. Route Supported File Types (Switch): routes items into 3 branches
  4. Merge: merges the data from its input branches
  5. Extract Invoice Text with OCR.space (HTTP Request): calls api.ocr.space (POST)
  6. Upload Original Invoice to Google Drive (Google Drive): uses Google Drive
  7. Extract Structured Invoice Data (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Validate Invoice JSON Output
  8. Prepare Confirmation Message Data (Edit Fields (Set)): sets 2 fields: Invoice Detail, file
  9. Format Invoice Fields for Sheets (Code): runs custom JavaScript code
  10. Write Telegram Confirmation Message (AI Agent): runs an AI agent, with model: OpenAI Chat Model

…plus 3 more steps. See the full node list below.

Services it uses

TelegramOpenAI Chat ModelGoogle SheetsGoogle Drive

HTTP calls to: api.ocr.space

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (12)

From the author

Quick overview This workflow accepts invoice files via a Telegram bot, extracts text with OCR.space, uses OpenAI to turn the OCR output into structured invoice fields, appends the data to Google Sheets, archives the original file in Google Drive, and sends a…

Excerpt from theworkflowdev's description on n8n.io.

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.