Telegram Ingredient Analysis Bot with Gemini OCR - n8n Workflow

Deploy an automated Telegram bot using this n8n workflow template. Analyze product ingredient photos instantly with Google Gemini AI for health and safety advice.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Health and Safety Content Creators needing rapid ingredient vetting.

  • Developers looking for advanced AI-powered n8n templates integrating vision models.

  • Consumers who want instant analysis of food, cosmetic, or cleaning product labels.

  • Users looking to build interactive Telegram bots powered by the n8n trigger system.

Overview

This powerful n8n workflow solves the tedious problem of manually researching product ingredient lists. By leveraging the visual capabilities of Google Gemini 2.5 Flash, the automation allows users to simply snap a picture of a product label and send it to a Telegram bot. The core value of this n8n template lies in its intelligent routing: if the user provides context (a caption, e.g., 'for sensitive skin'), the AI provides a fast 'Use/Do Not Use' verdict. If no context is provided, it generates a comprehensive, structured analysis covering advantages, disadvantages, and suitability. This end-to-end integration demonstrates the power of using a sophisticated n8n node combination for real-time customer feedback and analysis.

How it Works

The process initiates with the Get a Message photo/text n8n trigger, which listens for incoming Telegram messages.


  1. Input Check: The Checks if message contains photo n8n node determines the flow path. If a photo is present, the workflow proceeds to image processing.

  2. Image Processing: The Retrieves photo file from Telegram node downloads the image. The Analyzes product images using Google Gemini n8n node uses Gemini 2.5 Flash (via the LangChain integration) to perform Optical Character Recognition (OCR), extracting a clean list of ingredients from the product label.

  3. Contextual Routing: The Routes based on caption presence Switch node then checks if the initial message included a caption.

Contextual Analysis (Caption Exists): The workflow proceeds to the Analyzes ingredients with user caption LangChain Agent. This n8n node combines the extracted ingredients with the user's caption to produce a concise, structured JSON output (Recommendation and Reason) using a dedicated Structured Output Parser before sending the verdict via Telegram.
Detailed Analysis (No Caption): The workflow executes the Analyzes ingredients without caption LangChain Agent. This path generates a detailed, four-part analysis (Advantages, Disadvantages, Recommended For, Not Recommended For), structured meticulously for clear reporting, before being formatted and sent via the final Telegram n8n node.

  1. Text Handling (No Photo): If no photo is detected by the initial n8n node check, the flow moves to the Handles text messages and greetings AI Agent, which manages conversational input, offers redirection, or analyzes raw ingredient text provided by the user.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON data and paste it into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Telegram Credentials: Set up credentials for the Telegram n8n trigger and action nodes (PFSwgv89YFhycXc3). You will need a Telegram Bot Token. Activate the workflow to generate the webhook URL required for your Telegram bot setup.

  3. Google Gemini Credentials: Configure the Google Gemini (PaLM) API credentials (CLs7gtUQzHCSgvqQ) required for the vision and chat models (used by the LangChain n8n node agents).

  4. Activate the n8n Trigger: Ensure the Get a Message photo/text n8n trigger is active to start listening for incoming messages.

Node Details

Get a Message photo/text (Telegram Trigger): The initiating n8n trigger. Configured to listen for all message updates, including photos and text, starting the entire n8n workflow.
Checks if message contains photo (If): A core logic n8n node that checks for the existence of file_id in the message's photo array to route the automation correctly.
Analyzes product images using Google Gemini (LangChain GoogleGemini): This critical n8n node utilizes the gemini-2.5-flash model to analyze the binary image data and extract only the ingredient list, demonstrating powerful AI integration within the n8n workflow.
Routes based on caption presence (Switch): Routes the workflow based on whether the user provided a descriptive caption with the photo, enabling two distinct analytical responses.
Analyzes ingredients with user caption (Use/Do Not Use decision) (LangChain Agent): An advanced n8n node that combines text and context (caption) using a defined system message to deliver a specific 'Use' or 'Do Not Use' recommendation.
Structured Output Parser (LangChain): Ensures the AI Agent's output conforms strictly to the expected JSON schema (e.g., {"recommendation": "Use", "reason": "..."}), vital for predictable data flow in the n8n workflow.
Handles text messages and greetings (LangChain Agent): Manages all non-photo input, responding conversationally, analyzing user-provided ingredient lists, or politely redirecting off-topic inquiries. This makes the overall n8n template very robust.
Sends Use/Do Not Use recommendation & Sends detailed ingredient analysis (Telegram): These final n8n node actions send the AI-generated results back to the user's Telegram chat ID, completing the loop of this powerful n8n workflow.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

I build smart and scalable automation workflows using n8n to simplify tasks, connect apps, and boost productivity. From WhatsApp bots to AI-powered systems, I create seamless automations tailored for business and creators.

Featured*