CGI Video Generation, Sora API Polling, and Google Drive Upload - n8n Workflow

Use this powerful n8n workflow to generate CGI videos via Sora 2 API, manage asynchronous status checks, automatically upload files to Google Drive, and notify users via email.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing agencies needing automated video creation pipelines.
Developers looking for advanced n8n templates integrating external AI services.
Businesses requiring automated content generation workflows.
Users who need to automate asynchronous API polling using an n8n workflow.

Overview

This sophisticated n8n workflow provides a complete solution for turning text prompts into high-quality CGI videos using the Sora 2 API. It solves the challenge of handling asynchronous API requests by implementing a robust polling mechanism, ensuring the automation waits efficiently for the video generation to complete. Once the video is successfully created, this n8n template automatically downloads the asset, uploads it directly to Google Drive, sets the necessary sharing permissions, and immediately alerts the requester with a direct link. This comprehensive n8n node sequence eliminates manual steps in content production and delivery, offering a powerful example of what the n8n automation platform can achieve.

How it Works


  1. Trigger: The process begins when a user submits the CGI Ads With Sora 2 form, which serves as the initial n8n trigger, capturing the text prompt.

  2. API Initiation: The prompt is passed to the Sora API Processor n8n node, initiating the video generation task with the Sora 2 API and returning a predictionId.

  3. ID Check & Initial Wait: An IF condition (Condition: Check Prediction Id) checks for the presence of the predictionId. If missing, an error email is sent. If present, the n8n workflow pauses for 60 seconds (Wait for API Response).

  4. Polling Loop: The API Request: Check Task Status node repeatedly polls the Sora API using the predictionId to monitor the job's current status.

  5. Status Routing: The Switch n8n node (Condition: Task Output Status) directs the flow:

If the status is generating, it enters a second 60-second wait period (Wait for Task to Complete) before re-checking the status, establishing an effective polling loop for this n8n workflow.
If the status is failed, a failure email is dispatched.
* If the status is success, the flow proceeds to post-processing.

  1. Download and Storage: The Clean Output n8n node extracts the successful video URL. The video is downloaded by the Download Video node, uploaded to Google Drive, and permissions are set.

  2. Final Notification: A final success email containing the Google Drive share link is sent to the specified recipient, completing the fully automated n8n workflow.

Installation Guide


  1. Import the n8n workflow JSON: Copy the provided JSON and import it into your n8n instance via the 'Workflows' menu.

  2. Sora API Configuration: Update the Sora API Processor and API Request: Check Task Status n8n nodes with your actual RapidAPI key in the x-rapidapi-key header field.

  3. Google Drive Setup: Configure the Google Drive credentials in the Upload File to Google Drive and Set Google Drive Permissions nodes. Ensure the scope includes file creation and sharing capabilities.

  4. SMTP Setup: Configure the SMTP credentials in all Send Email n8n nodes (Send an email : Video Link, Send Email: API Error - Task Failed, etc.) and replace placeholder email addresses (e.g., [email protected], [email protected]) with your desired notification addresses.

  5. Form Activation: Activate the On form submission n8n trigger node to generate the public webhook URL for your form and test the n8n template.

Node Details

On form submission (n8n trigger): Initiates the n8n workflow upon submission of the internal web form, capturing the essential Prompt field.
Sora API Processor (HTTP Request n8n node): Sends the user prompt to the external Sora 2 API using a POST method to begin video creation. Configured with required API keys.
Condition: Check Prediction Id (If n8n node): Essential logic flow control; ensures the n8n workflow continues only if a valid task ID is returned.
Wait for API Response / Wait for Task to Complete (Wait n8n node): Implements 60-second time delays, managing the asynchronous polling necessary for this type of n8n workflow.
Condition: Task Output Status (Switch n8n node): Manages the polling logic, routing the flow based on statuses like success, generating (which loops back to the wait node), or failed.
Clean Output (Code n8n node): Uses custom JavaScript code to parse the successful API response and extract the specific video resultUrls needed for the next steps in the n8n template.
Download Video (HTTP Request n8n node): Downloads the generated video file content using the URL provided by the AI API.
Upload File to Google Drive (Google Drive n8n node): Handles cloud storage integration, taking the downloaded file and uploading it to the specified Google Drive folder.


  • Send an email : Video Link (Email Send n8n node): The final action n8n node, notifying the user with the direct share link to the newly generated CGI video.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by
Sk developer
Sk developer

Featured*