{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e1c9c872-86ca-44b9-a1a1-486a5877df1a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3616,
        3200
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1d574783-6d2f-483b-8197-e27f4b683d71",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4176,
        3200
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e35deab4-a75f-4b64-99af-9c82bc264a6a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4448,
        3664
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1cd921f9-bbb0-455b-8613-f3fe81fc0dde",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4896,
        3664
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7e103375-f5b6-48ff-a526-c37959c8d878",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5168,
        3680
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b6d5b506-d46f-4668-b223-14c4bd9da743",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5952,
        3680
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d24e810c-6dfb-4865-80f4-9ab4b57a0ef2",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6624,
        3680
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "ce2c2b92-981f-4a0e-bda7-016302810766",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7072,
        3600
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "76ac5856-9d4d-413b-9380-da05d0f38e3b",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7440,
        3984
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0992ba8d-77d5-419a-982f-f30c8f3d4a65",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7888,
        3984
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "4fca42d4-5519-41d6-b0e4-b884fa83cbb0",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        9008,
        3472
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6321bd32-0c56-428f-9c06-30018d360b4a",
      "name": "When Every 8 Hours",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        4224,
        3360
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "13229623-1b86-4b65-8258-37da6d4cfdfa",
      "name": "Read Sheet1 Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4496,
        3792
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "172abb3e-0c4a-4e18-b822-c5b1bd9fbd97",
      "name": "Define Prompt Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        5616,
        3792
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "b3ddd33b-bea3-4a4a-8a59-a66eb7090c55",
      "name": "Idea Generation Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        5216,
        3792
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "601e33f0-e811-4a81-80da-4f7289ceb931",
      "name": "Aggregate Data",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        4720,
        3792
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3405b662-df12-485e-a665-db4697462fe7",
      "name": "Set Objects List",
      "type": "n8n-nodes-base.set",
      "position": [
        4944,
        3792
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "ec6e9400-844c-4296-bebc-43694ce43d5d",
      "name": "Parse Object Caption",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        5376,
        4016
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "96ffdc1e-94cd-4981-b0f3-f46c2878fd69",
      "name": "Manual Trigger Start",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        4224,
        3792
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2cfb1815-d520-44f6-b257-c4946befebaa",
      "name": "OpenAI GPT-4.1 Mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        5344,
        4016
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "855c022a-fe00-4a95-ad19-2e2531f00043",
      "name": "Set API Credentials",
      "type": "n8n-nodes-base.set",
      "position": [
        6000,
        3792
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "e9b33935-7f25-415b-9c54-5c439703ef17",
      "name": "Generate JWT",
      "type": "n8n-nodes-base.jwt",
      "position": [
        6224,
        3792
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "47903eb4-15c0-4441-89de-04812c2cfb6b",
      "name": "Acquire Access Token",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6448,
        3792
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "59e012e0-902f-4b99-a45c-53c038b3a02b",
      "name": "Route by Status",
      "type": "n8n-nodes-base.switch",
      "position": [
        7568,
        3792
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "0144afb0-2063-4c8b-8c27-18fe4b5ae7bf",
      "name": "Post to Video API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6672,
        3792
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "6448b9f9-20b2-481e-9fe0-1e5ca97a2a3e",
      "name": "Post to Status API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7344,
        3712
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "ae473dd1-9984-46c8-82be-eae33edf9a00",
      "name": "Wait 20 Seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        7200,
        3792
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "5d9d7413-2fec-4238-b343-2ed2e240009a",
      "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": [
        7488,
        4112
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1.1
    },
    {
      "id": "5992a269-e3df-457d-8cf3-2bca5ac75efb",
      "name": "Wait for Rendering",
      "type": "n8n-nodes-base.wait",
      "position": [
        8384,
        4096
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "36f13142-86b9-4a30-a7d9-5fcb5349b9b9",
      "name": "Fetch Final Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        9056,
        3792
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "7429c658-7470-4d4b-b5d6-4da870e958e1",
      "name": "GCS Upload for URL Access",
      "type": "n8n-nodes-base.googleCloudStorage",
      "position": [
        7712,
        4112
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 1,
      "waitBetweenTries": 2000
    },
    {
      "id": "aeb800af-a089-4e98-89b0-1a51f660cbcb",
      "name": "Render Video to 9:16",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        8160,
        4096
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "c7b5d1b7-7a7b-4129-bb33-0b76af8b63ab",
      "name": "Check Done Status",
      "type": "n8n-nodes-base.if",
      "position": [
        8832,
        4096
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "38c67679-4b0d-4340-81c3-984993f357b8",
      "name": "Setup Postiz API Config",
      "type": "n8n-nodes-base.set",
      "position": [
        8832,
        3792
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "e9dfdea5-ede0-4062-bbd4-cb6f2b706db3",
      "name": "Verify Render Completion",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        8688,
        3712
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "aa40c44b-80db-48aa-b81b-ee1eefb334aa",
      "name": "Upload Video to Postiz",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        9280,
        3792
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "b603885d-2054-4b40-9c11-a28657a1f321",
      "name": "Fetch Postiz Integrations",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        9504,
        3792
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "48e972b1-7105-42ae-841a-10e4d0fd83f7",
      "name": "Route by Integration Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        9728,
        3776
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "bda91665-4886-4760-b0cc-d7f3118383bf",
      "name": "Post to YouTube API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        9952,
        3792
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "0b5f498a-7dfb-4192-81d1-06d738e43b56",
      "name": "Post to TikTok API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        9952,
        3584
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "d4bb8df5-903d-4857-a75e-8a8e4e3e90a4",
      "name": "Post to Instagram API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        9952,
        3984
      ],
      "parameters": {},
      "typeVersion": 4.2
    }
  ],
  "connections": {
    "Generate JWT": {
      "main": [
        [
          {
            "node": "Acquire Access Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Data": {
      "main": [
        [
          {
            "node": "Set Objects List",
            "type": "main",
            "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": "Post to Status API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Sheet1 Data": {
      "main": [
        [
          {
            "node": "Aggregate Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Objects List": {
      "main": [
        [
          {
            "node": "Idea Generation Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Done Status": {
      "main": [
        [
          {
            "node": "Setup Postiz API Config",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for Rendering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Final Video": {
      "main": [
        [
          {
            "node": "Upload Video to Postiz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post to Video API": {
      "main": [
        [
          {
            "node": "Wait 20 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post to Status API": {
      "main": [
        [
          {
            "node": "Route by Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Rendering": {
      "main": [
        [
          {
            "node": "Verify Render Completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define Prompt Agent": {
      "main": [
        [
          {
            "node": "Set API Credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4.1 Mini": {
      "ai_languageModel": [
        [
          {
            "node": "Idea Generation Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Define Prompt Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set API Credentials": {
      "main": [
        [
          {
            "node": "Generate JWT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Acquire Access Token": {
      "main": [
        [
          {
            "node": "Post to Video API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Data to File": {
      "main": [
        [
          {
            "node": "GCS Upload for URL Access",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger Start": {
      "main": [
        [
          {
            "node": "Read Sheet1 Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Object Caption": {
      "ai_outputParser": [
        [
          {
            "node": "Idea Generation Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Render Video to 9:16": {
      "main": [
        [
          {
            "node": "Wait for Rendering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Idea Generation Agent": {
      "main": [
        [
          {
            "node": "Define Prompt Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video to Postiz": {
      "main": [
        [
          {
            "node": "Fetch Postiz Integrations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setup Postiz API Config": {
      "main": [
        [
          {
            "node": "Fetch Final Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Render Completion": {
      "main": [
        [
          {
            "node": "Check Done Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Postiz Integrations": {
      "main": [
        [
          {
            "node": "Route by Integration Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GCS Upload for URL Access": {
      "main": [
        [
          {
            "node": "Render Video to 9:16",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Integration Type": {
      "main": [
        [
          {
            "node": "Post to TikTok API",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post to YouTube API",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post to Instagram API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}