This workflow corresponds to n8n.io template #10861 — we link there as the canonical source.
This workflow follows the Emailsend → Form Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "a1b4a7ad-efec-4a7c-a7d0-057b01cae303",
"name": "On form submission",
"type": "n8n-nodes-base.formTrigger",
"position": [
384,
560
],
"parameters": {
"options": {},
"formTitle": "CGI Ads With Sora 2",
"formFields": {
"values": [
{
"fieldLabel": "Prompt",
"placeholder": "Prompt Put Here",
"requiredField": true
}
]
},
"formDescription": "CGI Ads With Sora 2"
},
"typeVersion": 2.2
},
{
"id": "66f9b398-16c5-4aeb-b677-2c1e3031a4c5",
"name": "Wait for API Response",
"type": "n8n-nodes-base.wait",
"position": [
1056,
32
],
"parameters": {
"amount": 60
},
"typeVersion": 1.1
},
{
"id": "0af22a6f-812c-4c1c-9a89-b06adeaaed47",
"name": "API Request: Check Task Status",
"type": "n8n-nodes-base.httpRequest",
"position": [
1392,
96
],
"parameters": {
"url": "=https://sora-2-openai.p.rapidapi.com/result.php",
"options": {},
"sendQuery": true,
"sendHeaders": true,
"queryParameters": {
"parameters": [
{
"name": "predictionId",
"value": "={{ $json.predictionId }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "x-rapidapi-host",
"value": "sora-2-openai.p.rapidapi.com"
},
{
"name": "x-rapidapi-key",
"value": "your key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "b5c2a32a-b64e-4997-bfe8-5b4816cf1b26",
"name": "Condition: Task Output Status",
"type": "n8n-nodes-base.switch",
"position": [
1712,
208
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "c4f6d7db-48e4-4733-bb97-f79256367a3b",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "success"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "eafc0f97-f13f-4788-bf2b-55f1dadea642",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "=generating"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "77a91a1f-9308-4a30-81d5-12ee1730eb07",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "failed"
}
]
}
}
]
},
"options": {},
"looseTypeValidation": true
},
"typeVersion": 3.2
},
{
"id": "24483c85-ba67-433e-83aa-9852e88065a7",
"name": "Wait for Task to Complete",
"type": "n8n-nodes-base.wait",
"position": [
1088,
320
],
"parameters": {
"amount": 60
},
"typeVersion": 1.1
},
{
"id": "b966188f-dd27-453b-b029-d0b720ac3598",
"name": "Send Email: API Error - Task ID Missing",
"type": "n8n-nodes-base.emailSend",
"position": [
2144,
832
],
"parameters": {
"html": "Hey This Just Inform To You API Doesn't Return Prediction id",
"options": {},
"subject": "Failed To Get Prediction ID",
"toEmail": "user@example.com",
"fromEmail": "user@example.com"
},
"credentials": {
"smtp": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "ddde32c8-f9dc-40cf-8180-b232bb40d6a8",
"name": "Upload File to Google Drive",
"type": "n8n-nodes-base.googleDrive",
"position": [
2656,
192
],
"parameters": {
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "root",
"cachedResultName": "/ (Root folder)"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "973a3938-043f-4ce7-8122-e7d1946c24c0",
"name": "Send Email: API Error - Task Failed",
"type": "n8n-nodes-base.emailSend",
"position": [
2432,
496
],
"parameters": {
"html": "Task id : {{ $json.id }}\nFailed to generate video.",
"options": {},
"subject": "Failed To Generate Image ",
"toEmail": "user@example.com",
"fromEmail": "user@example.com"
},
"credentials": {
"smtp": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "5e5256dd-e767-484d-8b4f-c0dc62b71f9d",
"name": "Set Google Drive Permissions",
"type": "n8n-nodes-base.googleDrive",
"position": [
2944,
192
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {},
"resource": "file",
"operation": "share",
"permissionsUi": {},
"authentication": "oAuth2"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "e7c87caf-cf15-4b6a-8648-22ff8bfa764f",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
2080,
752
],
"parameters": {
"height": 240,
"content": "Sends an error email if the prediction id is missing in the response."
},
"typeVersion": 1
},
{
"id": "5132d3ef-ee14-4d7e-80db-03c756933aa9",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
2576,
128
],
"parameters": {
"height": 224,
"content": "Uploads the processed video to Google Drive."
},
"typeVersion": 1
},
{
"id": "5fa2259b-54dc-4974-9198-730ba8e756e9",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
2880,
128
],
"parameters": {
"height": 208,
"content": "Sets the necessary permissions for the uploaded Google Drive file."
},
"typeVersion": 1
},
{
"id": "ce288355-cc9e-4677-a1c2-3e2d329be59f",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
2368,
432
],
"parameters": {
"height": 240,
"content": "Sends an email if the video generation task fails"
},
"typeVersion": 1
},
{
"id": "fe19829a-6780-450f-b291-295e1afcd0d7",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
3232,
160
],
"parameters": {
"content": "Sends an email if the video generation is completed "
},
"typeVersion": 1
},
{
"id": "e2f94f99-24d9-45ce-b69e-b2971b44b4a3",
"name": "Send an email : Video Link",
"type": "n8n-nodes-base.emailSend",
"position": [
3296,
208
],
"parameters": {
"html": "=Hey , \nYour video is ready.\nLink : {{ $('Upload File to Google Drive').item.json.webViewLink }}",
"options": {},
"toEmail": "user@example.com",
"fromEmail": "user@example.com"
},
"credentials": {
"smtp": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "adeb491a-668c-47ef-bcff-31058cc05087",
"name": "Download Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
2320,
128
],
"parameters": {
"url": "={{ $json.resultUrls[0] }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "97397cd2-7d14-453b-a570-479027546e33",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
320,
448
],
"parameters": {
"height": 272,
"content": " - Triggers the workflow when a form is submitted with a prompt field."
},
"typeVersion": 1
},
{
"id": "dfac4580-4985-4f83-8374-2d5052d4b298",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
752,
496
],
"parameters": {
"height": 240,
"content": " - Processes the form's prompt by making an API call to the Sora\" API."
},
"typeVersion": 1
},
{
"id": "ef977b46-0269-4d63-b1fa-dbbe25d0f3eb",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1184,
480
],
"parameters": {
"height": 240,
"content": " - Checks if the prediction id is present before continuing; sends an error email if missing."
},
"typeVersion": 1
},
{
"id": "07715224-0b63-4416-9441-66f5f486cce2",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1008,
-80
],
"parameters": {
"height": 256,
"content": " - Waits for 60 seconds to allow the API response to be processed."
},
"typeVersion": 1
},
{
"id": "a5f6343f-e434-4514-96d6-296a843e342f",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1024,
224
],
"parameters": {
"height": 256,
"content": " - Waits for 60 seconds before rechecking the task\u2019s completion status."
},
"typeVersion": 1
},
{
"id": "4ee1be65-7a6d-4fc2-8e38-ab85dc1bf989",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1312,
16
],
"parameters": {
"height": 208,
"content": " - Sends an HTTP request to check the status of a task using its ID."
},
"typeVersion": 1
},
{
"id": "0ab9da31-c810-4693-a72b-fa0828d94f2e",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
1632,
112
],
"parameters": {
"height": 272,
"content": "- Checks the task's output status for success, processing, or failure."
},
"typeVersion": 1
},
{
"id": "f38dbac6-555d-4ad3-830d-9ecb8ba9dba8",
"name": "Sticky Note12",
"type": "n8n-nodes-base.stickyNote",
"position": [
2224,
16
],
"parameters": {
"height": 240,
"content": "- Downloads the processed video from the output URL provided by the API response."
},
"typeVersion": 1
},
{
"id": "6510719b-49cf-4264-985b-1ed5b98b1a9f",
"name": "Sora API Processor",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
816,
576
],
"parameters": {
"url": "https://sora-2-openai.p.rapidapi.com/txttovideo.php ",
"method": "POST",
"options": {},
"jsonBody": "={\n \"prompt\": \"{{ $json.Prompt }}\",\n \"quality\": \"hd\",\n \"aspect_ratio\": \"landscape\"\n}",
"sendBody": true,
"contentType": "=json",
"sendHeaders": true,
"specifyBody": "json",
"bodyParameters": {
"parameters": [
{}
]
},
"headerParameters": {
"parameters": [
{
"name": "x-rapidapi-host",
"value": "sora-2-openai.p.rapidapi.com"
},
{
"name": "x-rapidapi-key",
"value": "your key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "d069c2dc-7576-478f-8510-4beb55871bff",
"name": "Condition: Check Prediction Id",
"type": "n8n-nodes-base.if",
"position": [
1248,
576
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "bcc58e3d-9609-4ec3-adb9-bc6098205818",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.predictionId }}",
"rightValue": "success"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "76ad91e0-b5df-45c3-b34e-cd89fe08a21b",
"name": "Clean Output ",
"type": "n8n-nodes-base.code",
"position": [
1984,
144
],
"parameters": {
"jsCode": "// Parse the JSON from the input\nconst data = JSON.parse($input.first().json.result);\n\n// Extract only the 'resultUrls' from the parsed data\nreturn [\n {\n json: {\n resultUrls: data.resultUrls\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "07c69a90-bfd1-4306-9c48-b1699e2d680f",
"name": "Sticky Note13",
"type": "n8n-nodes-base.stickyNote",
"position": [
1920,
64
],
"parameters": {
"height": 224,
"content": "- Clean output & process result Url."
},
"typeVersion": 1
},
{
"id": "520e1e44-1cce-47de-bc03-0a3c2b6927c5",
"name": "Sticky Note14",
"type": "n8n-nodes-base.stickyNote",
"position": [
-384,
352
],
"parameters": {
"width": 528,
"height": 528,
"content": "**CGI Ads with Sora 2: Seamless Integration and Video Generation**\n\n### Workflow Overview:\n\nThis automation flow allows you to seamlessly generate CGI Ads using Sora 2 and integrate them into your business workflow. Here's a brief overview of the process:\n\n1. **Form Submission**: The workflow is triggered when a user submits a form with a prompt.\n2. **Sora API Request**: The submitted prompt is sent to the Sora API to generate the video.\n3. **Check Task Status**: The system waits for the API response and checks the status of the video generation task.\n4. **Task Output Validation**: If the task is successful, the result URLs are processed, and the video is downloaded.\n5. **Upload to Google Drive**: The generated video is uploaded to Google Drive and shared with the appropriate permissions.\n6. **Send Notification**: Once the video is ready, an email is sent to the user with a link to access the video.\n\nThis workflow helps automate the process from video generation to sharing, saving time and ensuring a smooth experience for both developers and users.\n"
},
"typeVersion": 1
}
],
"connections": {
"Clean Output ": {
"main": [
[
{
"node": "Download Video",
"type": "main",
"index": 0
}
]
]
},
"Download Video": {
"main": [
[
{
"node": "Upload File to Google Drive",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Sora API Processor",
"type": "main",
"index": 0
}
]
]
},
"Sora API Processor": {
"main": [
[
{
"node": "Condition: Check Prediction Id",
"type": "main",
"index": 0
}
]
]
},
"Wait for API Response": {
"main": [
[
{
"node": "API Request: Check Task Status",
"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": "Clean Output ",
"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
}
]
]
},
"Condition: Check Prediction Id": {
"main": [
[
{
"node": "Wait for API Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Email: API Error - Task ID Missing",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleDriveOAuth2Apismtp
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
The Sora 2 API allows seamless generation of CGI ads, turning text prompts into stunning videos. This workflow automates the entire process from video generation to upload, notification, and file sharing via Google Drive. On form submission: Triggers the workflow when a form…
Source: https://n8n.io/workflows/10861/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Create CGI ads effortlessly by integrating the Google Veo3 API for video generation and uploading to Google Drive with seamless email notifications. On form submission: Triggers the workflow when a fo
This workflow automates the process of generating videos using the Veo 3 Fast API, uploading the video to Google Drive, and notifying the user via email. All tasks are executed seamlessly, ensuring a
Automate downloading of Bilibili videos via the Bilibili Video Downloader API (RapidAPI), upload them to Google Drive, and notify users by email — all using n8n workflow automation.
Automated IMDB Video Downloader: Download, Upload to Google Drive & Notify via Email
Formtrigger Workflow. Uses formTrigger, googleDrive, httpRequest, stopAndError. Event-driven trigger; 28 nodes.