n8nflow.net logo

Create a Searchable Document Archive with Telegram, Drive, OCR and Airtable

by Oneclick AI Squad•Updated: Last update 2 days ago•Source: n8n.io
Loading workflow viewer...

Getting Started

This n8n workflow receives files sent in a Telegram chat, uploads them to Google Drive, extracts text using OCR (for images and PDFs), and stores the extracted content in Airtable for quick search and retrieval.
Users can later search through documents using a Telegram /search command.

Key Features

  • Accepts images and documents from Telegram
  • Uploads files to Google Drive automatically
  • Detects file type and runs OCR if eligible
  • Extracts text from images & PDFs via Google Vision
  • Stores file metadata + text in Airtable
  • Search documents using /search command in Telegram
  • Sends result previews and file links
  • Error handling & user notifications included

Use Cases

  • Personal document vault with search
  • Team knowledge filing system
  • Receipt & invoice OCR archive
  • Legal documents store & retrieval
  • Research papers & notes indexing
  • Company file inbox for AI knowledge base

Workflow Steps

StepActionDescription
1Telegram TriggerDetects incoming docs/images or /search command
2Filter File or SearchRoutes based on whether message has file or search command
3Extract MetadataReads file info such as name, MIME type, user
4Download FileDownloads file via Telegram API
5Upload to DriveSaves file in Google Drive
6OCR CheckDetermines if file supports OCR
7Google OCRRuns OCR for images/PDFs
8Extract TextPulls text output from OCR
9Merge OCR TextCombines file data + text
10Save to AirtableIndexes with metadata + text
11Success ReplySends link + success message
12/search FlowParse search query
13Airtable SearchFull-text search for records
14Send ResultsSends matches to Telegram
15Error HandlerNotifies user on failure

Input Formats

File Messages Supported

  • Images
  • PDFs
  • Documents

Search Command

/search keyword

Example:

/search invoice

Output

After Upload:

āœ… File saved & indexed successfully!
šŸ”— Drive Link: <link>

After Search:

Returns structured result:

  • File name
  • Preview text snippet
  • Google Drive link

Data Stored in Airtable

FieldDescription
File NameOriginal name
File LinkGoogle Drive link
MIME TypeFile type
Telegram UserSender info
OCR TextExtracted searchable text
Uploaded DateTimestamp

Technical Requirements

  • Telegram Bot Token
  • Google Drive API connection
  • Google Vision API key
  • Airtable API key & table

Benefits

  • Automatically organizes Telegram files
  • Makes PDFs & images searchable
  • Saves manual sorting and indexing time
  • AI-ready data storage (future LLM integration)
  • Fast search experience right in Telegram

Enhancement Ideas

  • Add Whisper for voice message transcription
  • Add chat GPT summarization for large docs
  • Build dashboard for uploaded files
  • Auto-tag documents (invoice, ID, receipt etc.)
  • Multi-language OCR support

Status

āœ… Ready for production
āœ… Handles images, PDFs, and files
āœ… End-to-end automation
šŸ›  Optional: add more AI enrichment later