AutomationFlowsAI & RAG › Generate Enhanced AI Images via Telegram with Dall-e and Gpt

Generate Enhanced AI Images via Telegram with Dall-e and Gpt

ByDavid Olusola @dae221 on n8n.io

PromptCraft AI is an n8n automation that transforms simple image ideas sent through Telegram into stunning AI-generated images using OpenAI's DALL·E (or other image models). Telegram Trigger: Listens for messages from a user on Telegram. Prompt Expansion: The message is…

Event trigger★★★★☆ complexityAI-powered12 nodesAgentGoogle DriveGoogle SheetsTelegramTelegram TriggerHTTP RequestOpenAI Chat
AI & RAG Trigger: Event Nodes: 12 Complexity: ★★★★☆ AI nodes: yes Added:

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

This workflow follows the Agent → Google Drive 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": "EYffbq7nZzy74ND8",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "PromptCraft AI",
  "tags": [],
  "nodes": [
    {
      "id": "d9cee081-13cd-4ed4-843c-84e3e4e6c3d5",
      "name": "Image Prompt",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -720,
        -240
      ],
      "parameters": {
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "=Overview\nYou are an expert image prompt engineer. "
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "9d2a73d3-fc71-47e4-94c5-1c79dd6b3a30",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -240,
        140
      ],
      "parameters": {
        "name": "=ai image",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultUrl": "https://drive.google.com/drive",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "a4ac1967-64d1-455c-abef-bc3804d0cad4",
      "name": "Image Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        20,
        140
      ],
      "parameters": {
        "columns": {
          "value": {
            "Title": "={{ $json.name }}",
            "Heygen video url": "={{ $json.webViewLink }}"
          },
          "schema": [
            {
              "id": "Heygen video url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Heygen video url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "video  caption",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "video  caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_AWS_SECRET_KEY_HERE-EU0/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1oA-YOUR_AWS_SECRET_KEY_HERE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oA-YOUR_AWS_SECRET_KEY_HERE/edit?usp=drivesdk",
          "cachedResultName": "Avatar video"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "67ae3f89-2d7d-47c3-a55d-251a47a08072",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -820,
        60
      ],
      "parameters": {
        "color": 6,
        "height": 180,
        "content": "## Model"
      },
      "typeVersion": 1
    },
    {
      "id": "230b29c6-ae1b-4cd0-9a35-dce2a0b15c05",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -380
      ],
      "parameters": {
        "color": 6,
        "width": 540,
        "height": 420,
        "content": "# Send Image"
      },
      "typeVersion": 1
    },
    {
      "id": "b9bcd205-679b-4cb0-a6a5-cf2bd8b58887",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        40
      ],
      "parameters": {
        "color": 2,
        "width": 540,
        "height": 240,
        "content": "# Write to Drive & Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "fd75b2ba-57f8-4ce3-8d39-915a96f7cef8",
      "name": "Send Photo",
      "type": "n8n-nodes-base.telegram",
      "position": [
        160,
        -240
      ],
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "operation": "sendPhoto",
        "binaryData": true,
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "91e34b1e-4d15-482f-bb07-86c81c32b478",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -920,
        -240
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "14caf60f-2813-4e39-8960-0dc85adce28d",
      "name": "Create Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -420,
        -240
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/images/generations",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.output }}"
            },
            {
              "name": "size",
              "value": "1024x1024"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <token>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f63c6038-a6dd-41c6-9db1-c42e6f21636a",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -720,
        100
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2959d03f-5f3f-4009-b09e-6700fc1ef3d9",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -200,
        -240
      ],
      "parameters": {
        "url": "={{ $json.data[0].url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "9573f5b8-9c0b-423a-81f9-7c0689c40c72",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -360
      ],
      "parameters": {
        "content": "## Loom Link Demo\n**https://www.loom.com/share/9d4743b32c204b189a237d8b9446f45d?sid=af5f3a1d-fb78-4bba-ac01-f4f29ac7f14a**"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c6f12f08-d7e1-42a4-8be8-73f1c6cbc2b2",
  "connections": {
    "Create Image": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Image Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Prompt": {
      "main": [
        [
          {
            "node": "Create Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Image Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Image Prompt",
            "type": "ai_languageModel",
            "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

PromptCraft AI is an n8n automation that transforms simple image ideas sent through Telegram into stunning AI-generated images using OpenAI's DALL·E (or other image models). Telegram Trigger: Listens for messages from a user on Telegram. Prompt Expansion: The message is…

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

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.

@Blotato/N8N Nodes Blotato, Google Sheets, OpenAI Chat +9
AI & RAG

Arvifund - Supabase (Fixed v5). Uses httpRequest, telegram, googleSheets, telegramTrigger. Event-driven trigger; 91 nodes.

HTTP Request, Telegram, Google Sheets +9
AI & RAG

Arvifund - Supabase. Uses httpRequest, telegram, googleSheets, telegramTrigger. Event-driven trigger; 90 nodes.

HTTP Request, Telegram, Google Sheets +8
AI & RAG

Arvifund - Supabase (Fixed v2). Uses httpRequest, telegram, googleSheets, telegramTrigger. Event-driven trigger; 90 nodes.

HTTP Request, Telegram, Google Sheets +9
AI & RAG

Arvifund - Supabase (Fixed v4). Uses httpRequest, telegram, googleSheets, telegramTrigger. Event-driven trigger; 90 nodes.

HTTP Request, Telegram, Google Sheets +9