Automated Image Analysis Workflow with Telegram & OpenAI

Facing challenges with quickly analyzing images sent via Telegram? This workflow automates image reception, analyzes them using OpenAI, and sends back insights instantly to Telegram chats, saving you time and effort.
telegramTrigger
switch
openAi
+2
Workflow Identifier: 1874
NODES in Use: Telegram Trigger, Telegram, Switch, Wait, OpenAI
Automate image analysis with n8n and OpenAI

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

Learn how to Build this Workflow with AI:

What This Workflow Does ⚙️

This workflow watches for photos sent in a Telegram chat. It takes each photo, changes it into base64 format, and sends it to OpenAI for analysis. Then, it sends back a simple text message explaining what the image is about. If there is no photo, it waits 3 seconds before asking the user to upload one.

The main problem it solves is saving time by automating image checks and replies in Telegram. Users get quick feedback without waiting for manual reviews.

This workflow runs automatically and never misses when an image is sent. It splits messages with and without photos to do the right action.


Tools and Services Used


Inputs → Processing Steps → Output

Inputs

  • Photos sent as Telegram messages.
  • Non-photo messages triggering error response.

Processing Steps

  • Telegram Trigger node listens for all incoming messages and downloads images.
  • Switch node checks if the message includes a photo.
  • OpenAI node takes base64 photo and generates a text summary.
  • Telegram Send Message node replies with the image analysis.
  • If no photo, Wait node delays response by 3 seconds, then Telegram node sends error prompt.

Output

  • Instant text messages describing uploaded images.
  • Polite prompts asking for a photo when none is sent.

Beginner Step-by-Step: How to Use this Workflow in n8n

1. Import Workflow File

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor and click “Import from File”.
  3. Select the workflow file to load it.

2. Configure Credentials and IDs

  1. Add Telegram and OpenAI API Keys in the Credentials section.
  2. Check if the Chat ID or other specific IDs match your Telegram chat.
  3. Update any other settings like emails or folder IDs if used.

3. Test the Workflow

  1. Send a test image to your Telegram bot or group.
  2. Ensure the workflow triggers and you get a reply with the analysis.

4. Activate Workflow for Production

  1. Toggle the workflow switch ON to start live operation.
  2. Monitor for errors in logs and fix if needed.
  3. Consider self-host n8n for better control if not using cloud.

Edge Cases and Failure Handling

  • If a message has no photo, the Switch node routes it to a Wait node which pauses 3 seconds.
  • After waiting, a Telegram node sends “Please Upload an Image” message to keep users polite but informed.
  • If the image data is missing, common cause is Telegram Trigger lacking the download setting.
  • Incorrect expressions for extracting Chat ID cause failures in sending replies.
  • OpenAI errors often arise from API key problems or bad base64 input.

Customization Ideas ✏️

  • Edit the Telegram reply message to add greetings or instructions.
  • Change Wait node timing for longer or shorter delays on error prompts.
  • Expand OpenAI image analysis to use more detailed prompts.
  • Add a Google Sheets node to save analysis results for review or training.
  • Adjust Switch node rules to detect videos or other media.

Pre-Production Checklist ✅

  • Ensure Telegram and OpenAI API Keys are connected and have permissions.
  • Test Telegram bot receives images and triggers workflow.
  • Verify Switch node properly routes messages with and without photos.
  • Confirm OpenAI returns expected text analysis.
  • Test reply messages go to correct Telegram chats.
  • Backup the workflow in n8n before changes.

Deployment Guide

Turn ON the workflow in n8n after successful tests.

Watch workflow logs for any unexpected errors.

Scale up OpenAI plan and n8n hosting if message traffic grows.


Summary

✓ Saves time by automating photo analysis in Telegram.

✓ Gives instant explanations of images for users.

✓ Handles cases without images politely.

✓ Runs without manual checks or delays.

→ Helps speed replies and improve group engagement.


Automate image analysis with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The error happens if the Download option is not enabled in the Telegram Trigger node, so the image is not saved.
Check the Chat ID expression and ensure Telegram API credentials are correctly set and active.
Errors occur if the OpenAI API key is wrong or the input image is not base64 encoded as required.
No, this workflow uses Telegram nodes only. WhatsApp integration needs different triggers and send actions.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.