{
  "id": 4467,
  "name": "Generate enhanced AI images via Telegram with DALL-E and GPT",
  "description": "# PromptCraft AI \u2013 Telegram Image Generator\n\n## \ud83d\ude80 How It Works\n\nPromptCraft AI is an n8n automation that transforms simple image ideas sent through Telegram into stunning AI-generated images using OpenAI's DALL\u00b7E (or other image models).\n\n### \ud83d\udd01 Workflow Overview:\n\n1. **Telegram Trigger**: Listens for messages from a user on Telegram.\n2. **Prompt Expansion**: The message is transformed into a rich image description using GPT (OpenAI Chat Model).\n3. **Image Generation**: The prompt is passed to OpenAI's image API to generate a high-quality image.\n4. **Send Image**: The final image is sent back to the user on Telegram.\n5. *(Optional)* Log image titles and links to Google Drive and Google Sheets.\n\n---\n\n## \u2699\ufe0f Setup Instructions\n\n### \ud83d\udccb Prerequisites\n\n* [ ] n8n installed (Self-hosted or via n8n.cloud)\n* [ ] Telegram bot token (via [@BotFather](https://t.me/botfather))\n* [ ] OpenAI API key ([platform.openai.com](https://platform.openai.com/))\n* [ ] Google Sheets & Drive OAuth2 credentials (optional)\n\n---\n\n### \ud83e\udde0 Step-by-Step Configuration\n\n#### 1. \ud83d\udce5 Import the Workflow\n\n* Go to n8n \u2192 click **Import** \u2192 upload `PromptCraft_AI_Template.json`\n\n#### 2. \ud83d\udd10 Set Up Credentials\n\n* In **Credentials**, add the following:\n\n  * **Telegram API** \u2192 Paste your bot token\n  * **OpenAI API** \u2192 Paste your OpenAI API key\n  * *(Optional)* **Google Sheets OAuth2**, **Google Drive OAuth2**\n\n#### 3. \ud83d\udd04 Replace Placeholders\n\n* Open each node that requires credentials:\n\n  * Replace `REPLACE_OPENAI_API_KEY` with your actual OpenAI API key\n  * Replace `REPLACE_TELEGRAM_API_ID` and credential names as needed\n  * *(Optional)* Update Google Drive Folder ID & Sheet ID in respective nodes\n\n#### 4. \u2705 Activate the Workflow\n\n* Turn on the Telegram Trigger node.\n* Deploy and activate the full workflow.\n\n#### 5. \u2709\ufe0f Test It Out\n\n* Send your Telegram bot a message like:\n\n  &gt; a knight riding a robotic horse in the future\n\n* Receive the generated image back in Telegram!\n\n---\n\n## \ud83d\udca1 Pro Tips\n\n* Use detailed or imaginative inputs for better outputs.\n* Fine-tune the GPT prompt for specific visual styles.\n* Extend with Google Vision, image upscaling, or watermarking.\n\n---\n\n## \ud83d\udedf Support\n\nFor setup assistance or custom feature requests, feel free to contact me @dimejicole21@gmail.com\n\n---\n\n**Happy Prompting!** \ud83d\uddbc\u2728\n",
  "categories": [
    {
      "id": 31,
      "name": "Content Creation"
    },
    {
      "id": 51,
      "name": "Multimodal AI"
    }
  ],
  "totalViews": 2304,
  "createdAt": "2025-05-28T17:41:27.309Z",
  "workflow": {
    "id": "EYffbq7nZzy74ND8",
    "meta": {
      "instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc",
      "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": {
            "id": "credential-id",
            "name": "googleDriveOAuth2Api 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": {
            "id": "credential-id",
            "name": "googleSheetsOAuth2Api 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
        ],
        "webhookId": "8fcbda9c-8396-41f7-8f2d-39e4ae4337c7",
        "parameters": {
          "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
          "operation": "sendPhoto",
          "binaryData": true,
          "additionalFields": {}
        },
        "credentials": {
          "telegramApi": {
            "id": "credential-id",
            "name": "telegramApi Credential"
          }
        },
        "typeVersion": 1.2
      },
      {
        "id": "91e34b1e-4d15-482f-bb07-86c81c32b478",
        "name": "Telegram Trigger",
        "type": "n8n-nodes-base.telegramTrigger",
        "position": [
          -920,
          -240
        ],
        "webhookId": "a9997053-40e2-4d1d-9abc-f2e5b6582096",
        "parameters": {
          "updates": [
            "message"
          ],
          "additionalFields": {}
        },
        "credentials": {
          "telegramApi": {
            "id": "credential-id",
            "name": "telegramApi 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": {
            "id": "credential-id",
            "name": "openAiApi 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,
    "pinData": {},
    "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
            }
          ]
        ]
      }
    }
  },
  "workflowInfo": {
    "nodeCount": 12,
    "nodeTypes": {
      "n8n-nodes-base.telegram": {
        "count": 1
      },
      "n8n-nodes-base.stickyNote": {
        "count": 4
      },
      "n8n-nodes-base.googleDrive": {
        "count": 1
      },
      "n8n-nodes-base.httpRequest": {
        "count": 2
      },
      "n8n-nodes-base.googleSheets": {
        "count": 1
      },
      "@n8n/n8n-nodes-langchain.agent": {
        "count": 1
      },
      "n8n-nodes-base.telegramTrigger": {
        "count": 1
      },
      "@n8n/n8n-nodes-langchain.lmChatOpenAi": {
        "count": 1
      }
    }
  },
  "nodes": [
    "Image Prompt",
    "Google Drive",
    "Image Log",
    "Sticky Note2",
    "Sticky Note7",
    "Sticky Note6",
    "Send Photo",
    "Telegram Trigger",
    "Create Image",
    "OpenAI Chat Model",
    "HTTP Request",
    "Sticky Note"
  ],
  "nodeTypes": [
    "@n8n/n8n-nodes-langchain.agent",
    "n8n-nodes-base.httpRequest",
    "n8n-nodes-base.telegramTrigger",
    "n8n-nodes-base.stickyNote",
    "n8n-nodes-base.telegram",
    "n8n-nodes-base.googleSheets",
    "@n8n/n8n-nodes-langchain.lmChatOpenAi",
    "n8n-nodes-base.googleDrive"
  ]
}