{
  "name": "text-to-video generation using Google Veo3 API and Google Drive",
  "nodes": [
    {
      "id": "d990b552-ac91-4e26-81d8-55b99196a5af",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -624,
        640
      ]
    },
    {
      "id": "d9232460-4049-4481-b1af-84cf39f88c79",
      "name": "Wait for API Response",
      "type": "n8n-nodes-base.wait",
      "position": [
        48,
        112
      ]
    },
    {
      "id": "ea4d7d1d-76f7-4a4d-baeb-5d36a18820c4",
      "name": "API Request: Check Task Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        384,
        176
      ]
    },
    {
      "id": "a055e5dd-839d-41f2-8363-b03ee885fa80",
      "name": "Condition: Task Output Status",
      "type": "n8n-nodes-base.switch",
      "position": [
        704,
        288
      ]
    },
    {
      "id": "50111da0-5ffe-44a6-b88b-1b9d4076a2bd",
      "name": "Wait for Task to Complete",
      "type": "n8n-nodes-base.wait",
      "position": [
        80,
        400
      ]
    },
    {
      "id": "3c9afef5-311b-4d81-b8b4-f12b0b2da9b4",
      "name": "Send Email: API Error - Task ID Missing",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1136,
        912
      ]
    },
    {
      "id": "d56935f0-28d9-46ca-b15f-909c47b2bf2f",
      "name": "Upload File to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1216,
        192
      ]
    },
    {
      "id": "ad9ceb04-33d1-4cf2-ab9a-75d53004a8eb",
      "name": "Send Email: API Error - Task Failed",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1424,
        544
      ]
    },
    {
      "id": "ec85dde7-4914-461f-8239-0cb477ae8780",
      "name": "Set Google Drive Permissions",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1536,
        288
      ]
    },
    {
      "id": "e9c8c1a3-cfbf-4a12-8c57-b8bb11ef41a1",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        832
      ],
      "parameters": {
        "width": null,
        "height": 240,
        "content": "Sends an error email if the task ID is missing in the response."
      }
    },
    {
      "id": "1b017c15-6f41-49f3-bd64-e3d6d1bd59aa",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        128
      ],
      "parameters": {
        "width": null,
        "height": 240,
        "content": "Uploads the processed video to Google Drive."
      }
    },
    {
      "id": "1b1dacd4-5d43-401b-acf5-84a1c2d8bb65",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        240
      ],
      "parameters": {
        "width": null,
        "height": 208,
        "content": "Sets the necessary permissions for the uploaded Google Drive file."
      }
    },
    {
      "id": "6017a066-e271-4136-966d-f6f1a891b938",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        512
      ],
      "parameters": {
        "width": null,
        "height": 240,
        "content": "Sends an email if the video generation task fails"
      }
    },
    {
      "id": "c6cba207-956c-4596-a16d-309fa7d671aa",
      "name": "Condition: Check Task Id",
      "type": "n8n-nodes-base.if",
      "position": [
        240,
        656
      ]
    },
    {
      "id": "9127bf63-1513-4f71-8dc5-845ededf15c1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        240
      ],
      "parameters": {
        "width": null,
        "height": 272,
        "content": "Sends an email if the video generation is completed "
      }
    },
    {
      "id": "0a9a0813-da2b-469c-807f-9c85498a5074",
      "name": "Send an email : Video Link",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1824,
        336
      ]
    },
    {
      "id": "2e201acf-9ad6-4018-9294-e16c74fa0eed",
      "name": "Download Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        960,
        208
      ]
    },
    {
      "id": "c42fff1f-8df9-477c-965c-dbaa676dfcb1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        528
      ],
      "parameters": {
        "width": null,
        "height": 272,
        "content": "  - Triggers the workflow when a form is submitted with a prompt field."
      }
    },
    {
      "id": "6db13b80-0081-46d9-8cf2-10edf1354e78",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        576
      ],
      "parameters": {
        "width": null,
        "height": 240,
        "content": "   - Processes the form's prompt by making an API call to the \"Veo 3\" API."
      }
    },
    {
      "id": "5992b1f3-9ed5-462e-b612-be6abe351f07",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        560
      ],
      "parameters": {
        "width": null,
        "height": 240,
        "content": " - Checks if the task ID is present before continuing; sends an error email if missing."
      }
    },
    {
      "id": "b3e4d022-645a-40d4-b219-8b33714260dc",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": null,
        "height": 256,
        "content": "  - Waits for 35 seconds to allow the API response to be processed."
      }
    },
    {
      "id": "5dda17d1-398d-4b80-8f5a-a34db1e6aeae",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        304
      ],
      "parameters": {
        "width": null,
        "height": 256,
        "content": "   - Waits for 30 seconds before rechecking the task’s completion status."
      }
    },
    {
      "id": "b1440872-5243-489b-bfb4-c7f2b2ddbc47",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        96
      ],
      "parameters": {
        "width": null,
        "height": 208,
        "content": " - Sends an HTTP request to check the status of a task using its ID."
      }
    },
    {
      "id": "a954d6dc-1b64-4d1e-a392-12402835c89a",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        192
      ],
      "parameters": {
        "width": null,
        "height": 272,
        "content": "- Checks the task's output status for success, processing, or failure."
      }
    },
    {
      "id": "6499af47-4f65-4ea3-91ac-1338d35cb6ea",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        96
      ],
      "parameters": {
        "width": null,
        "height": 240,
        "content": "- Downloads the processed video from the output URL provided by the API response."
      }
    },
    {
      "id": "eb47d2db-f087-4379-b0e6-98d05e27121c",
      "name": "Veo 3  API Processor",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -192,
        656
      ]
    },
    {
      "id": "ecde9574-4afd-4662-8bd2-226c58c41188",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        32
      ],
      "parameters": {
        "width": 704,
        "height": 416,
        "content": "## CGI Ad Generation Workflow Using Google Veo3\n\nThis workflow automates the process of creating CGI ads with **Google Veo3 API**, involving video generation, downloading, uploading to Google Drive, a"
      }
    }
  ],
  "connections": {
    "Download Video": {
      "main": [
        [
          {
            "node": "Upload File to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Veo 3  API Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Veo 3  API Processor": {
      "main": [
        [
          {
            "node": "Condition: Check Task Id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for API Response": {
      "main": [
        [
          {
            "node": "API Request: Check Task Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Condition: Check Task Id": {
      "main": [
        [
          {
            "node": "Wait for API Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Email: API Error - Task ID Missing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Task to Complete": {
      "main": [
        [
          {
            "node": "API Request: Check Task Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload File to Google Drive": {
      "main": [
        [
          {
            "node": "Set Google Drive Permissions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Google Drive Permissions": {
      "main": [
        [
          {
            "node": "Send an email : Video Link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Condition: Task Output Status": {
      "main": [
        [
          {
            "node": "Download Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for Task to Complete",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Email: API Error - Task Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "API Request: Check Task Status": {
      "main": [
        [
          {
            "node": "Condition: Task Output Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}