Automate Image Analysis & Response on Telegram with n8n

This workflow automates image analysis for Telegram messages using n8n and OpenAI. It identifies if an image is present, analyzes it, and sends insightful text responses back, saving time and improving interaction accuracy on Telegram.
telegramTrigger
telegram
openAi
+3
Workflow Identifier: 1841
NODES in Use: Telegram Trigger, Telegram, Sticky Note, Wait, OpenAI (Langchain), Switch

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow watches Telegram chats and reacts when someone sends an image.

It checks if the message has a photo and stops if it does not.

If an image is present, it sends the photo to OpenAI to analyze and describe it.

Then it sends back a message with the analysis to the same Telegram chat.

If no image is found, it tells the user to upload a valid photo.


Who should use this workflow

This is for people managing Telegram groups or chats where members share pictures.

If manual image checking wastes time or causes errors, this helps by automating image understanding.

No technical experience is needed to run it inside n8n.


Tools and Services Used

  • Telegram Bot API: Receives messages and photos from users.
  • OpenAI API (Langchain Image node): Analyzes photos sent by users.
  • n8n Automation Platform: Orchestrates the workflow nodes and logic.

Inputs, Processing, and Outputs

Inputs

  • Incoming Telegram messages containing user photos.

Processing Steps

  • The Telegram Trigger node listens for new messages.
  • A Switch node checks if the incoming message contains a photo.
  • If no photo, a Wait node delays briefly, then a Telegram message node tells the user to upload an image.
  • If photo exists, the OpenAI Image Analyze node receives the photo in base64 format.
  • OpenAI returns descriptive analysis of the image content.
  • A Telegram message node sends the analysis back to the chat.

Outputs

  • Text replies in Telegram chats that describe and analyze the images sent by users.
  • Error messages prompting users to upload valid images when needed.

Beginner step-by-step: How to build this in n8n

Import the workflow

  1. Download this workflow file using the Download button on this page.
  2. Open your n8n editor.
  3. Use the menu option “Import from File” and upload the downloaded workflow.

Configure credentials and settings

  1. Add your Telegram API credentials in the Telegram nodes.
  2. Insert your OpenAI API key in the OpenAI node credentials.
  3. Verify that the Telegram Trigger node has correct permissions to get images.
  4. Check if IDs like chat IDs, user IDs, or message fields match your Telegram setup; update them if needed.

Test and activate

  1. Send an image to your Telegram bot or account to test if the workflow triggers.
  2. Watch the execution and confirm the reply message with the image analysis arrives.
  3. Turn the workflow from draft to active mode in n8n to start using it live.

For hosting the workflow long term, consider using self-host n8n for better control and uptime.


Handling edge cases and failures

If the workflow says “No image found in the message,” the Switch node could be checking for the wrong field or the Telegram Trigger lacks the download permission.

Check the Switch node condition uses {{$json.message.photo}} properly.

If OpenAI gives an error or no useful text, make sure the image is correctly downloaded and base64 encoded.

Verify OpenAI API key is valid and API usage limits are not exceeded.


Customization ideas

  • Change the error reply text in the Telegram message node to fit the chat’s style.
  • Add more rules in the Switch node to check for captions or other media types.
  • Introduce a language detection node to translate or adjust prompts dynamically.
  • Save image analysis results in databases like Google Sheets for history and review.
  • Try swapping OpenAI with other AI services if preferred.

Summary of benefits

✓ Saves many hours by automating image reading and replying.

✓ Reduces mistakes from manual image understanding.

✓ Keeps Telegram conversations faster and more helpful.

✓ Simple to set up inside n8n with little coding.


Frequently Asked Questions

The workflow sends a message asking the user to upload an image after a short wait.
It sends the photo in base64 format to OpenAI’s image analysis API and gets descriptive text back.
Yes, every image analysis request uses OpenAI API credits based on account pricing.
No, it only checks for photos. Extra nodes and models are needed for videos or GIFs.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free