🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Telegram + Gemini Vision: extract text from images

Lisa Granqvist Partner Workflow Automation Expert

Retyping text from screenshots is the kind of “small task” that quietly ruins your day. You lose a few minutes here, make a typo there, then waste more time fixing it in Slack, a doc, or a CRM.

This Telegram OCR automation hits marketers pulling ad copy, ops teams capturing receipts or labels, and consultants collecting notes from calls and workshops. You send an image to a Telegram bot, and you get clean, copyable text back in seconds.

Below, you’ll see exactly what the workflow does, how it’s wired, what you need to run it, and where teams usually trip up when they set it live.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Telegram + Gemini Vision: extract text from images

The Problem: Screenshots Trap Your Information

Screenshots are convenient until you need the text inside them. A teammate shares a pricing table as an image. A client sends “just a quick photo” of a form. You grab a snippet of ad copy from a swipe file on your phone. Now the information is stuck. You either retype it (slow), run it through a random OCR website (sketchy), or postpone it (and forget). The annoying part is the mental context switching: zooming in, copying line by line, fixing weird spacing, and hoping you didn’t swap a 0 for an O.

The friction compounds. It’s rarely one screenshot. It’s ten.

  • You end up spending about 10 minutes per image just to get usable text, especially when it’s small font or messy lighting.
  • Typos sneak into quotes, addresses, and product specs, which means follow-up messages and avoidable back-and-forth.
  • OCR websites often require uploads, and frankly that can be a compliance headache for client or internal documents.
  • Even when you extract the text, it’s not where you need it, so you still bounce between apps to share it.

The Solution: Telegram Bot OCR Powered by Gemini Vision

This workflow turns Telegram into your “send it here, get text back” inbox. When you message your bot with a screenshot or photo, n8n grabs the image file, converts it into a format the AI can read, and sends it to the Google Gemini Vision API for analysis. Gemini extracts the text it sees (including multi-line blocks like paragraphs, menus, or snippets of UI). Then n8n posts the results right back into the same Telegram chat, so the text is immediately copyable. No downloading, no retyping, no hunting for a tool you used three months ago.

The workflow starts the moment a new image hits your Telegram bot. It then retrieves the actual photo file, converts the binary content into the payload Gemini expects, and sends an HTTP request to Gemini Vision. Finally, it replies in Telegram with the extracted text so you can paste it anywhere.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you capture 15 screenshots a week: competitor ads, analytics callouts, and random “don’t forget this” notes. If you spend about 10 minutes per screenshot retyping and cleaning it up, that’s roughly 2.5 hours weekly. With this workflow, you forward each image to Telegram (maybe 30 seconds), then wait for the reply (often under a minute). Realistically, you get back about 2 hours a week, and the text is already ready to paste into a doc or message.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Telegram to receive images and return text.
  • Google Gemini Vision API for OCR and text extraction.
  • Gemini API key (get it from Google AI Studio).

Skill level: Beginner. You’ll paste in an API key and connect a Telegram bot, then test with a sample screenshot.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A Telegram image kicks things off. When someone sends your bot a photo or screenshot, the Telegram Trigger picks it up instantly and passes along the message metadata.

The workflow normalizes what came in. n8n cleans up the incoming fields so the next steps always know which file ID to request, even if Telegram’s payload shape varies a bit.

n8n retrieves and converts the image. It calls Telegram again to download the actual file, then converts the binary so it can be safely included in the request that Gemini Vision expects.

Gemini extracts text and Telegram receives the reply. An HTTP request sends the image to Gemini Vision, n8n pulls the extracted text from the response, and the final Telegram node sends that text back to your chat.

You can easily modify the outgoing message format to include line breaks, headings, or “copy blocks” based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Telegram Trigger

This workflow starts when a user sends a message with a photo to your Telegram bot.

  1. Add and open Telegram Intake Trigger.
  2. Set Updates to message.
  3. In Additional Fields, enable Download to true.
  4. Credential Required: Connect your telegramApi credentials.
  5. Save the node to generate the Telegram webhook.
Tip: Make sure your Telegram bot is started in Telegram; otherwise no updates will arrive.

Step 2: Connect Telegram and Normalize the Incoming Data

Normalize the incoming update to extract the chat ID and photo file ID for downstream nodes.

  1. Open Normalize Incoming Data and add two assignments.
  2. Set chatID to ={{ $json.message.chat.id }}.
  3. Set Image to ={{ $json["message"]["photo"][$json["message"]["photo"].length - 1]["file_id"] }}.
  4. Open Retrieve Photo File and set Resource to file.
  5. Set File ID to ={{ $json.Image.replace(/\n/g, '') }}.
  6. Credential Required: Connect your telegramApi credentials in Retrieve Photo File.
⚠️ Common Pitfall: If the incoming message has no photo, Normalize Incoming Data will return an empty file ID and Retrieve Photo File will fail.

Step 3: Set Up Image Conversion and OCR Request

Convert the downloaded photo to base64 data and send it to Gemini for OCR.

  1. Open Convert Binary to Data and set Operation to binaryToPropery.
  2. Open Gemini Text Extract and set Method to POST.
  3. Set URL to https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent.
  4. Set Specify Body to json and Send Body to true.
  5. Set JSON Body to ={ "contents": [ { "role": "user", "parts": [ { "inlineData": { "mimeType": "image/jpeg", "data": "{{ $json.data }}" } }, { "text": "Extract text" } ] } ] }.
  6. Credential Required: Connect your httpQueryAuth credentials in Gemini Text Extract.
Tip: If you send PNG images, change mimeType to image/png in the JSON body.

Step 4: Configure the Telegram Reply Output

Send the extracted text back to the original Telegram chat.

  1. Open Send Telegram Reply.
  2. Set Text to ={{ $json.output }}.
  3. Set Chat ID to ={{ $('Normalize Incoming Data').item.json.chatID }}.
  4. Credential Required: Connect your telegramApi credentials in Send Telegram Reply.

Step 5: Test and Activate Your Workflow

Validate that each node passes data correctly and the OCR response returns to Telegram.

  1. Click Execute Workflow and send a photo to your Telegram bot.
  2. Confirm the execution order: Telegram Intake TriggerNormalize Incoming DataRetrieve Photo FileConvert Binary to DataGemini Text ExtractSend Telegram Reply.
  3. Verify that Gemini Text Extract returns an output field and that Send Telegram Reply posts the text back to Telegram.
  4. When successful, toggle the workflow to Active to enable production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Telegram bot credentials can expire or get rotated. If replies suddenly stop, check the Telegram credentials inside n8n first, then confirm the bot still has permission to read incoming photos.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Gemini prompts and parsing matter more than people expect. If you want clean paragraphs (not a wall of text), adjust the request payload and add a little formatting logic before the Telegram reply.

Frequently Asked Questions

How long does it take to set up this Telegram OCR automation?

Less than 5 minutes if your bot and API key are ready.

Do I need coding skills to automate Telegram OCR?

No. You’ll connect Telegram, paste your Gemini API key, and run a test message to confirm it replies with text.

Is n8n free to use for this Telegram OCR automation workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Gemini API usage costs (often pennies for light OCR use).

Where can I host n8n to run this Telegram OCR automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this Telegram OCR automation workflow for PDFs or Google Drive uploads?

Yes, but you’ll swap the intake step. This workflow currently listens to Telegram images, then uses “Retrieve Photo File” and “Convert Binary to Data” before calling Gemini. You can replace the Telegram intake with a Google Drive trigger (new file) and keep the Gemini Text Extract step, as long as you still convert the file into the request format Gemini expects.

Why is my Telegram connection failing in this workflow?

Usually it’s a bad or rotated bot token saved in n8n. Update the Telegram credentials, then verify the bot is receiving messages (it won’t if privacy settings or chat context are wrong). Also check that the workflow is reading the right file ID after the “Normalize Incoming Data” step, because Telegram payloads can differ between photos and documents.

How many images can this Telegram OCR automation handle?

On n8n Cloud, it depends on your monthly execution limit; self-hosting has no fixed cap beyond your server. In practice, teams run this for dozens or hundreds of images a day without thinking about it, as long as you’re not hitting Telegram or Gemini rate limits. If you expect big spikes (like batch processing event photos), add simple throttling and error retries so messages don’t fail when multiple images arrive at once. The nice part is you can scale gradually: start with personal use, then roll it out to a shared team bot.

Is this Telegram OCR automation better than using Zapier or Make?

Often, yes, especially if you want control over formatting and retries. n8n is flexible when you need to fetch files, transform binary data, and make custom HTTP calls to Gemini, and it doesn’t punish you for adding logic. Zapier or Make can be quicker for simple prototypes, but OCR flows tend to get fiddly once you care about output quality. Talk to an automation expert if you want help choosing.

This is one of those automations you set up once and then wonder how you lived without it. Your screenshots stop being dead ends, and you get hours back over a normal month.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal