{
  "name": "Edit images with text prompts using Gemini AI and Telegram Bot",
  "nodes": [
    {
      "id": "5dbb5361-0f1a-403a-a6d2-f8aaeebcd2c4",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        1136,
        832
      ]
    },
    {
      "id": "113490e2-abd8-4aa6-8b3e-58030c4d731a",
      "name": "Filter: Has Caption and File",
      "type": "n8n-nodes-base.filter",
      "position": [
        1328,
        832
      ]
    },
    {
      "id": "ffe1e575-905b-406b-8617-2a7a69632285",
      "name": "Note: Filter",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        624
      ],
      "parameters": {
        "width": 396,
        "height": 192,
        "content": "## 🔍 Filter: Has Caption and File\n\n**Purpose:** Validates incoming message has both a caption (prompt) and document file.\n\n**Note:** AND logic; skips workflow if either missing to avoid errors."
      }
    },
    {
      "id": "c12c8013-87db-412b-aca1-5e14867a46b3",
      "name": "Download Image",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1520,
        832
      ]
    },
    {
      "id": "2995feff-c0a7-49d3-b85b-da18e37ba341",
      "name": "Note: Download Image",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        1040
      ],
      "parameters": {
        "width": 332,
        "height": 192,
        "content": "## 📥 Download Image\n\n**Purpose:** Fetches the image file from Telegram servers as binary data.\n\n**Note:** Uses file_id from trigger; downloads immediately as files expire after 1 hour."
      }
    },
    {
      "id": "01d5b33c-5a08-4df9-9eee-293a336535d2",
      "name": "Edit Image with AI",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1728,
        832
      ]
    },
    {
      "id": "b8993e29-7dd8-4cf8-9789-7bd2a3e7bf6b",
      "name": "Note: Edit AI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        592
      ],
      "parameters": {
        "width": 396,
        "height": 192,
        "content": "## 🖼️ Edit Image with AI\n\n**Purpose:** Applies Gemini AI edits to the downloaded image using caption as prompt. **Nano-Banana**\n\n**Note:** Outputs edited binary; handles creative transformations like "
      }
    },
    {
      "id": "e33f9709-25b0-4a37-8aea-dd64f7fe8489",
      "name": "Send Edited Image",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1952,
        832
      ]
    },
    {
      "id": "c6cc872e-2396-4450-acfa-17c08ca67ec5",
      "name": "Overview Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        432
      ],
      "parameters": {
        "width": 632,
        "height": 1176,
        "content": "# 🤖 AI Image Editor using Nano-Banana Telegram Bot\n\n## 📋 What This Template Does\nThis workflow powers a Telegram bot that automatically processes incoming image documents with text prompts. It downloa"
      }
    },
    {
      "id": "bdce77c5-a7f3-480d-95e8-1a183eedf038",
      "name": "Note: Trigger1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        1024
      ],
      "parameters": {
        "width": 332,
        "height": 192,
        "content": "## 📥 Telegram Trigger\n\n**Purpose:** Listens for new messages with documents and optional captions.\n\n**Note:** Filters to 'message' updates only; starts the editing flow on receipt."
      }
    }
  ],
  "connections": {
    "Download Image": {
      "main": [
        [
          {
            "node": "Edit Image with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Filter: Has Caption and File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Image with AI": {
      "main": [
        [
          {
            "node": "Send Edited Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter: Has Caption and File": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}