Skip to main content

Generate AI images in Telegram with GPT-4o enhancement and Flux Pro

Workflow preview

Workflow preview
100%
Generate AI images in Telegram with GPT-4o enhancement and Flux Pro preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

AI Image Generator Bot — Telegram + AI/ML API This n8n workflow allows users to generate AI generated images by sending messages to a Telegram bot. Each request is logged in Google Sheets and li...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, n8n-nodes-base.googlesheets, n8n-nodes-base.aggregate, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.telegram, n8n-nodes-base.httprequest, n8n-nodes-aimlapi.aimlapi

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by AI/ML API | D1m7asis.

Original n8n.io source

1.1 Workflow description

Title
Generate AI images in Telegram with GPT-4o enhancement and Flux Pro
Workflow name
Generate AI images in Telegram with GPT-4o enhancement and Flux Pro

🧠 AI Image Generator Bot — Telegram + AI/ML API

This n8n workflow allows users to generate AI-generated images by sending messages to a Telegram bot. Each request is logged in Google Sheets and limited by a daily quota per user. Image prompts are enhanced by LLM before generation.


🚀 Features

  • 📩 Telegram-based input
  • 🧠 Prompt enhancement with GPT-4o
  • 🎨 AI image generation via flux-pro model (AIMLAPI)
  • 🖋 Auto-caption generation
  • 📊 Usage tracked per user daily in Google Sheets
  • 🔒 Daily request limits
  • ✅ Graceful UX for over-limit cases

🛠 Setup Guide

1. 📲 Create Telegram Bot

  • Talk to @BotFather
  • Use /newbot → Choose a name and username
  • Save the bot token

2. 🔐 Set Up Credentials in n8n

  • Telegram API: Use your bot token
  • Google Sheets: Set up via OAuth2 or Service Account
  • AI/ML API: Set up with your API key from aimlapi.com

3. 📗 Prepare Google Sheet

  • Name: Any (e.g., Image bot usage statistic)
  • Sheet: Sheet1
  • Columns:
 user_id | date | query | result_url
  • Share the sheet with the email of your service/OAuth2 account

4. 🔧 Configure the Workflow

  • Open the n8n editor and import the JSON

  • Update:

    • Telegram credential
    • Google Sheets credential and Sheet ID
    • AI/ML API credentials

⚙️ Flow Summary

Node Function
📩 Receive Telegram Message Triggered by user message
📊 Fetch Usage Logs Reads today's entries from Sheet
📈 Count Today’s Requests Counts how many generations today
🔢 Set Daily Limit Sets default limit (5)
🚦 Check Limit Exceeded? If over limit → notify
🧠 Enhance Prompt Uses GPT-4o to improve user's prompt
🎨 Generate Image Sends to AIMLAPI to generate
🖋 Describe Image Generates caption for the image
📤 Send Image to User Sends back to Telegram
📝 Log Successful Generation Writes to Google Sheets

📁 Data Logging

Each successful generation is stored in Google Sheets:

user_id date query result_url

💡 Example Prompt Flow

  1. User sends:

    astronaut cat floating in space
    
  2. Bot replies:

    > Here’s your image: > A majestic feline astronaut drifts through a glittering cosmic void, its helmet reflecting starlight.

  3. The image is sent with the caption


🔄 Daily Limit

  • Default: 5 generations/day per Telegram user
  • You can change this in the 🔢 Set Daily Limit node

🧪 Testing

  • Use /execute workflow in Telegram — not "Execute Node" in editor
  • Log test results to sheet
  • Add extra Set nodes for debugging as needed

📎 Resources

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - 📩 Receive Telegram Message

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 2 - 📊 Fetch Usage Logs

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 3 - 📈 Count Today’s Requests

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 4 - 🔢 Set Daily Limit

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - 🚦 Check Limit Exceeded?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 6 - 🚫 Notify: Limit Exceeded

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 7 - 📝 Log Successful Generation

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 8 - 🎨 Generate Image (AI/ML API | flux-pro)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - 🧠 Enhance Prompt (AI/ML API | GPT-4o)

Type / Role
n8n-nodes-aimlapi.aimlApi - aimlApi
Config choices
Version 1

Block 10 - 🖋 Describe Image (AI/ML API | GPT-4o)

Type / Role
n8n-nodes-aimlapi.aimlApi - aimlApi
Config choices
Version 1

Block 11 - 📤 Send Image to User

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 12 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note11

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Generate AI images in Telegram with GPT-4o enhancement and Flux Pro
Complexity advanced
Nodes 22
Categories Content Creation, Multimodal AI
Author AI/ML API | D1m7asis
Published 29 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6651/6651.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate AI images in Telegram with GPT-4o enhancement and Flux Pro do?

AI Image Generator Bot — Telegram + AI/ML API This n8n workflow allows users to generate AI generated images by sending messages to a Telegram bot. Each request is logged in Google Sheets and li...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.