{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e5eb5859-ec26-4da8-b186-d4bcec1194b3",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3440,
        4384
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "36152979-64d3-4c6f-862a-1ab5e0820dc5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4000,
        4400
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d04fa300-f855-47a3-8ad3-b4b84a294695",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4272,
        4448
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6640e557-de10-40cf-9bd7-4dc60059efe6",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4880,
        4448
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "9940c201-b22e-456f-aeb7-2e012a16f9ee",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5152,
        4448
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "02e4c9fa-e0e4-483e-9994-629ae4112fca",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5600,
        4384
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "86aa31b9-3c09-47dc-9ec3-1d1dd8c8f487",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6496,
        4448
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6108a779-b8fa-4b78-8fd3-8f620387ed82",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4880,
        4896
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e9dc00e2-c710-47c4-bafb-1fcaa884955c",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6224,
        4784
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7a9ca568-a430-4c4d-ab62-77a9be98624d",
      "name": "Read from Sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4320,
        4576
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "d5e6b007-1233-4dd5-be26-e8c0ac130212",
      "name": "Definition AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        4544,
        4576
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "a66dcc7f-0fc4-4079-87a8-ec2ea5bc328e",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        4048,
        4576
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0e51f97b-40da-4b28-b6d8-f6b54f043f80",
      "name": "Upload Video to Postiz",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6272,
        5088
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "2376ba13-8055-4917-8d1d-692abaa05932",
      "name": "Fetch Postiz Integrations",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6496,
        5088
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "38373626-773c-4c6d-bbb7-a3afbae11709",
      "name": "Route by Platform",
      "type": "n8n-nodes-base.switch",
      "position": [
        6720,
        5072
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "c2f64a2e-c456-4f10-9a24-5609bbebd4d8",
      "name": "Post to YouTube",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7024,
        5088
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "01afaf1d-1534-4a7b-b390-20309205c163",
      "name": "Post to TikTok",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7024,
        4896
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "7485f4df-e360-436f-931d-bbfb4d3d931c",
      "name": "Post to Instagram",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7024,
        5280
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "22ff2a8e-b5b8-489c-87c6-5157f178c6f9",
      "name": "Convert Data to File",
      "type": "n8n-nodes-base.convertToFile",
      "notes": "At this step, the video should be generated and ready to convert to 9:16 aspect ratio",
      "position": [
        6544,
        4576
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1.1
    },
    {
      "id": "2bbdd5d9-e152-46b2-a3d9-095f4a95ab4f",
      "name": "Check Video Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6096,
        4496
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "79df40b5-74a8-4bd8-9b4b-012dc35d9116",
      "name": "Initiate Video Generation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5648,
        4576
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "c66bc5e1-df3b-42e4-a719-f731a0e0e571",
      "name": "Generate JWT Token",
      "type": "n8n-nodes-base.jwt",
      "position": [
        5200,
        4576
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "20baa959-12af-4321-93a8-a4e1d1f2a762",
      "name": "Request Google Token",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5424,
        4576
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "690e51a0-9437-4620-95c8-fb160eda724a",
      "name": "Upload to Google Cloud",
      "type": "n8n-nodes-base.googleCloudStorage",
      "position": [
        6768,
        4576
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 1,
      "waitBetweenTries": 2000
    },
    {
      "id": "1d009abb-c0c5-4ccd-8e26-bd46f90792dc",
      "name": "Wait 20 Seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        5872,
        4576
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "a1fdb50d-05a8-46df-972e-0089b68c9712",
      "name": "Set API Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        4928,
        4576
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "6bcf42d9-98a5-4702-b28d-a6410a83cc6e",
      "name": "Route by Status",
      "type": "n8n-nodes-base.switch",
      "position": [
        6320,
        4576
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "a7e79d20-32f5-4d7a-92c3-e8f479913c65",
      "name": "Gemini Chat Bot",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        4640,
        4800
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "712ad3bd-e231-4ed4-bd02-49a7cf48b998",
      "name": "Submit Creatomate Render",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5152,
        5088
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "cc481be5-9cf3-40bc-93fe-334c1d4b5c00",
      "name": "Check Render Completion",
      "type": "n8n-nodes-base.if",
      "position": [
        5824,
        5088
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "3e317d75-1fdf-4218-8a46-72194ca1c583",
      "name": "Await Render Completion",
      "type": "n8n-nodes-base.wait",
      "position": [
        5376,
        5088
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "1642a301-4bc5-4f4b-a95a-2e06dfe210f6",
      "name": "Check Render Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5600,
        5008
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "19a5e862-c249-475c-aa6c-6a10240e3c27",
      "name": "Download Final Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6048,
        5088
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "ecccd7a6-3e43-4835-99b9-7a95a38a6355",
      "name": "Create HTTP Payload for Creatomate",
      "type": "n8n-nodes-base.code",
      "position": [
        4928,
        5088
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Read from Sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Chat Bot": {
      "ai_languageModel": [
        [
          {
            "node": "Definition AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Route by Status": {
      "main": [
        [
          {
            "node": "Convert Data to File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 20 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 20 Seconds": {
      "main": [
        [
          {
            "node": "Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read from Sheet1": {
      "main": [
        [
          {
            "node": "Definition AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Platform": {
      "main": [
        [
          {
            "node": "Post to TikTok",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post to YouTube",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post to Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Video Status": {
      "main": [
        [
          {
            "node": "Route by Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate JWT Token": {
      "main": [
        [
          {
            "node": "Request Google Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set API Parameters": {
      "main": [
        [
          {
            "node": "Generate JWT Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Render Status": {
      "main": [
        [
          {
            "node": "Check Render Completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Definition AI Agent": {
      "main": [
        [
          {
            "node": "Set API Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Data to File": {
      "main": [
        [
          {
            "node": "Upload to Google Cloud",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Final Video": {
      "main": [
        [
          {
            "node": "Upload Video to Postiz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Google Token": {
      "main": [
        [
          {
            "node": "Initiate Video Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video to Postiz": {
      "main": [
        [
          {
            "node": "Fetch Postiz Integrations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Cloud": {
      "main": [
        [
          {
            "node": "Create HTTP Payload for Creatomate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Await Render Completion": {
      "main": [
        [
          {
            "node": "Check Render Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Render Completion": {
      "main": [
        [
          {
            "node": "Download Final Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Await Render Completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Submit Creatomate Render": {
      "main": [
        [
          {
            "node": "Await Render Completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Postiz Integrations": {
      "main": [
        [
          {
            "node": "Route by Platform",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initiate Video Generation": {
      "main": [
        [
          {
            "node": "Wait 20 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create HTTP Payload for Creatomate": {
      "main": [
        [
          {
            "node": "Submit Creatomate Render",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}