AutomationFlowsSlack & Telegram › Midjourney Image Generator via Telegram and Goapi

Midjourney Image Generator via Telegram and Goapi

ByDhruv Dalsaniya @ddm21 on n8n.io

This workflow connects Telegram to Midjourney through GoAPI, enabling automated image generation and upscaling directly from chat.

Event trigger★★★★☆ complexity18 nodesTelegram TriggerHTTP RequestTelegramDiscord
Slack & Telegram Trigger: Event Nodes: 18 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #5097 — we link there as the canonical source.

This workflow follows the Discord → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "5vMPZ14K9UsUERpr",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "GOAPI - MJ Image Generator",
  "tags": [],
  "nodes": [
    {
      "id": "24695c33-e016-4df2-b31c-259c4dba4efe",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        60,
        165
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bc21ef50-c305-4f27-895d-019ecc5ec3f7",
      "name": "Task",
      "type": "n8n-nodes-base.set",
      "position": [
        500,
        165
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7a7bba3d-2761-44a9-97a1-c7ed9f849cfb",
              "name": "chatInput",
              "type": "string",
              "value": "={{ $json.message.text }}"
            },
            {
              "id": "2d103541-f87c-4780-acf1-43f0fb7a488a",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $json.message.from.username }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3ade84ce-e582-445b-b9aa-42b85d763d8a",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1600,
        265
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "309a8c7e-74e8-4e0b-9022-be9b524261d7",
      "name": "Generate Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        165
      ],
      "parameters": {
        "url": "https://api.goapi.ai/api/v1/task",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"midjourney\",\n  \"task_type\": \"imagine\",\n  \"input\": {\n    \"prompt\": \"{{ $json.chatInput }}\",\n    \"aspect_ratio\": \"12:16\",\n    \"process_mode\": \"fast\",\n    \"skip_prompt_check\": false,\n    \"bot_id\": 0\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dbbc2387-0d6e-4ef5-b777-b6a5d95db5ee",
      "name": "Upscale",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1820,
        40
      ],
      "parameters": {
        "url": "=https://api.goapi.ai/api/v1/task",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"model\": \"midjourney\",\n    \"task_type\": \"upscale\",\n    \"input\": {\n        \"origin_task_id\": \"{{ $('Generate Image').item.json.data.task_id }}\",\n        \"index\": \"{{ $json.data[\"Image Index\"] }}\"\n    }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f48fbeff-71fd-45ca-abec-7decbab1e524",
      "name": "Get Upscale",
      "type": "n8n-nodes-base.if",
      "position": [
        2480,
        -110
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "48d40457-1a52-4a14-b02b-a87254996224",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "84c2c579-39ed-4940-9ded-9b9056a12767",
      "name": "Notify Generation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        940,
        165
      ],
      "parameters": {
        "text": "=\ud83d\uddbc Generating Image ...",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "42506f9c-b2af-425d-8a5b-7f0fb8046d1c",
      "name": "Notify Upscaling",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2040,
        40
      ],
      "parameters": {
        "text": "=\u2197 Upscaling Image ...",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "dac78f7a-02d6-4592-ae2a-ca6b6c01e9e4",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        2700,
        140
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "15c49101-d579-44ae-baed-3d01522a1d96",
      "name": "Status = complete",
      "type": "n8n-nodes-base.if",
      "position": [
        1380,
        90
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "48d40457-1a52-4a14-b02b-a87254996224",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c22de90c-3d63-47c9-a2f1-3363d261ba1f",
      "name": "Get Index to Upscale",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1600,
        40
      ],
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "message": "={{ $json.data.output.image_url }}",
        "options": {
          "appendAttribution": false,
          "messageButtonLabel": "Select Image to Upscale"
        },
        "operation": "sendAndWait",
        "formFields": {
          "values": [
            {
              "fieldType": "number",
              "fieldLabel": "Image Index"
            }
          ]
        },
        "responseType": "customForm"
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a02dac7e-365f-46f6-bc2e-8b4a9c3e8376",
      "name": "Discord - Generation Log",
      "type": "n8n-nodes-base.discord",
      "position": [
        2700,
        -260
      ],
      "parameters": {
        "content": "=### All Render Image\n\n{{ $('Get Generation Task').item.json.data.output.image_url }}\n\n### Individual Render Image\n\n{{ $('Get Generation Task').item.json.data.output.temporary_image_urls.join('\\n\\n') }}\n\n### Final Upscaled Image\n\n{{ $json.data.output.image_url }}\n",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "697416344865472593",
          "cachedResultUrl": "https://discord.com/channels/697416344865472593",
          "cachedResultName": "server"
        },
        "options": {
          "flags": [
            "SUPPRESS_EMBEDS",
            "SUPPRESS_NOTIFICATIONS"
          ]
        },
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1385916790785314836",
          "cachedResultUrl": "https://discord.com/channels/697416344865472593/1385916790785314836",
          "cachedResultName": "goapi-mj-image-log"
        }
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "5a91e49a-449c-453a-a3b5-a7a74f7eeaae",
      "name": "Main Log",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2700,
        -60
      ],
      "parameters": {
        "text": "={{ $json.data.output.image_url }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3c144117-29a9-4ee9-9b55-a94daf6c7a98",
      "name": "Get Prompt",
      "type": "n8n-nodes-base.if",
      "position": [
        280,
        165
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "9e365352-039b-451f-940d-d87ed138e432",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.message.from.username }}",
              "rightValue": "username"
            },
            {
              "id": "40df18a4-0f52-481c-8885-094d1f793b05",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.message.text }}",
              "rightValue": "/start"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c80a05ba-51ce-44b7-9c28-3ea20ea96fa0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -180
      ],
      "parameters": {
        "width": 420,
        "height": 240,
        "content": "## Setup Instructions\n- Create a Telegram Bot and get the [Token](https://help.zoho.com/portal/en/kb/desk/support-channels/instant-messaging/telegram/articles/telegram-integration-with-zoho-desk#How_to_find_a_token_for_an_existing_Telegram_Bot).\n- Create a Telegram Connection and Update the Credentials in all Telegram Nodes.\n- Create [GoAPI](https://goapi.ai/) Account and [Get the API Key](https://goapi.ai/dashboard/key) and Update the 3 HTTP Nodes \n  - `Get Generation Task`, \n  - `Upscale`, \n  - `Get Upscale Task`"
      },
      "typeVersion": 1
    },
    {
      "id": "bf94e126-8d22-4e12-bfc7-081867ae4e29",
      "name": "Get Generation Task",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1160,
        165
      ],
      "parameters": {
        "url": "=https://api.goapi.ai/api/v1/task/{{ $('Generate Image').item.json.data.task_id }}\n",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b37fb1b0-4227-4ab9-a211-64120706dd54",
      "name": "Get Upscale Task",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2260,
        40
      ],
      "parameters": {
        "url": "=https://api.goapi.ai/api/v1/task/{{ $('Upscale').item.json.data.task_id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "aa413bd6-0468-4497-9b27-2b55bd4ecbf7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2620,
        -360
      ],
      "parameters": {
        "width": 360,
        "height": 240,
        "content": "### Optional Log.\nDelete this Node if you don't want to get Logs in Discord."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "XqrFvCFdlyFR3Uza",
    "executionOrder": "v1"
  },
  "versionId": "37d45c4b-5176-45dd-9493-8fc354552a59",
  "connections": {
    "Task": {
      "main": [
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Generation Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Get Upscale Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upscale": {
      "main": [
        [
          {
            "node": "Notify Upscaling",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Prompt": {
      "main": [
        [
          {
            "node": "Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Upscale": {
      "main": [
        [
          {
            "node": "Main Log",
            "type": "main",
            "index": 0
          },
          {
            "node": "Discord - Generation Log",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "Notify Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Upscale Task": {
      "main": [
        [
          {
            "node": "Get Upscale",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Upscaling": {
      "main": [
        [
          {
            "node": "Get Upscale Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Get Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Generation": {
      "main": [
        [
          {
            "node": "Get Generation Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status = complete": {
      "main": [
        [
          {
            "node": "Get Index to Upscale",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Generation Task": {
      "main": [
        [
          {
            "node": "Status = complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Index to Upscale": {
      "main": [
        [
          {
            "node": "Upscale",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow connects Telegram to Midjourney through GoAPI, enabling automated image generation and upscaling directly from chat.

Source: https://n8n.io/workflows/5097/ — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Slack & Telegram

TextMain. Uses telegramTrigger, stopAndError, telegram, httpRequest. Event-driven trigger; 56 nodes.

Telegram Trigger, Stop And Error, Telegram +2
Slack & Telegram

Pede Ai. Uses httpRequest, telegram, postgres, telegramTrigger. Event-driven trigger; 53 nodes.

HTTP Request, Telegram, Postgres +1
Slack & Telegram

📄 Documentation: Notion Guide

Telegram Trigger, @Blotato/N8N Nodes Blotato, Telegram +1
Slack & Telegram

Telegram Wait. Uses stickyNote, httpRequest, redis, noOp. Event-driven trigger; 36 nodes.

HTTP Request, Redis, Telegram +1
Slack & Telegram

This n8n workflow turns your Telegram bot into a powerful AI photo enhancer! Whether users send a photo or a link, it processes the image by: 📥 Receiving the input (photo or link) 🧠 Upscaling quality

Telegram, AWS S3, HTTP Request +1