Use this advanced n8n workflow to build a powerful Telegram bot that generates AI images via Pollinations and structured blog articles using Google Gemini 2.5, logging all activity to Google Sheets.
Download this n8n workflow template and start using it instantly.
This comprehensive n8n workflow provides a robust solution for deploying a generative AI chatbot directly within Telegram. It addresses the need for structured, multi-step automation by integrating two powerful AI services: Pollinations for image generation and Google Gemini 2.5 for writing coherent blog articles. A critical feature of this n8n workflow is its state management system, which uses Google Sheets to log every user action, prompt, and output, ensuring data persistence across conversational steps (especially for the multi-part blog generation flow). This makes it an ideal reference for advanced n8n templates focused on maximizing AI utility through messaging platforms. By using the Telegram n8n trigger, the entire experience is seamless for the end-user.
This n8n workflow begins when the Telegram n8n trigger receives an update. The initial steps involve classifying the input type (Code n8n node) to route the request correctly.
/start (sends main menu), /help (sends instructions), or text inputs.image, the workflow sends a 'typing' action, then uses a Code n8n node to construct a request to Pollinations AI. An HTTP Request n8n node downloads the generated binary image. The Telegram n8n node sends the image back to the user. Concurrently, the image is uploaded to Google Drive and the prompt details are logged via a Google Sheets n8n node.blog, the initial title is captured and logged into Google Sheets. The workflow then prompts the user via a Telegram n8n node to select a preferred style (Formal, Relax, News) using inline keyboard buttons.Generate Article with Gemini n8n node (a LangChain Chat Model n8n node), which uses Gemini 2.5 Flash Lite to create a blog post structured as JSON. After parsing the JSON (Code n8n node), the final article is sent back to Telegram, and the resulting content is logged back into Google Sheets, completing the automated n8n workflow cycle.To deploy this powerful n8n workflow template, follow these steps:
Trigger Telegram Message n8n trigger and all subsequent Telegram nodes for communication.Gemini Chat Model n8n node to power the article generation.[your-token] and {YOUR-TOKEN} placeholders in the HTTP Request n8n nodes (used for chat actions and sending final articles) with your actual Telegram Bot Token. Trigger Telegram Message (n8n trigger): The initial entry point. Listens for both messages (text commands) and callback queries (button presses) from users.
Classify Telegram Input (Code n8n node): A custom JavaScript node that dynamically categorizes the incoming Telegram data (message, callback_query, text, style, help, etc.) to control flow.
Switch Input Type (Switch n8n node): Routes the workflow based on the category determined by the previous node.
Google Sheets (n8n node): This versatile node handles multiple operations: appending new prompts, updating existing rows with user style choices, retrieving the latest prompt, and finally updating rows with the generated content.
Build Image Generation URL (Code n8n node): Generates a dynamic Pollinations AI URL, including parameters for image dimensions and a random seed.
Download AI Image (HTTP Request n8n node): Fetches the AI image output as binary data, preparing it for Telegram submission and Google Drive archiving.
Upload Image to Google Drive (Google Drive n8n node): Stores the image output for historical tracking.
Generate Article with Gemini (Langchain n8n node): This core AI n8n node uses a structured prompt against Google Gemini 2.5 Flash Lite to produce a styled blog article in JSON format.
Parse Gemini Response (Code n8n node): Crucial for data integrity, this node strips markdown and converts the AI's JSON output into a usable data structure for the next steps in the n8n workflow.
Telegram / HTTP Request (Telegram n8n node): Used throughout the n8n workflow to send menus, ask follow-up questions (like article style selection), provide real-time feedback (typing actions), and deliver the final generated content.
Deploy this powerful n8n workflow to generate images using the OpenAI GPT-Image-1 model via a simple web form interface. Learn how this n8n automation handles API calls, file conversion, and user interaction.

Deploy this powerful n8n workflow to automate DALL-E image generation via Telegram prompts, instantly logging results to Google Sheets. Learn how this n8n template streamlines AI resource management.

Automate AI content generation using the monexia/nietgoed model via Replicate. This n8n workflow template includes crucial polling logic and error handling for asynchronous tasks.

Use this efficient n8n workflow to generate high-quality images and handle asynchronous polling using the Simbrams Ri AI model via Replicate. A reliable n8n template for complex AI tasks.

Automate high-quality image generation via Replicate's Flux models (e.g., flux-1.1-pro) and instantly publish the results to WordPress and X (Twitter) using this powerful n8n workflow. Ideal for content marketers.

Hi! I’m Fahmi Oktafian, a developer and automation enthusiast with expertise in n8n, Node.js, and API integrations. I specialize in building smart, scalable workflows — from auto-publishing content to WordPress, sending automated Telegram notifications, to processing AI-based summaries and paraphrase. I’m passionate about helping businesses save time, increase efficiency, and automate their digital processes with clean and user-friendly solutions.







































