Automated Image Text Extraction with Telegram and Gemini AI
detail.loadingPreview
This n8n workflow empowers you to effortlessly extract text from images using Google Gemini AI, all initiated directly from your Telegram app. Simply send an picture to your bot, and receive the digitized text back in seconds.
About This Workflow
Unlock the power of AI-driven Optical Character Recognition (OCR) directly from your favorite messaging app with this n8n workflow. Designed for efficiency, it seamlessly integrates Telegram as a user-friendly front-end with Google's advanced Gemini AI for robust text extraction. Upon receiving an image via Telegram, the workflow automatically downloads it, processes it through the Gemini model, and returns the extracted text to your chat. This eliminates manual typing, speeds up data capture, and provides an instant OCR solution accessible anytime, anywhere.
Key Features
- Instant Text Extraction: Quickly get text from any image sent to your Telegram bot.
- Gemini AI Powered OCR: Leverages Google's powerful Gemini AI for highly accurate character recognition.
- Seamless Telegram Integration: Interact directly through a Telegram bot for maximum convenience.
- Automated Workflow: From image upload to text delivery, the entire process is fully automated.
- Handles Various Image Types: Efficiently processes text from diverse image formats.
How To Use
- Telegram Trigger: Configure your Telegram Bot Token. Ensure the 'Download' option is checked in 'Additional Fields' to allow image downloads.
- Clean Input Data: This node automatically extracts the chat ID and the highest quality image's
file_idfrom the incoming Telegram message. No configuration is needed here. - get file (Telegram node): Use the same Telegram Bot Token credentials. This node will download the image file using the
file_idextracted earlier. - Extract from File: This node transforms the downloaded binary image data into a Base64 string, preparing it for the Gemini API. No specific settings are required.
- Gemini OCR (HTTP Request node):
- URL: Set to
https://generativelanguage.googleapis.com/v1beta/models/[YOUR_GEMINI_MODEL]:generateContent(e.g.,gemini-2.0-flash). - Authentication: Choose
Generic Credential Type, thenHTTP Query Auth. Create a new credential for your Gemini API key (obtained from Google AI Studio). - JSON Body: The provided JSON body sends the Base64 image data (from
{{ $json.data }}) and the prompt "Extract text" to Gemini.
- URL: Set to
- Telegram (Send Output): Connect with your Telegram Bot Token. The
textfield should be={{ $json.output }}to send back the text extracted by Gemini to the originalchatID.
Apps Used
Workflow JSON
{
"id": "ab47957c-b483-479d-aa6f-4d42399162ff",
"name": "Automated Image Text Extraction with Telegram and Gemini AI",
"nodes": 23,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: ab47957c-b483...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
Google Sheets to Icypeas: Automated Bulk Domain Scanning
This workflow streamlines the process of performing bulk domain scans by integrating your Google Sheets data directly with the Icypeas platform. Automate the submission of company names from your spreadsheet to Icypeas for comprehensive domain information, saving valuable time and effort.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.