{
  "name": "Text-to-image generation with Google Gemini & enhanced prompts via Telegram Bot",
  "nodes": [
    {
      "id": "d7a28ef5-499f-44f6-b07e-baad9c655c62",
      "name": "Generate Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -200,
        60
      ]
    },
    {
      "id": "28fe131a-f506-4609-868e-4d7edaf64772",
      "name": "Send a photo message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        520,
        60
      ]
    },
    {
      "id": "7d61ed5b-a176-4404-9cb1-cbef1ead9f51",
      "name": "Generate prompt",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -680,
        60
      ]
    },
    {
      "id": "174c56fc-a0d0-4740-bcd6-532e63a307bd",
      "name": "Structured Prompt",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -500,
        240
      ]
    },
    {
      "id": "bcf4736a-73b7-474b-8af7-ed18b9acb43e",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -980,
        60
      ]
    },
    {
      "id": "612e2726-0641-4362-8e84-49b5efa978fd",
      "name": "Convert to Image",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        160,
        60
      ]
    },
    {
      "id": "abeaddbe-2ba2-462f-b7d2-b8aae24f4a1c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1080,
        -160
      ],
      "parameters": {
        "width": 300,
        "height": 520,
        "content": "## 📱 Telegram Trigger\n\n**Listens for user messages**\n\n- Entry point for the workflow\n- Captures incoming text messages\n- Triggers the entire process\n- **Outputs:** User's image request"
      }
    },
    {
      "id": "303ecc4f-3759-462e-9430-23feb81a8943",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        -160
      ],
      "parameters": {
        "width": 420,
        "height": 520,
        "content": "## 🧠 Generate Prompt\n\n**Enhances user input with AI**\n\n- Takes basic text and makes it detailed\n- Uses prompt engineering techniques\n- Adds artistic style, lighting, composition\n- Powered by Gemini 2."
      }
    },
    {
      "id": "0444fb7e-b578-4575-9bf4-ae6100c21432",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -160
      ],
      "parameters": {
        "width": 340,
        "height": 520,
        "content": "## 🎨 Generate Image\n\n**Creates image from enhanced prompt**\n\n- Calls Google's Gemini 2.0 Flash API\n- Converts text prompt to visual image\n- Returns image in base64 format\n- HTTP POST to image generati"
      }
    },
    {
      "id": "dec96747-332b-464b-82a8-604a82120603",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        -160
      ],
      "parameters": {
        "width": 340,
        "height": 520,
        "content": "## 📁 Convert to Image\n\n**Prepares image for delivery**\n\n- Converts base64 data to binary file\n- Extracts image from API response\n- Makes image compatible with Telegram\n- Essential for photo message se"
      }
    },
    {
      "id": "1b1af43f-7c73-42d2-8610-34e0950248f1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -160
      ],
      "parameters": {
        "width": 340,
        "height": 520,
        "content": "## 📤 Send a Photo Message\n\n**Delivers final image to user**\n\n- Sends generated image back to Telegram\n- Uses binary data from previous node\n- Completes the user interaction\n- User receives their AI-ge"
      }
    },
    {
      "id": "2b60768c-bd3a-4815-9553-a46e3a89875e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        -160
      ],
      "parameters": {
        "width": 340,
        "height": 520,
        "content": "## 🔄 Workflow Summary\n\n**AI-Powered Image Generation Bot**\n\n**What it does:** User sends text → AI enhances prompt → Image generated → Sent back to user\n\n**Key Features:**\n\n- Instant text-to-image con"
      }
    },
    {
      "id": "0d39319b-7bb4-4335-88aa-741d0ffe0f4b",
      "name": "Gemini 2.5 Pro",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -680,
        240
      ]
    }
  ],
  "connections": {
    "Gemini 2.5 Pro": {
      "ai_languageModel": [
        [
          {
            "node": "Generate prompt",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "Convert to Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate prompt": {
      "main": [
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Image": {
      "main": [
        [
          {
            "node": "Send a photo message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Generate prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Prompt": {
      "ai_outputParser": [
        [
          {
            "node": "Generate prompt",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}