{
  "name": "AI image generation & editing with Google Gemini and Telegram Bot",
  "nodes": [
    {
      "id": "47fbda3a-c350-4dc8-8e4d-a02b989b44fc",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -528,
        1680
      ]
    },
    {
      "id": "54e2b068-775c-47d4-a1bc-9ddfe17e3d88",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        -304,
        1680
      ]
    },
    {
      "id": "093a6d6a-ae91-4906-a7f3-5e6a63b382ee",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        1040,
        1760
      ]
    },
    {
      "id": "3a62cd46-9b63-4dac-ab7b-ea562e62a828",
      "name": "Search records",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -80,
        1696
      ]
    },
    {
      "id": "5ef4c48c-1c9e-4272-bb80-22b08720dec1",
      "name": "Edit Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1264,
        1760
      ]
    },
    {
      "id": "ea28d393-8e4f-47ce-8ac6-766aca28f795",
      "name": "Send a photo message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1840,
        1824
      ]
    },
    {
      "id": "b4225b8e-eae3-4ad0-8ffe-bfe5932bf56a",
      "name": "Create or update a record1",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1888,
        1616
      ]
    },
    {
      "id": "a7ce2cca-93a0-4b0d-8ba3-eb51d24e1362",
      "name": "Download Image1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -352,
        928
      ]
    },
    {
      "id": "fed96b49-66fa-4479-8c66-b89370907341",
      "name": "Transform to base",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -160,
        928
      ]
    },
    {
      "id": "2bcd11a9-94a2-4b78-86a7-3e31529ee4c0",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -48,
        1264
      ]
    },
    {
      "id": "1d00c8bf-191f-4086-a385-1840f56767a2",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        208,
        1264
      ]
    },
    {
      "id": "7de5184c-2ab8-40b8-8e5d-af68f42c8f36",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        400,
        1264
      ]
    },
    {
      "id": "845d6a60-14fb-4c94-9b97-fc44d04a54c2",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        624,
        1264
      ]
    },
    {
      "id": "53655955-c77f-4a95-ade0-021895f197ba",
      "name": "Create or update a record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        864,
        1264
      ]
    },
    {
      "id": "0b8c5466-58ca-47ea-89cf-5d5ee95e90ef",
      "name": "Send a text message1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1072,
        1264
      ]
    },
    {
      "id": "e06f6e8f-5f00-43ee-bec3-75e4deca92a3",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        832,
        1760
      ]
    },
    {
      "id": "97d63a01-3a54-4e4f-8941-928e98185b3b",
      "name": "Download File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        672,
        1760
      ]
    },
    {
      "id": "623e5e22-e227-4aa1-b866-ee74301bc407",
      "name": "Upload file1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1664,
        1616
      ]
    },
    {
      "id": "5db3e15a-fbbc-487d-93c5-c71e042e8478",
      "name": "Convert To File",
      "type": "n8n-nodes-base.code",
      "position": [
        1424,
        1760
      ]
    },
    {
      "id": "e6d8ca2d-e16e-48e0-9521-0318f4756c96",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        144,
        1808
      ]
    },
    {
      "id": "3480ecd9-ed69-4d51-a749-e447bb97a0c6",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        288,
        1664
      ]
    },
    {
      "id": "9c5ca8a8-ca2f-4c64-8091-e1616c598713",
      "name": "Send a text message2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        288,
        1952
      ]
    },
    {
      "id": "5d13dd2c-44fa-4f0b-aa3e-f806f12336f5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        288
      ],
      "parameters": {
        "width": 992,
        "height": 464,
        "content": "## Google Nano Banana Image Generator: Overview\n### How it works\nThis workflow is used to create AI images through Telegram messages. When a user sends any text or command in Telegram, that message is"
      }
    },
    {
      "id": "969c8e2e-8175-47aa-9873-c2a36863f0e2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        1536
      ],
      "parameters": {
        "width": 576,
        "height": 384,
        "content": "## Telegram Input\nThis part collects user messages or images from Telegram. The trigger starts the workflow each time user sends something. IF node checks message type and sends it to the correct bran"
      }
    },
    {
      "id": "eedd4464-fb3b-494f-9d5a-b905b0fd7282",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        816
      ],
      "parameters": {
        "width": 992,
        "height": 272,
        "content": "## Image Download and Preparation\nHere the workflow downloads the image that came from Telegram and changes it into base64 string. This format is easy to send further to Drive or to any API that needs"
      }
    },
    {
      "id": "4e7bc232-9a87-49de-b65f-ea06d5d0ce6d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        1136
      ],
      "parameters": {
        "width": 1344,
        "height": 320,
        "content": "## Upload and Record Update\nThis top flow uploads the file to Google Drive and then updates the connected record. After that, a text message is sent in Telegram to confirm that the upload and update i"
      }
    },
    {
      "id": "c3588192-7477-44d5-bc05-d5a1a6d0a630",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        1504
      ],
      "parameters": {
        "width": 672,
        "height": 608,
        "content": "## Conditional Message Handling\nThis part is used for checking if the incoming message matches any saved record or keyword. Depending on result, Telegram sends one of the two reply messages to guide t"
      }
    },
    {
      "id": "02ec6043-51a2-46d8-889f-0c3ec3e2fac2",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        1520
      ],
      "parameters": {
        "width": 1472,
        "height": 480,
        "content": "## Image Editing and Return Flow\nThis section manages full image process. It downloads the earlier stored image, extracts the content, and edits it using image API. The final image file is made and up"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a text message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Download Image1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Search records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Image": {
      "main": [
        [
          {
            "node": "Convert To File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Create or update a record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Edit Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file1": {
      "main": [
        [
          {
            "node": "Create or update a record1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search records": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert To File": {
      "main": [
        [
          {
            "node": "Upload file1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send a photo message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image1": {
      "main": [
        [
          {
            "node": "Transform to base",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transform to base": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Send a text message": {
      "main": [
        [
          {
            "node": "Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create or update a record": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}