Telegram AI Image Generator and Logger - n8n Workflow

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.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Automation specialists looking for advanced n8n templates and integrations.

  • Developers wanting to create interactive AI bots using Telegram and n8n.

  • Teams needing a centralized, documented log of all AI image generation requests.

  • Users interested in demonstrating complex automated responses using an n8n node sequence.

Overview

This sophisticated automation provides a seamless and documented way to interact with OpenAI’s DALL-E model directly through a Telegram interface. When a user sends a prompt, the n8n workflow immediately captures the request. It addresses the challenge of providing instant, custom AI output while maintaining a detailed record of usage.

This specific n8n workflow not only generates the image but also ensures data persistence by logging the generated image URL and the revised prompt into a Google Sheet. Utilizing this n8n template saves time and provides valuable accountability for AI resource usage. Every n8n node is configured for maximum efficiency, offering a robust solution built entirely within n8n.

How it Works

The entire process is a three-step automated sequence initiated by a single n8n trigger:


  1. The n8n Trigger (Telegram Trigger): The n8n workflow starts here. This special n8n trigger constantly monitors a specified Telegram bot for new messages. When a message containing an image generation request is received, the n8n trigger activates the subsequent steps.

  2. AI Generation (OpenAI n8n node): The message text is passed directly to the OpenAI n8n node. This n8n node uses DALL-E to generate a 1024x1024 image based on the user's input, returning a temporary URL for the resulting image. This is a crucial step in the n8n workflow.

  3. Data Logging (Google Sheets n8n node): The output from the OpenAI n8n node (specifically the image URL and the revised prompt) is routed to the Google Sheets n8n node. This step appends a new row to a designated spreadsheet, ensuring that all generated content is logged. This crucial step showcases the versatility of the n8n workflow for data management.

  4. User Response (Telegram n8n node): Finally, the n8n workflow executes the Telegram n8n node. This final n8n node uses the generated image URL and sends the photo back to the original Telegram chat ID, completing the loop and delivering the requested image instantaneously via the automated n8n setup.

Installation Guide


  1. Import the n8n workflow: Copy the provided JSON and import it directly into your n8n instance.

  2. Set up Credentials: You will need three credentials set up for this n8n workflow:

Telegram API: Configure your Telegram Bot token in the Telegram n8n trigger and Telegram n8n node.
OpenAI API: Add your OpenAI API Key credentials for the OpenAI n8n node.
* Google Sheets OAuth2: Authenticate with Google Sheets and ensure the service account has write access to your desired spreadsheet.

  1. Configure Google Sheets n8n node: Update the Document ID and Sheet Name within the Google Sheets n8n node to point to your specific logging spreadsheet.

  2. Activate the n8n workflow: Switch the n8n workflow to 'Active' to start listening for Telegram messages.

Node Details

Telegram Trigger
Function: Acts as the starting n8n trigger, initiating the automation when a new message is received.
Key Configuration: Listens for message updates.
OpenAI n8n node
Function: Generates an image using the DALL-E model based on the user's message text.
Key Configuration: Resource: Image; Prompt: {{ $json.message.text }}; Size: 1024x1024; Return Image Urls: true.
Google Sheets n8n node
Function: Logs the generated image metadata (URL and prompt) into a specified spreadsheet.
Key Configuration: Operation: Append; Maps Image URL ({{ $json.url }}) to 'Image title' and Revised Prompt ({{ $json.revised_prompt }}) to 'Image description'.
Telegram n8n node
Function: Sends the generated image back to the user via Telegram.
Key Configuration: Operation: sendPhoto; Uses the dynamically retrieved Chat ID from the initial Telegram n8n trigger and the generated Image URL as the file source.

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all
Created by
David Olusola
David Olusola

AI automation consultant working with ambitious businesses on their most complex operational challenges. For project inquiries, reach me at [email protected]

Featured*