{
  "name": "Automatic Instagram content creation with OpenAI, Nano Banana and Telegram check",
  "nodes": [
    {
      "id": "b398afeb-c13a-4803-abb5-f5748306cb2e",
      "name": "Webhook Serve (GET)",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -976,
        0
      ]
    },
    {
      "id": "fe871cd9-92d4-4517-bbc9-abca32a5d5bc",
      "name": "Get a record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -784,
        0
      ]
    },
    {
      "id": "24628b04-ba54-4d44-bce4-43d205032094",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -592,
        0
      ]
    },
    {
      "id": "9f4db460-1a12-4cbc-94ee-08e4fbed5ef5",
      "name": "Get Historic Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -624,
        224
      ]
    },
    {
      "id": "d28090b5-372a-440f-9fda-fcf27098349a",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -96,
        224
      ]
    },
    {
      "id": "1546e09a-8782-471b-964f-237fb406b015",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -96,
        400
      ]
    },
    {
      "id": "e0c80b93-ad4a-450a-a3c2-afd7b68b85c3",
      "name": "Parse String to Json",
      "type": "n8n-nodes-base.code",
      "position": [
        208,
        224
      ]
    },
    {
      "id": "83aa901e-c664-4649-a95c-619c427462f7",
      "name": "OpenBanana Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        736,
        224
      ]
    },
    {
      "id": "bb35e49b-6a9a-4c76-b97e-10362df8d399",
      "name": "Upload Image To Airtable",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1248,
        224
      ]
    },
    {
      "id": "e479d26b-a02a-47a5-926a-66fc5b331ee4",
      "name": "Map Historic Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -448,
        224
      ]
    },
    {
      "id": "f0831b45-82fd-4846-977b-21a3e3419d2a",
      "name": "Base64 to jpg",
      "type": "n8n-nodes-base.code",
      "position": [
        896,
        224
      ]
    },
    {
      "id": "7138d995-ae14-43e9-bae6-c339e35af890",
      "name": "Create new record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1056,
        224
      ]
    },
    {
      "id": "72676558-7133-443d-be2c-89492c77b0c9",
      "name": "Define Category",
      "type": "n8n-nodes-base.code",
      "position": [
        -272,
        224
      ]
    },
    {
      "id": "062598c7-580e-4058-9752-18ca85fc68b0",
      "name": "Take Caption",
      "type": "n8n-nodes-base.set",
      "position": [
        384,
        224
      ]
    },
    {
      "id": "300cb5b9-a598-42e9-8d66-b48b214ef9da",
      "name": "Take Image Prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        560,
        224
      ]
    },
    {
      "id": "3dbb9851-3982-4a68-94c2-3d5ac63fb761",
      "name": "Send a photo message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1456,
        224
      ]
    },
    {
      "id": "b884b02f-5555-458f-84f3-710b2907febe",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1648,
        224
      ]
    },
    {
      "id": "a4d0e58c-0101-4fbd-983e-9511dc57e1b2",
      "name": "Input",
      "type": "n8n-nodes-base.code",
      "position": [
        -800,
        224
      ]
    },
    {
      "id": "5ee31efc-3c67-4ad3-a4ed-713607ac341a",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -976,
        224
      ]
    },
    {
      "id": "d00608c0-f95b-401f-ae19-41dfb2ce062a",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -992,
        -224
      ]
    },
    {
      "id": "b0562041-305e-4b30-970d-57007b0abb82",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -976,
        832
      ]
    },
    {
      "id": "9e54a5ea-2f97-42c0-8025-298c0ff8620c",
      "name": "Process Callback",
      "type": "n8n-nodes-base.code",
      "position": [
        -768,
        832
      ]
    },
    {
      "id": "3987d6a5-bc41-4b1c-b8f0-7822fa383fec",
      "name": "Prepare IG Post",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -64,
        656
      ]
    },
    {
      "id": "2ab49c22-264c-49a2-a214-c7f74ba9bf16",
      "name": "Publish Post",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        576,
        576
      ]
    },
    {
      "id": "7b5d5fae-c00f-4b42-b2b9-0b3255e5ab3e",
      "name": "Get Status For Publish",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        256,
        656
      ]
    },
    {
      "id": "4904c66a-e5c3-45c0-a72a-2198492497a1",
      "name": "Send Finish Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        768,
        576
      ]
    },
    {
      "id": "acda6bfb-584c-40ee-96cb-db3ce86d03b7",
      "name": "Send Fail Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        576,
        736
      ]
    },
    {
      "id": "5b7b42c7-e2d4-4d7a-a6c2-1b2754474a1e",
      "name": "Stop and Error",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        768,
        736
      ]
    },
    {
      "id": "8d73cef8-2192-458c-95d6-5a9f9de6bde8",
      "name": "Wait for the preparation of the post",
      "type": "n8n-nodes-base.wait",
      "position": [
        96,
        656
      ]
    },
    {
      "id": "0fd7c268-3517-4822-ad25-384f7bc89d61",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -592,
        816
      ]
    },
    {
      "id": "be7fb4f0-7642-44c2-946c-3c77ba582218",
      "name": "Edit cancel message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -384,
        832
      ]
    },
    {
      "id": "9109155c-3bbe-4090-a040-22f73ed431d2",
      "name": "Edit Confirm  message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -384,
        656
      ]
    },
    {
      "id": "e91e2092-0e06-4e8d-a811-e12263c755e2",
      "name": "Edit regenerate message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -384,
        1008
      ]
    },
    {
      "id": "45e02381-618c-492d-ad00-4a53bf103da1",
      "name": "Extract Input Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -64,
        1008
      ]
    },
    {
      "id": "fe01b462-3cb5-463f-a81d-04ed8ad375c4",
      "name": "Update record - regenerate",
      "type": "n8n-nodes-base.airtable",
      "position": [
        96,
        1008
      ]
    },
    {
      "id": "2f91f33f-1662-4103-aed5-939a9c523921",
      "name": "Update record - cancel",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -224,
        832
      ]
    },
    {
      "id": "d0b61e22-c4d1-4518-af33-9bca4eb63d80",
      "name": "Update record - confirm",
      "type": "n8n-nodes-base.airtable",
      "position": [
        960,
        576
      ]
    },
    {
      "id": "2037c593-d3e5-438f-9f8c-e8009bb066e9",
      "name": "Get caption",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -224,
        656
      ]
    },
    {
      "id": "4dfd1460-3b3d-42c8-b19a-54788f70aaf2",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        400,
        656
      ]
    },
    {
      "id": "cc4e819c-ca92-4598-b4f3-ec0ec82c1801",
      "name": "Get a record1",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -224,
        1008
      ]
    },
    {
      "id": "0e1ef806-878c-4050-be14-3ac4edec626b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        -304
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "0e1a9a37-f83e-447e-a7d3-b43ffce11fe5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        -64
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "5b4a6668-19ef-4d01-91f7-44855c8b6714",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "a90eb699-9dc3-4762-86c5-57628ebdc2c1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        528
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "3d1c8383-7cb7-4f8e-aee4-64a6bc1e14ba",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        -304
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "30920d53-e838-4be6-847b-e15fea20e2d6",
      "name": "Call 'Main Content‑Generation Workflow'",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -800,
        -224
      ]
    },
    {
      "id": "094d82de-5a77-4e28-84aa-723e5850159c",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2064,
        -304
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "ccc29a39-e6da-48f9-96c7-3a100d92407e",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        1040
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "e034689b-7710-4522-bcf4-e726b722ac3b",
      "name": "Call 'Main Content‑Generation Workflow'1",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        256,
        1008
      ]
    },
    {
      "id": "590cbe1e-5a66-4f2e-bf53-8283556405af",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        928
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Publish Post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Fail Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Input": {
      "main": [
        [
          {
            "node": "Get Historic Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Edit Confirm  message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit cancel message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit regenerate message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Parse String to Json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get caption": {
      "main": [
        [
          {
            "node": "Prepare IG Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a record": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish Post": {
      "main": [
        [
          {
            "node": "Send Finish Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Take Caption": {
      "main": [
        [
          {
            "node": "Take Image Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Base64 to jpg": {
      "main": [
        [
          {
            "node": "Create new record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a record1": {
      "main": [
        [
          {
            "node": "Extract Input Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define Category": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare IG Post": {
      "main": [
        [
          {
            "node": "Wait for the preparation of the post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Callback": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Call 'Main Content‑Generation Workflow'",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Process Callback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create new record": {
      "main": [
        [
          {
            "node": "Upload Image To Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Historic Data": {
      "main": [
        [
          {
            "node": "Define Category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Send Fail Message": {
      "main": [
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Take Image Prompt": {
      "main": [
        [
          {
            "node": "OpenBanana Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Input Data": {
      "main": [
        [
          {
            "node": "Update record - regenerate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Historic Posts": {
      "main": [
        [
          {
            "node": "Map Historic Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenBanana Request": {
      "main": [
        [
          {
            "node": "Base64 to jpg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit cancel message": {
      "main": [
        [
          {
            "node": "Update record - cancel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Finish Message": {
      "main": [
        [
          {
            "node": "Update record - confirm",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Serve (GET)": {
      "main": [
        [
          {
            "node": "Get a record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse String to Json": {
      "main": [
        [
          {
            "node": "Take Caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a photo message": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Confirm  message": {
      "main": [
        [
          {
            "node": "Get caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Status For Publish": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit regenerate message": {
      "main": [
        [
          {
            "node": "Get a record1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image To Airtable": {
      "main": [
        [
          {
            "node": "Send a photo message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update record - regenerate": {
      "main": [
        [
          {
            "node": "Call 'Main Content‑Generation Workflow'1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for the preparation of the post": {
      "main": [
        [
          {
            "node": "Get Status For Publish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}