Create a Searchable Document Archive with Telegram, Drive, OCR and Airtable
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
| Step | Action | Description | | ---- | --------------------- | ---------------------------------------------------------- | | 1 | Telegram Trigger | Detects incoming docs/images or /search command | | 2 | Filter File or Search | Routes based on whether message has file or search command | | 3 | Extract Metadata | Reads file info such as name, MIME type, user | | 4 | Download File | Downloads file via Telegram API | | 5 | Upload to Drive | Saves file in Google Drive | | 6 | OCR Check | Determines if file supports OCR | | 7 | Google OCR | Runs OCR for images/PDFs | | 8 | Extract Text | Pulls text output from OCR | | 9 | Merge OCR Text | Combines file data + text | | 10 | Save to Airtable | Indexes with metadata + text | | 11 | Success Reply | Sends link + success message | | 12 | /search Flow | Parse search query | | 13 | Airtable Search | Full-text search for records | | 14 | Send Results | Sends matches to Telegram | | 15 | Error Handler | Notifies 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
| Field | Description | | ------------- | ------------------------- | | File Name | Original name | | File Link | Google Drive link | | MIME Type | File type | | Telegram User | Sender info | | OCR Text | Extracted searchable text | | Uploaded Date | Timestamp |
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
Related Templates
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
Send structured logs to BetterStack from any workflow using HTTP Request
Send structured logs to BetterStack from any workflow using HTTP Request Who is this for? This workflow is perfect for...
Automate Daily Keyword Research with Google Sheets, Suggest API & Custom Search
Who's it for This workflow is perfect for SEO specialists, marketers, bloggers, and content creators who want to automa...
š Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments