{
  "name": "Create and publish AI avatar short videos with Gemini, HeyGen and Google Sheets",
  "nodes": [
    {
      "id": "10397d84-2860-4aff-b7fb-1e1b6092a6b0",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        624,
        192
      ]
    },
    {
      "id": "4d8786ed-e454-4182-9105-5a06bdd43dca",
      "name": "Update row Viral Content",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        576,
        1040
      ]
    },
    {
      "id": "d2c94b87-eca0-46f4-9885-e20ea4c0dcbf",
      "name": "Cron – Fetch Viral Ideas",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        32,
        -80
      ]
    },
    {
      "id": "3a05cd51-c355-4779-9407-e9b70c0a4e6f",
      "name": "Get Viral Video Dataset",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        256,
        -80
      ]
    },
    {
      "id": "6d81e174-e7ee-429f-bbed-46e2a7677fc7",
      "name": "Save Viral Ideas to Google Sheet",
      "type": "n8n-nodes-base.set",
      "position": [
        512,
        -80
      ]
    },
    {
      "id": "44b61fef-fc39-4e65-acd4-0c3795ba4a43",
      "name": "Cron – Process Viral Row",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        16,
        336
      ]
    },
    {
      "id": "6aaed30c-8d26-4fff-8a14-990753eeadff",
      "name": "Load Viral Idea from Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        208,
        336
      ]
    },
    {
      "id": "4c661dd3-606f-405a-b336-1138f5f6b4a1",
      "name": "Analyze Viral Video",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        416,
        336
      ]
    },
    {
      "id": "7b5d7f4b-55f8-45f3-a16c-518526535695",
      "name": "Parse Script Structure",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        800,
        192
      ]
    },
    {
      "id": "5d0b551a-2be0-41c5-a3fd-3263f940be5c",
      "name": "AI Agent – Script & Avatar Director",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        640,
        336
      ]
    },
    {
      "id": "f81a76fd-0fcb-415d-b6fb-20b945e2d80b",
      "name": "Finalize Avatar Script",
      "type": "n8n-nodes-base.set",
      "position": [
        944,
        336
      ]
    },
    {
      "id": "887959e1-4c80-4edf-81b3-72a7eb646324",
      "name": "Create AI Avatar Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        144,
        640
      ]
    },
    {
      "id": "78279cb1-86fb-487d-8c14-901cc0e47789",
      "name": "Wait for Video Rendering",
      "type": "n8n-nodes-base.wait",
      "position": [
        368,
        624
      ]
    },
    {
      "id": "4bd1613a-1cac-457b-b7c2-c5f2bffda794",
      "name": "Get Rendered Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        624
      ]
    },
    {
      "id": "46df40c3-3fed-454e-bfec-a2a95f26b0d8",
      "name": "Check Video Status",
      "type": "n8n-nodes-base.if",
      "position": [
        752,
        624
      ]
    },
    {
      "id": "15c7f23d-d8d3-4428-8d41-a1a13e3e6977",
      "name": "Save Viral Ideas to Google Sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        768,
        -80
      ]
    },
    {
      "id": "477ddb0c-75ad-4a32-82ea-50f79cb25075",
      "name": "Publish Video to Tiktok",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        160,
        1072
      ]
    },
    {
      "id": "cd3c677e-97dd-4416-a75a-1cabbef72a8d",
      "name": "Publish Video to Facebook",
      "type": "@blotato/n8n-nodes-blotato.blotato",
      "position": [
        576,
        1232
      ]
    },
    {
      "id": "ec90369e-590d-43ec-b6d5-06819fddc334",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -208
      ],
      "parameters": {
        "width": 1200,
        "height": 320,
        "content": "## Viral Idea Engine\nCollect viral short-form video ideas on a schedule and store them in Google Sheets as the input queue for the workflow."
      }
    },
    {
      "id": "f980615d-0e1a-427d-b917-0f3a79d75b44",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        112
      ],
      "parameters": {
        "width": 1200,
        "height": 448,
        "content": "## AI Content Brain\nAnalyze viral videos and generate short, avatar-ready scripts automatically using AI."
      }
    },
    {
      "id": "f1d4ae47-37fe-4393-a315-ec60fec40551",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        544
      ],
      "parameters": {
        "width": 1200,
        "height": 416,
        "content": "##AI Avatar Video Factory\nCreate AI avatar videos from scripts, wait for rendering, and retrieve the final video from HeyGen."
      }
    },
    {
      "id": "d38e05a9-b6e5-4f21-b009-928a892cbf8e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        960
      ],
      "parameters": {
        "width": 1200,
        "height": 448,
        "content": "## Auto Publish & Tracking\nPublish AI avatar videos to social platforms and update Google Sheets with status and results."
      }
    },
    {
      "id": "88173527-6a9a-47fd-9eb9-64c009a02864",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -208
      ],
      "parameters": {
        "width": 592,
        "height": 656,
        "content": "## I🛠️ Workflow Setup Guide\n\nAuthor: [GiangxAI](https://www.youtube.com/@giangxai.official)\n\n## How it works\n- Viral video ideas are collected and stored in Google Sheets  \n- Each idea is analyzed and"
      }
    }
  ],
  "connections": {
    "Check Video Status": {
      "main": [
        [
          {
            "node": "Wait for Video Rendering",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Publish Video to Tiktok",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Rendered Video": {
      "main": [
        [
          {
            "node": "Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Viral Video": {
      "main": [
        [
          {
            "node": "AI Agent – Script & Avatar Director",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create AI Avatar Video": {
      "main": [
        [
          {
            "node": "Wait for Video Rendering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Finalize Avatar Script": {
      "main": [
        [
          {
            "node": "Create AI Avatar Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Script Structure": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent – Script & Avatar Director",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Get Viral Video Dataset": {
      "main": [
        [
          {
            "node": "Save Viral Ideas to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish Video to Tiktok": {
      "main": [
        [
          {
            "node": "Update row Viral Content",
            "type": "main",
            "index": 0
          },
          {
            "node": "Publish Video to Facebook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent – Script & Avatar Director",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Video Rendering": {
      "main": [
        [
          {
            "node": "Get Rendered Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cron – Fetch Viral Ideas": {
      "main": [
        [
          {
            "node": "Get Viral Video Dataset",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cron – Process Viral Row": {
      "main": [
        [
          {
            "node": "Load Viral Idea from Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Viral Idea from Sheet": {
      "main": [
        [
          {
            "node": "Analyze Viral Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Viral Ideas to Google Sheet": {
      "main": [
        [
          {
            "node": "Save Viral Ideas to Google Sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent – Script & Avatar Director": {
      "main": [
        [
          {
            "node": "Finalize Avatar Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}