{
  "name": "Automate product ad creation with Telegram, Fal.AI & Facebook posting",
  "nodes": [
    {
      "id": "bccb5336-76f0-4373-b35f-9d12798ccd1d",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        832,
        112
      ]
    },
    {
      "id": "64c80d0a-8369-4c22-9f61-8e05f049d76f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        448,
        16
      ]
    },
    {
      "id": "39ce8fb0-11c6-4c88-9121-4b909379ee34",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        608,
        16
      ]
    },
    {
      "id": "a9569805-f999-40e4-9374-1c2a1aef0d72",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        352
      ],
      "parameters": {
        "width": 2144,
        "height": 256,
        "content": "### 🟨 Zone 3: Generate & Confirm Ad Image (Fal.AI)\n**Purpose:**  \nSend the prepared prompt to Fal.AI API to generate an advertising image, \nthen let the user confirm the result.\n**Main Steps:**\n1. **P"
      }
    },
    {
      "id": "e989e099-1885-4aad-846d-ea353f643750",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        352,
        464
      ]
    },
    {
      "id": "ac93bc19-c3a4-4a83-9433-847721bacd22",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -128,
        768
      ]
    },
    {
      "id": "8eca322c-5e42-41fe-920a-a8c2d02ac902",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        32,
        768
      ]
    },
    {
      "id": "0165ada9-4d77-4a46-8eb6-7b2d675aa8e4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        112
      ],
      "parameters": {
        "width": 2144,
        "height": 224,
        "content": "#### 🟥 Zone 2: Create Advertising Image Prompt\n**Purpose:**  \nGenerate an AI-ready advertising prompt using the analyzed image description and user input from Telegram.\n\n**Main Steps:**\n1. **User Revi"
      }
    },
    {
      "id": "a5dd96e0-2158-4e34-bb16-fbdfdd66fb6a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -128
      ],
      "parameters": {
        "width": 2144,
        "height": 224,
        "content": "### 🟩 Zone 1: Product Image Analysis\n**Purpose:**  \nReceive a product image from Telegram, extract the file path, and analyze the visual details of the product.\n\n**Main Steps:**\n1. **Receive Product I"
      }
    },
    {
      "id": "246a4cc8-4a13-4d04-8a98-de8d92ca2cb9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        624
      ],
      "parameters": {
        "width": 2144,
        "height": 288,
        "content": "### 🟦 Zone 4: Create Social Media Caption & Post to Facebook\n**Purpose:**  \nAnalyze the final ad image, write a social media caption, and post automatically to Facebook or Instagram.\n**Main Steps:**\n1"
      }
    },
    {
      "id": "32bba9a2-7f30-49fe-8166-88e6ae6ea192",
      "name": "Receive Product Image (Telegram Trigger)",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -160,
        -96
      ]
    },
    {
      "id": "5c693310-59db-474c-9f99-2a1f20d728f2",
      "name": "Get Telegram File Path",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        32,
        -96
      ]
    },
    {
      "id": "163841fd-657c-4bce-888e-52cc2e009a73",
      "name": "Analyze Product Image (OpenAI Vision)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        256,
        -96
      ]
    },
    {
      "id": "9b8758fe-6705-4ee0-aee3-23461852eff4",
      "name": "Generate Ad Prompt Draft (from Image Analysis)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        464,
        -96
      ]
    },
    {
      "id": "c9b449e9-59b1-4f0d-8a26-e5a1831d03ac",
      "name": "Assemble Prompt Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -160,
        128
      ]
    },
    {
      "id": "5500ed80-3304-456c-85b6-e28133d14337",
      "name": "User Review: Approve/Reject Ad Prompt",
      "type": "n8n-nodes-base.telegram",
      "position": [
        48,
        128
      ]
    },
    {
      "id": "e0ef10fc-fbe7-4e9a-aa6d-495c3dbba207",
      "name": "Check Prompt Approval (Yes/No)",
      "type": "n8n-nodes-base.if",
      "position": [
        272,
        128
      ]
    },
    {
      "id": "065e5b88-011d-4c22-abbd-6988026aafe9",
      "name": "Revise Prompt Based on Feedback",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        464,
        144
      ]
    },
    {
      "id": "ee5c3f1d-8de9-42cd-8d37-65e11740f108",
      "name": "Prepare Fal.AI Input Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -320,
        384
      ]
    },
    {
      "id": "71b27b74-f6de-4fbf-a9a1-d4c1683ea424",
      "name": "Call Fal.AI API (nano-banana model)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -144,
        384
      ]
    },
    {
      "id": "c35e12e6-dd35-4e9d-bda4-a21c241907c5",
      "name": "Check Fal.AI Image Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        32,
        384
      ]
    },
    {
      "id": "00965d0b-e5b9-4d29-a5ab-0b71e3827db5",
      "name": "Verify Image Generation Completed",
      "type": "n8n-nodes-base.if",
      "position": [
        208,
        384
      ]
    },
    {
      "id": "8042ab3f-e00b-4ea1-81ab-a2309dd3d48f",
      "name": "Retrieve Generated Image URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        464,
        368
      ]
    },
    {
      "id": "3095aa60-52b3-476d-960f-a5f2e061d478",
      "name": "Send Generated Image to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        640,
        368
      ]
    },
    {
      "id": "7c1967b4-0b28-4b64-952d-b2eaeb837cf8",
      "name": "User Review: Approve/Reject Generated Image",
      "type": "n8n-nodes-base.telegram",
      "position": [
        832,
        368
      ]
    },
    {
      "id": "626d2622-1b0a-4768-9d83-1a3d3633889a",
      "name": "Check Image Approval (Yes/No)",
      "type": "n8n-nodes-base.if",
      "position": [
        1008,
        368
      ]
    },
    {
      "id": "44723af0-e3e3-4799-bb67-1cac6167cabc",
      "name": "Analyze Final Ad Image (OpenAI Vision)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -288,
        656
      ]
    },
    {
      "id": "186baedd-9631-4dfb-9e10-033d2abbbeda",
      "name": "Generate Social Media Caption",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -112,
        656
      ]
    },
    {
      "id": "a61e084a-4593-4beb-883e-4fef5289e51b",
      "name": "User Review: Approve/Reject Caption",
      "type": "n8n-nodes-base.telegram",
      "position": [
        192,
        656
      ]
    },
    {
      "id": "f9e12529-a657-4a65-9ab5-f1977ee6cf8e",
      "name": "Check Caption Approval (Yes/No)",
      "type": "n8n-nodes-base.if",
      "position": [
        368,
        656
      ]
    },
    {
      "id": "f4f50eb3-a4e9-47b1-8521-3164c09bf99c",
      "name": "Preview Post Image (Telegram)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        592,
        640
      ]
    },
    {
      "id": "13e34a18-f867-4ef0-9216-8337e28270bd",
      "name": "Preview Post Caption (Telegram)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        784,
        640
      ]
    },
    {
      "id": "7a05e115-49f0-4183-8252-8d2e1ad15cca",
      "name": "Publish Post to Facebook Page",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        992,
        640
      ]
    },
    {
      "id": "86d44dfd-06b8-405a-b651-86e149c646af",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        928
      ],
      "parameters": {
        "width": 336,
        "height": 496,
        "content": "## Product Image\n![Alt text](https://drive.google.com/thumbnail?id=1G0BrS1Zj1BMisa9VObeBQrR3s9ZPyMzS&sz=w300)"
      }
    },
    {
      "id": "ef71ceb6-8569-48f4-88e1-d1dcf96e9c59",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        928
      ],
      "parameters": {
        "width": 1792,
        "height": 496,
        "content": "## Process Step\n![Alt text](https://drive.google.com/thumbnail?id=1hEPQsXbhTIymeDKoav0u5nMEiTFTQzsX&sz=w300) ![Alt text](https://drive.google.com/thumbnail?id=1f_8h34SdhFGv6AxgWA7Ab5V6NdDwe4hK&sz=w300"
      }
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Check Fal.AI Image Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Ad Prompt Draft (from Image Analysis)",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Revise Prompt Based on Feedback",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Social Media Caption",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message": {
      "main": [
        [
          {
            "node": "Prepare Fal.AI Input Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Telegram File Path": {
      "main": [
        [
          {
            "node": "Analyze Product Image (OpenAI Vision)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Ad Prompt Draft (from Image Analysis)",
            "type": "ai_outputParser",
            "index": 0
          },
          {
            "node": "Revise Prompt Based on Feedback",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Check Fal.AI Image Status": {
      "main": [
        [
          {
            "node": "Verify Image Generation Completed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Social Media Caption",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Assemble Prompt Parameters": {
      "main": [
        [
          {
            "node": "User Review: Approve/Reject Ad Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Fal.AI Input Fields": {
      "main": [
        [
          {
            "node": "Call Fal.AI API (nano-banana model)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Generated Image URL": {
      "main": [
        [
          {
            "node": "Send Generated Image to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Image Approval (Yes/No)": {
      "main": [
        [
          {
            "node": "Analyze Final Ad Image (OpenAI Vision)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Fal.AI Input Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Social Media Caption": {
      "main": [
        [
          {
            "node": "User Review: Approve/Reject Caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Preview Post Image (Telegram)": {
      "main": [
        [
          {
            "node": "Preview Post Caption (Telegram)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Prompt Approval (Yes/No)": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Revise Prompt Based on Feedback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Caption Approval (Yes/No)": {
      "main": [
        [
          {
            "node": "Preview Post Image (Telegram)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Social Media Caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Preview Post Caption (Telegram)": {
      "main": [
        [
          {
            "node": "Publish Post to Facebook Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Revise Prompt Based on Feedback": {
      "main": [
        [
          {
            "node": "Assemble Prompt Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Generated Image to Telegram": {
      "main": [
        [
          {
            "node": "User Review: Approve/Reject Generated Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Image Generation Completed": {
      "main": [
        [
          {
            "node": "Retrieve Generated Image URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Fal.AI API (nano-banana model)": {
      "main": [
        [
          {
            "node": "Check Fal.AI Image Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "User Review: Approve/Reject Caption": {
      "main": [
        [
          {
            "node": "Check Caption Approval (Yes/No)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Product Image (OpenAI Vision)": {
      "main": [
        [
          {
            "node": "Generate Ad Prompt Draft (from Image Analysis)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "User Review: Approve/Reject Ad Prompt": {
      "main": [
        [
          {
            "node": "Check Prompt Approval (Yes/No)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Final Ad Image (OpenAI Vision)": {
      "main": [
        [
          {
            "node": "Generate Social Media Caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Product Image (Telegram Trigger)": {
      "main": [
        [
          {
            "node": "Get Telegram File Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "User Review: Approve/Reject Generated Image": {
      "main": [
        [
          {
            "node": "Check Image Approval (Yes/No)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Ad Prompt Draft (from Image Analysis)": {
      "main": [
        [
          {
            "node": "Assemble Prompt Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}