{
  "name": "Create script-to-video avatar videos with GPT-4.1-mini, HeyGen, Google Drive, Gmail and Slack",
  "nodes": [
    {
      "id": "fc6aea6d-7259-4e2a-8c0e-f96f8c80d68b",
      "name": "Check HeyGen Video Status1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        1344
      ]
    },
    {
      "id": "e67dc0e6-07b5-49bb-99bb-ef62974d8c2b",
      "name": "Receive Script Request ",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1232,
        1424
      ]
    },
    {
      "id": "b1514593-ffb3-4ce9-82cc-868130acfabb",
      "name": "Parse Incoming Script Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        -944,
        1424
      ]
    },
    {
      "id": "cc8ee808-65a9-452e-af2d-d44a5eb334e9",
      "name": "Rewrite & Structure Video Script ",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -624,
        1424
      ]
    },
    {
      "id": "0c34a43e-d9ff-499f-9eb2-22d5c6fa0aff",
      "name": "Apply Script Writing Memory Context",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -544,
        1760
      ]
    },
    {
      "id": "0a2b1ddf-305a-410c-ad4b-c992e4edd5a3",
      "name": "LLM Engine for Script Rewriting",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -768,
        1744
      ]
    },
    {
      "id": "cf1bc913-3ea4-4efc-8ad8-7dbf21c6ba64",
      "name": "Validate Structured Script Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -352,
        1728
      ]
    },
    {
      "id": "0afeb153-a523-4d8e-b44c-270bda2a2c93",
      "name": "Submit Video Generation Request to HeyGen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        48,
        1424
      ]
    },
    {
      "id": "1ae23d16-9812-4069-9055-0c8d2df2cc0e",
      "name": "Wait Before Checking Video Status",
      "type": "n8n-nodes-base.wait",
      "position": [
        496,
        1424
      ]
    },
    {
      "id": "705f5697-41ec-4985-b26d-c8d1d93aa649",
      "name": "Wait Before Rechecking Status",
      "type": "n8n-nodes-base.wait",
      "position": [
        944,
        1344
      ]
    },
    {
      "id": "ee115c09-f2ff-4023-b6b9-0d4926de02d7",
      "name": "Evaluate Video Completion Status",
      "type": "n8n-nodes-base.if",
      "position": [
        1168,
        1424
      ]
    },
    {
      "id": "63c5271d-1b77-4250-9ac2-121a5e5c1f55",
      "name": "Download Generated HeyGen Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1584,
        1424
      ]
    },
    {
      "id": "507da046-8767-42d0-9a79-9012737b9e43",
      "name": "Upload Generated Video to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1824,
        1424
      ]
    },
    {
      "id": "bec0536a-83fd-4585-87a4-6812b450195c",
      "name": "Generate Completion Notifications ",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2192,
        1424
      ]
    },
    {
      "id": "bbde4ebb-2f99-46b7-80da-b175fd41c234",
      "name": "Apply Notification Context Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2272,
        1824
      ]
    },
    {
      "id": "367cf36e-b61b-4133-a2f1-15f397a2c35f",
      "name": "LLM Engine for Notification Generation",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2112,
        1760
      ]
    },
    {
      "id": "9f869d09-9902-43f5-b5f5-367c2f01b0cf",
      "name": "Validate Notification Output JSON",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2448,
        1776
      ]
    },
    {
      "id": "ff0d9185-c760-4660-bccc-96a18e3c7402",
      "name": "Send Video Ready Slack Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        2720,
        1072
      ]
    },
    {
      "id": "a76efcd6-ac8b-4797-b219-33a9cb32f15a",
      "name": "Send Video Ready Email Notification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2752,
        1680
      ]
    },
    {
      "id": "f1cff981-dfd1-4688-915d-e74fdedd1102",
      "name": "Error Handler Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -1184,
        2496
      ]
    },
    {
      "id": "3127b7db-2ec9-4fb7-b80f-a46a551b1b84",
      "name": "Slack: Send Error Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -832,
        2496
      ]
    },
    {
      "id": "3fb84610-7b6d-45e8-be3d-4dd516cd32cd",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        2304
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f7a00628-388c-4d73-957b-eddade85ce8d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2128,
        384
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "d13fa04f-9c05-402c-8ef9-d017c3c6b701",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        960
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "4eff359f-e51d-4ec3-8900-9f61b0f65bbe",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        1024
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "6652f436-c07a-45aa-b87e-3aa5a711f118",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        1024
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "879c36a9-836d-4065-a5bc-d4a2c6f14647",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2048,
        864
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Error Handler Trigger": {
      "main": [
        [
          {
            "node": "Slack: Send Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Script Request ": {
      "main": [
        [
          {
            "node": "Parse Incoming Script Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check HeyGen Video Status1": {
      "main": [
        [
          {
            "node": "Wait Before Rechecking Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Incoming Script Payload": {
      "main": [
        [
          {
            "node": "Rewrite & Structure Video Script ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Rechecking Status": {
      "main": [
        [
          {
            "node": "Evaluate Video Completion Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Generated HeyGen Video": {
      "main": [
        [
          {
            "node": "Upload Generated Video to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM Engine for Script Rewriting": {
      "ai_languageModel": [
        [
          {
            "node": "Rewrite & Structure Video Script ",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Evaluate Video Completion Status": {
      "main": [
        [
          {
            "node": "Download Generated HeyGen Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Checking Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Notification Context Memory": {
      "ai_memory": [
        [
          {
            "node": "Generate Completion Notifications ",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Rewrite & Structure Video Script ": {
      "main": [
        [
          {
            "node": "Submit Video Generation Request to HeyGen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Notification Output JSON": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Completion Notifications ",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Validate Structured Script Output": {
      "ai_outputParser": [
        [
          {
            "node": "Rewrite & Structure Video Script ",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Checking Video Status": {
      "main": [
        [
          {
            "node": "Check HeyGen Video Status1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Completion Notifications ": {
      "main": [
        [
          {
            "node": "Send Video Ready Email Notification",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Video Ready Slack Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Script Writing Memory Context": {
      "ai_memory": [
        [
          {
            "node": "Rewrite & Structure Video Script ",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "LLM Engine for Notification Generation": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Completion Notifications ",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Upload Generated Video to Google Drive": {
      "main": [
        [
          {
            "node": "Generate Completion Notifications ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Submit Video Generation Request to HeyGen": {
      "main": [
        [
          {
            "node": "Wait Before Checking Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}