Midjourney AI Image Generator via Telegram Chatbot - n8n Workflow

Use this powerful n8n workflow to turn Telegram prompts into high-quality Midjourney images via the GoAPI service. Features status polling and interactive upscaling using the n8n node for Telegram.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Technical users or developers who want to expose AI generation capabilities (like Midjourney) via a secure chatbot interface.

  • Automation specialists seeking complex examples of polling logic within an n8n workflow.

  • Anyone needing robust, interactive n8n templates for generative AI services.

  • Teams requiring logging and auditing of generated assets (via Discord integration).

Overview

This comprehensive n8n workflow transforms your Telegram bot into an interactive Midjourney image generation service, leveraging the GoAPI platform. The complexity of AI image generation—which is asynchronous and requires status checks—is handled seamlessly by the core logic flow control of the n8n node structure.

Instead of making the user wait, this n8n workflow initiates the task, notifies the user, and then uses a polling mechanism to monitor job completion. Crucially, after the initial 4-grid image is generated, the n8n workflow uses an interactive Telegram n8n node to prompt the user to select which image index (1-4) they wish to upscale, creating a truly conversational AI experience. This highly optimized n8n template saves significant time by integrating API calls, flow control, and user interaction into one cohesive automation.

How it Works

The entire process is initiated by the Telegram n8n trigger when a user sends a message to the configured bot.


  1. Trigger and Validation: The Telegram n8n trigger receives the message. An IF n8n node (Get Prompt) verifies the sender's username against a whitelist and ensures the message is a valid prompt (not just /start).

  2. Data Preparation: The Task n8n node extracts the user's prompt and session ID (username) for use in subsequent steps.

  3. Image Generation Request: The Generate Image n8n node sends an HTTP POST request to the GoAPI endpoint, requesting a Midjourney imagine task using the user's prompt.

  4. Notification & Polling: The user receives a 'Generating Image' notification via a Telegram n8n node. The n8n workflow then enters a polling loop using the Wait n8n node and the Get Generation Task HTTP n8n node, repeatedly checking the task status until the result is reported as 'completed'.

  5. Interactive Upscale Selection: Once the 4-grid image is ready, the Get Index to Upscale Telegram n8n node sends the image URL back to the user and requests them to input an 'Image Index' using a custom form interaction feature.

  6. Upscale Request: The Upscale HTTP Request n8n node initiates a new GoAPI task to upscale the selected image index from the original task ID.

  7. Upscale Polling: The process repeats with the Wait1 n8n node and Get Upscale Task HTTP n8n node, polling until the upscaling process is complete.

  8. Final Delivery & Logging: The final upscaled image URL is sent back to the user via the Main Log Telegram n8n node, concluding the user interaction. Optionally, a Discord - Generation Log n8n node archives the details and all generated image URLs for internal tracking.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON into your n8n instance using the 'Import Workflow' function.

  2. Telegram Credentials: You must create a Telegram bot and obtain its API token. Update the Telegram Trigger n8n node and all subsequent Telegram n8n nodes (Notify Generation, Get Index to Upscale, etc.) with your Telegram API credential.

  3. GoAPI Credentials: Sign up for GoAPI and retrieve your API Key. This key is used for the generic HTTP Header Authentication. Update the credentials in all three HTTP Request n8n nodes (Generate Image, Upscale, Get Upscale Task, etc.).

  4. User Whitelisting: Update the Get Prompt IF n8n node configuration to replace the placeholder username with the actual Telegram username(s) authorized to use the generator.

  5. Discord Setup (Optional): If you wish to use the logging feature, update the Discord - Generation Log n8n node with your Discord Bot credentials, along with the desired Guild ID and Channel ID.

  6. Activation: Once all credentials are set, activate the n8n workflow to start listening for messages.

Node Details

Telegram Trigger (n8n trigger): Initiates the n8n workflow upon receiving a Telegram message update.
Get Prompt (If n8n node): Essential core logic flow control. Filters incoming requests, ensuring only authorized users (via username check) and non-command messages proceed, preventing unnecessary API calls.
Generate Image (HTTP Request n8n node): Sends the initial API call to GoAPI to request a Midjourney 'imagine' task, configuring parameters like aspectratio (set to 12:16).
Notify Generation / Notify Upscaling (Telegram n8n node): Provides immediate feedback to the user, enhancing the chatbot experience.
Get Generation Task / Get Upscale Task (HTTP Request n8n node): These nodes perform the critical polling function, querying the GoAPI status endpoint using the previously received taskid to determine when the AI job is complete.
Status = complete / Get Upscale (If n8n node): These nodes contain the core logic flow control for the polling loop, redirecting the workflow to the Wait n8n node if the status is not 'completed'.
Get Index to Upscale (Telegram n8n node): A specialized Telegram n8n node configured for sendAndWait with a customForm. This enables interactive data capture, asking the user for the 1-4 index they wish to upscale after seeing the image grid.
Upscale (HTTP Request n8n node): Sends the second API call to GoAPI, initiating the upscaling task based on the user's interactive input.


  • Discord - Generation Log (Discord n8n node): Used for archival, logging the full resolution and temporary image links to a defined Discord channel.

Related n8n Workflows

Free

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

IT Professional & Freelance Automation Consultant specializing in AI-driven automation and business process optimization

Featured*