Use this powerful n8n workflow to create a smart Telegram bot that routes messages: images for GPT-4o-Mini/NVIDIA Vila analysis, or text for Stable Diffusion 3 image generation.
Download this n8n workflow template and start using it instantly.
Developers looking to deploy multimodal AI services via a chat interface.
Content creators needing quick image generation or analysis from text prompts.
Researchers requiring automated, dual-path processing (Image-to-Text and Text-to-Image).
Users seeking powerful n8n templates for integrating OpenAI and NVIDIA APIs.
This robust n8n workflow acts as a sophisticated content router for a Telegram bot, demonstrating the power of integrating multiple AI services. It solves the challenge of handling complex, multimodal user inputs (images and text) seamlessly within a single automation pipeline. Utilizing a dynamic n8n node structure, this solution ensures users can interact naturally: sending images for detailed descriptions or text prompts for stunning visual creations using cutting-edge models like GPT-4o-Mini and Stable Diffusion 3. The entire process, from the initial n8n trigger to the final email report, is fully automated. This is a highly valuable addition to any collection of advanced n8n templates, showcasing how to efficiently manage complex branching logic.
The automation begins with the Telegram n8n trigger, which listens for new messages.
📱 Telegram Trigger n8n node captures the message. The subsequent Code n8n node, 📋 Extract Message Data, parses the input to determine the contentType (image or text) and extracts essential IDs (like photoFileId and chatId).🔀 Route by Content Type - Image or Text Switch n8n node directs the flow based on the content type.📸 Get Image file from Telegram n8n node downloads the file. The image is then simultaneously analyzed by two separate vision APIs: Analyze image using GPT-4O-Mini and HTTP Nvidia Vila (using NVIDIA's VILA model). The results are combined using the 🔀 Merge AI Results n8n node.Get Text from Telegram). The text is then passed to the NVIDIA API NVIDIA Stable Diffusion 3 n8n node for image generation.Convert to Binary File Code n8n node.To set up this powerful n8n workflow, follow these steps:
📱 Telegram Trigger n8n node using your Bot token. Ensure the webhook is active.Analyze image using GPT-4O-Mini n8n node (requires GPT-4o access).HTTP Nvidia Vila and NVIDIA API NVIDIA Stable Diffusion 3 n8n node to access the NVIDIA AI APIs. 📱 Telegram Trigger: This n8n trigger is the starting point, configured to listen specifically for 'message' updates from the linked Telegram Bot.
📋 Extract Message Data (Code): A critical n8n node that uses custom JavaScript to normalize the incoming message, determine if it contains an 'image' or 'text', and extract necessary file and chat IDs.
🔀 Route by Content Type - Image or Text (Switch): This Switch n8n node is the core flow control, routing items based on the contentType extracted in the previous step, allowing for two distinct AI processes within one n8n workflow.
Analyze image using GPT-4O-Mini (OpenAI n8n node): Utilizes the LangChain compatible OpenAI n8n node to analyze the downloaded image file, providing a detailed description using GPT-4o-mini's vision capabilities.
HTTP Nvidia Vila: Custom HTTP Request n8n node configured to call the NVIDIA VILA model for an alternative or supplementary image analysis.
NVIDIA API NVIDIA Stable Diffusion 3 (HTTP Request): Configured as a POST request to generate an image based on the text prompt found in the Telegram message. It defines parameters like cfgscale and aspectratio.
Convert to Binary File (Code): This essential n8n node processes the base64 encoded image response from the Stable Diffusion 3 API, converting it into a binary file format that can be attached to the output email.
Send a message of image-to-text results / Send a message of text-to-image results (Gmail n8n nodes): These final n8n nodes deliver the processed results (AI descriptions or generated images) via email.
Deploy a persistent, context-aware AI chatbot using this advanced n8n workflow. Integrate Telegram and Supabase memory with the OpenAI Assistant API. Find robust n8n templates for context-aware bots.

Build an advanced, stateful Telegram bot using this n8n workflow template. Learn how to manage conversation state across multiple users and commands using n8n nodes and static data.

Find the best local restaurants instantly via Telegram. This n8n workflow uses a Telegram n8n trigger and SerpAPI to search Google Maps data, sort results by rating, and format a beautiful response.

Use this powerful n8n workflow to create a Telegram bot that extracts TikTok and LinkedIn profile data using Dumpling AI, transcribes voice messages, and automatically stores results in Google Sheets. Get started with n8n templates for data mining.

Secure your internal Telegram bots using this n8n workflow template. It manages user access by checking permissions against a database (like n8n Data Tables) before executing sensitive tasks.


Prof. Cheng Siong CHIN serves as Chair Professor in Intelligent Systems Modelling and Simulation in Newcastle University, Singapore. His academic credentials include an M.Sc. in Advanced Control and Systems Engineering from The University of Manchester and a Ph.D. in Robotics from Nanyang Technological University.







































