AutomationFlowsAI & RAG › Generate AI Videos with Openai Sora 2 & Upload to Google Drive

Generate AI Videos with Openai Sora 2 & Upload to Google Drive

ByJuan Cristóbal Andrews @crisandrews on n8n.io

This template is designed for filmmakers, content creators, social media managers, and AI developers who want to harness OpenAI's Sora 2 for creating physically accurate, cinematic videos with synchronized audio. Whether you're generating realistic scenes from text prompts or…

Event trigger★★★★☆ complexity21 nodesHTTP RequestForm TriggerFormGoogle Drive
AI & RAG Trigger: Event Nodes: 21 Complexity: ★★★★☆ Added:
Generate AI Videos with Openai Sora 2 & Upload to Google Drive — n8n workflow card showing HTTP Request, Form Trigger, Form integration

This workflow corresponds to n8n.io template #9360 — we link there as the canonical source.

This workflow follows the Form → 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 →

Download .json
{
  "id": "fUtTSVUudypSMWPr",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Sora 2",
  "tags": [],
  "nodes": [
    {
      "id": "6285ad92-d4fb-474d-a27f-4e53064db2ab",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "notes": "30 seconds",
      "position": [
        944,
        176
      ],
      "parameters": {
        "amount": 30
      },
      "notesInFlow": true,
      "typeVersion": 1.1
    },
    {
      "id": "5a1ec7d2-bea1-49e7-8f72-645b00b909b2",
      "name": "Status",
      "type": "n8n-nodes-base.switch",
      "notes": "Decide next step",
      "position": [
        752,
        -32
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Completed",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "debfc1f4-f7ee-48c3-aefb-929fc6a02c17",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "completed"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "In Progress",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "3d03417e-a385-4bf2-992d-2b46a18cde03",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "in_progress"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Queued",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "43850b6f-73fa-4914-af6a-d423c259d993",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "queued"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "cf5a311e-8604-493c-a9cf-05ca7c6aac8c",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "failed"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "notesInFlow": true,
      "typeVersion": 3.2
    },
    {
      "id": "6c4e7f40-d42d-4b43-899a-e04f53e00ea9",
      "name": "Check Status",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Check current status",
      "position": [
        560,
        0
      ],
      "parameters": {
        "url": "=https://api.openai.com/v1/videos/{{ $json.id }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('On form submission').item.json.YOUR_ACCESS_TOKEN }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "b122a24f-b1c1-4986-a2c3-457dc8af4a31",
      "name": "Download",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1184,
        -48
      ],
      "parameters": {
        "url": "=https://api.openai.com/v1/videos/{{ $json.id }}/content",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('On form submission').item.json.YOUR_ACCESS_TOKEN }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0fdf2bcf-7331-4edb-b0c2-20244a34a66c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        -144
      ],
      "parameters": {
        "color": 6,
        "width": 180,
        "height": 576,
        "content": "### Upload Video & Thumbnail to Google Drive"
      },
      "typeVersion": 1
    },
    {
      "id": "26688dc3-c615-49d0-8921-1dd5c6d7ce86",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        -144
      ],
      "parameters": {
        "color": 5,
        "width": 200,
        "height": 576,
        "content": "### Get Generated Video"
      },
      "typeVersion": 1
    },
    {
      "id": "c403a8db-5789-4d14-a9c4-42bb9f28338d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -144
      ],
      "parameters": {
        "color": 4,
        "width": 1140,
        "height": 576,
        "content": "## Sora\n1. Sends the prompt to Sora 2 API endpoint.\n2. Waits for the video rendering to be complete.\n3. Fetches the video id"
      },
      "typeVersion": 1
    },
    {
      "id": "e850e99e-5239-4fdd-92f6-07c2dc430972",
      "name": "Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        -192,
        272
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "78950a7f-e225-430d-a262-e5d82962d231",
              "name": "prompt",
              "type": "string",
              "value": "={{ $json.Prompt }}"
            },
            {
              "id": "083ce6d6-8cd2-4f73-8edd-eecd98002b1c",
              "name": "model",
              "type": "string",
              "value": "={{ $json.Model }}"
            },
            {
              "id": "9d513c9a-a150-42d8-8243-0ba08c9d3093",
              "name": "size",
              "type": "string",
              "value": "={{ $json.Size }}"
            },
            {
              "id": "aa4fa43a-85f5-400b-9b2b-0d0de6590d39",
              "name": "seconds",
              "type": "string",
              "value": "={{ $json.Duration }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "8a86f10f-3c06-4d7f-8a22-1caea453e4f1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -144
      ],
      "parameters": {
        "height": 576,
        "content": "### Settings\n* Model: sora-2 or sora-2-pro\n* Size:\n  * Sora 2: $0.1/sec\n     * Portrait: 720x1280\n     * Landscape: 1280x720\n  * Sora 2 Pro: $0.3/sec\n     * Portrait: 720x1280\n     * Landscape: 1280x720\n  * Sora 2 Pro: $0.5/sec\n     * Portrait: 1024x1792\n     * Landscape: 1792x1024\n* Duration: 4, 8, 12. Default value is 4.\n* Reference: Optional reference in format jpg, png or webp. The image must match the target video\u2019s resolution"
      },
      "typeVersion": 1
    },
    {
      "id": "e01752f8-633f-4238-b568-d9f3cb7a1140",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -480,
        224
      ],
      "parameters": {
        "options": {},
        "formTitle": "OpenAI Sora",
        "formFields": {
          "values": [
            {
              "fieldLabel": "YOUR_ACCESS_TOKEN",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Prompt",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Model",
              "fieldOptions": {
                "values": [
                  {
                    "option": "sora-2"
                  },
                  {
                    "option": "sora-2-pro"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Size",
              "fieldOptions": {
                "values": [
                  {
                    "option": "1280x720"
                  },
                  {
                    "option": "720x1280"
                  },
                  {
                    "option": "1024x1792"
                  },
                  {
                    "option": "1792x1024"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Duration",
              "fieldOptions": {
                "values": [
                  {
                    "option": "4"
                  },
                  {
                    "option": "8"
                  },
                  {
                    "option": "12"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "file",
              "fieldLabel": "Image Reference",
              "multipleFiles": false,
              "acceptFileTypes": ".jpg, .png, .webp"
            }
          ]
        },
        "formDescription": "OpenAI Sora 2 Video Generator"
      },
      "typeVersion": 2.2
    },
    {
      "id": "6e3c9c65-091f-428e-afd0-916d73196fae",
      "name": "Reference",
      "type": "n8n-nodes-base.switch",
      "notes": "Image Reference",
      "position": [
        16,
        112
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "False",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "debfc1f4-f7ee-48c3-aefb-929fc6a02c17",
                    "operator": {
                      "type": "number",
                      "operation": "notExists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $('On form submission').item.json['Image Reference'].size }}",
                    "rightValue": "completed"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "True",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "3d03417e-a385-4bf2-992d-2b46a18cde03",
                    "operator": {
                      "type": "number",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $('On form submission').item.json['Image Reference'].size }}",
                    "rightValue": "in_progress"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "notesInFlow": true,
      "typeVersion": 3.2
    },
    {
      "id": "9e10f930-6817-4123-85d5-532832ef28f0",
      "name": "Create Video B",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "With image reference",
      "position": [
        336,
        224
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/videos",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.prompt }}"
            },
            {
              "name": "model",
              "value": "={{ $json.model }}"
            },
            {
              "name": "size",
              "value": "={{ $json.size }}"
            },
            {
              "name": "seconds",
              "value": "={{ $json.seconds }}"
            },
            {
              "name": "input_reference",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "=Image_Reference"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('On form submission').item.json.YOUR_ACCESS_TOKEN }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "74d10265-af5d-4a91-9082-f16627018373",
      "name": "Create Video A",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Without image reference",
      "position": [
        336,
        0
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/videos",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.prompt }}"
            },
            {
              "name": "model",
              "value": "={{ $json.model }}"
            },
            {
              "name": "size",
              "value": "={{ $json.size }}"
            },
            {
              "name": "seconds",
              "value": "={{ $json.seconds }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('On form submission').item.json.YOUR_ACCESS_TOKEN }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "f23a5c7c-db0c-45e2-9e3c-dc1db548efc3",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        -144
      ],
      "parameters": {
        "color": 3,
        "width": 580,
        "height": 576,
        "content": "### Handle Error, Thumbnail and Download Link"
      },
      "typeVersion": 1
    },
    {
      "id": "5d96a299-f67c-4ee1-ac9b-d5a1374264e1",
      "name": "Failed",
      "type": "n8n-nodes-base.form",
      "position": [
        1920,
        240
      ],
      "parameters": {
        "options": {},
        "operation": "completion",
        "completionTitle": "Error",
        "completionMessage": "=<h2>{{ $json.error.code }}</h2> {{ $json.error.message }}"
      },
      "typeVersion": 1
    },
    {
      "id": "4231bd6a-64f2-4dea-b5c7-a3c1f5cdbca6",
      "name": "Completed",
      "type": "n8n-nodes-base.form",
      "position": [
        1920,
        48
      ],
      "parameters": {
        "options": {},
        "operation": "completion",
        "completionTitle": "Generation Completed",
        "completionMessage": "=<a href=\"{{ $json.content[0].webViewLink }}\"><img src=\"{{ $json.content[1].thumbnailLink }}\"><a>\n<br>\n<b><a href=\"{{ $json.content[0].webViewLink }}\">Download</a></b>"
      },
      "typeVersion": 1
    },
    {
      "id": "1e4887e9-8236-4d87-b703-bb57142b6407",
      "name": "Thumbnail1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1184,
        144
      ],
      "parameters": {
        "url": "=https://api.openai.com/v1/videos/{{ $json.id }}/content",
        "options": {
          "redirect": {
            "redirect": {}
          },
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "thumbnail.webp"
            }
          }
        },
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "variant",
              "value": "thumbnail"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('On form submission').item.json.YOUR_ACCESS_TOKEN }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "58c457f8-4d8d-40c7-b2df-a2a4f3b93d80",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1616,
        48
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "de9cc0c1-a726-4935-83d0-da4aefbd7440",
      "name": "Upload Video",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1408,
        -48
      ],
      "parameters": {
        "name": "={{ $json.id }}.mp4",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1hUOUwcbOPpkfT4zCOGCju61qXVC3uenw",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1hUOUwcbOPpkfT4zCOGCju61qXVC3uenw",
          "cachedResultName": "Sora"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "26f032a9-d6d2-40a3-bdd3-32c985b7bbb6",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1776,
        48
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "content"
      },
      "typeVersion": 1
    },
    {
      "id": "1899d016-5475-41b8-82e2-9b07727f617e",
      "name": "Upload Thumbnail",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1408,
        144
      ],
      "parameters": {
        "name": "={{ $json.id }}.webp",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1hUOUwcbOPpkfT4zCOGCju61qXVC3uenw",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1hUOUwcbOPpkfT4zCOGCju61qXVC3uenw",
          "cachedResultName": "Sora"
        },
        "inputDataFieldName": "thumbnail.webp"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "63abde8c-6130-44a4-a4a4-51deacb87fed",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status": {
      "main": [
        [
          {
            "node": "Download",
            "type": "main",
            "index": 0
          },
          {
            "node": "Thumbnail1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download": {
      "main": [
        [
          {
            "node": "Upload Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Settings": {
      "main": [
        [
          {
            "node": "Reference",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Completed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reference": {
      "main": [
        [
          {
            "node": "Create Video A",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Video B",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Thumbnail1": {
      "main": [
        [
          {
            "node": "Upload Thumbnail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Status": {
      "main": [
        [
          {
            "node": "Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video A": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video B": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Thumbnail": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Settings",
            "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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This template is designed for filmmakers, content creators, social media managers, and AI developers who want to harness OpenAI's Sora 2 for creating physically accurate, cinematic videos with synchronized audio. Whether you're generating realistic scenes from text prompts or…

Source: https://n8n.io/workflows/9360/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow is ideal for content creators, video marketers, and research professionals who need to extract actionable insights, detailed transcripts, or metadata from YouTube videos efficiently. It

HTTP Request, Google Drive, Gmail +2
AI & RAG

This n8n workflow automatically generates professional e-commerce product mockups from product images. The workflow is perfect for e-commerce store owners, product marketers, and content creators who

HTTP Request, OpenAI, Form Trigger +2
AI & RAG

Legal, Procurement, and Compliance teams at mid-size companies. ESN and agencies selling AI-powered contract review as a service.

Form Trigger, HTTP Request, Form +4
AI & RAG

Transform text prompts into stunning images or edit existing visuals using OpenAI's latest GPT-4 Vision model through an intuitive web form interface.

Google Drive, HTTP Request, Form Trigger +1
AI & RAG

This template can be used to find the content gaps in PDF documents using the InfraNodus knowledge graph / GraphRAG text representation and then generate ideas / questions / AI prompts that bridge tho

HTTP Request, Form Trigger, Form