Sora 2
Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 21 nœuds.Utilise principalement des nœuds comme Set, Form, Wait, Merge, Switch. Générez des vidéos IA avec OpenAI Sora 2 et téléchargez-les sur Google Drive
- •Informations d'identification Google Drive API
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
Nœuds utilisés (21)
Catégorie
{
"id": "fUtTSVUudypSMWPr",
"meta": {
"instanceId": "69cb24484ded4b91a528eddf1eab8f391c66f63b5d8162ce8f6f60ffd7b0e0d1",
"templateCredsSetupCompleted": true
},
"name": "Sora 2",
"tags": [],
"nodes": [
{
"id": "6285ad92-d4fb-474d-a27f-4e53064db2ab",
"name": "Attente",
"type": "n8n-nodes-base.wait",
"notes": "30 seconds",
"position": [
944,
176
],
"webhookId": "d6b5d4ee-dce9-4053-97c0-75b49c1158a4",
"parameters": {
"amount": 30
},
"notesInFlow": true,
"typeVersion": 1.1
},
{
"id": "5a1ec7d2-bea1-49e7-8f72-645b00b909b2",
"name": "Statut",
"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": "Vérifier le statut",
"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": "Télécharger",
"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": "Note adhésive 3",
"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": "Note adhésive 2",
"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": "Note adhésive 1",
"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": "Paramètres",
"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": "Note adhésive 4",
"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’s resolution"
},
"typeVersion": 1
},
{
"id": "e01752f8-633f-4238-b568-d9f3cb7a1140",
"name": "À la soumission du formulaire",
"type": "n8n-nodes-base.formTrigger",
"position": [
-480,
224
],
"webhookId": "1c041721-9e17-4486-927e-d2de9a113977",
"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": "Référence",
"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": "Créer la vidéo 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": "Créer la vidéo 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": "Note adhésive",
"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": "Échec",
"type": "n8n-nodes-base.form",
"position": [
1920,
240
],
"webhookId": "898add9e-df30-4b09-aa45-9773a250f79d",
"parameters": {
"options": {},
"operation": "completion",
"completionTitle": "Error",
"completionMessage": "=<h2>{{ $json.error.code }}</h2> {{ $json.error.message }}"
},
"typeVersion": 1
},
{
"id": "4231bd6a-64f2-4dea-b5c7-a3c1f5cdbca6",
"name": "Terminé",
"type": "n8n-nodes-base.form",
"position": [
1920,
48
],
"webhookId": "4fb73428-39f7-44c8-b7ff-287fa4aa745b",
"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": "Miniature 1",
"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": "Fusionner",
"type": "n8n-nodes-base.merge",
"position": [
1616,
48
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "de9cc0c1-a726-4935-83d0-da4aefbd7440",
"name": "Téléverser la vidéo",
"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": {
"id": "rqC0SH1li8N0Qvrg",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "26f032a9-d6d2-40a3-bdd3-32c985b7bbb6",
"name": "Agréger",
"type": "n8n-nodes-base.aggregate",
"position": [
1776,
48
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData",
"destinationFieldName": "content"
},
"typeVersion": 1
},
{
"id": "1899d016-5475-41b8-82e2-9b07727f617e",
"name": "Téléverser la miniature",
"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": {
"id": "rqC0SH1li8N0Qvrg",
"name": "Google Drive account"
}
},
"typeVersion": 3
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "63abde8c-6130-44a4-a4a4-51deacb87fed",
"connections": {
"6285ad92-d4fb-474d-a27f-4e53064db2ab": {
"main": [
[
{
"node": "6c4e7f40-d42d-4b43-899a-e04f53e00ea9",
"type": "main",
"index": 0
}
]
]
},
"58c457f8-4d8d-40c7-b2df-a2a4f3b93d80": {
"main": [
[
{
"node": "26f032a9-d6d2-40a3-bdd3-32c985b7bbb6",
"type": "main",
"index": 0
}
]
]
},
"5a1ec7d2-bea1-49e7-8f72-645b00b909b2": {
"main": [
[
{
"node": "b122a24f-b1c1-4986-a2c3-457dc8af4a31",
"type": "main",
"index": 0
},
{
"node": "1e4887e9-8236-4d87-b703-bb57142b6407",
"type": "main",
"index": 0
}
],
[
{
"node": "6285ad92-d4fb-474d-a27f-4e53064db2ab",
"type": "main",
"index": 0
}
],
[
{
"node": "6285ad92-d4fb-474d-a27f-4e53064db2ab",
"type": "main",
"index": 0
}
],
[
{
"node": "5d96a299-f67c-4ee1-ac9b-d5a1374264e1",
"type": "main",
"index": 0
}
]
]
},
"b122a24f-b1c1-4986-a2c3-457dc8af4a31": {
"main": [
[
{
"node": "de9cc0c1-a726-4935-83d0-da4aefbd7440",
"type": "main",
"index": 0
}
]
]
},
"e850e99e-5239-4fdd-92f6-07c2dc430972": {
"main": [
[
{
"node": "6e3c9c65-091f-428e-afd0-916d73196fae",
"type": "main",
"index": 0
}
]
]
},
"26f032a9-d6d2-40a3-bdd3-32c985b7bbb6": {
"main": [
[
{
"node": "4231bd6a-64f2-4dea-b5c7-a3c1f5cdbca6",
"type": "main",
"index": 0
}
]
]
},
"6e3c9c65-091f-428e-afd0-916d73196fae": {
"main": [
[
{
"node": "74d10265-af5d-4a91-9082-f16627018373",
"type": "main",
"index": 0
}
],
[
{
"node": "9e10f930-6817-4123-85d5-532832ef28f0",
"type": "main",
"index": 0
}
]
]
},
"1e4887e9-8236-4d87-b703-bb57142b6407": {
"main": [
[
{
"node": "1899d016-5475-41b8-82e2-9b07727f617e",
"type": "main",
"index": 0
}
]
]
},
"6c4e7f40-d42d-4b43-899a-e04f53e00ea9": {
"main": [
[
{
"node": "5a1ec7d2-bea1-49e7-8f72-645b00b909b2",
"type": "main",
"index": 0
}
]
]
},
"de9cc0c1-a726-4935-83d0-da4aefbd7440": {
"main": [
[
{
"node": "58c457f8-4d8d-40c7-b2df-a2a4f3b93d80",
"type": "main",
"index": 0
}
]
]
},
"74d10265-af5d-4a91-9082-f16627018373": {
"main": [
[
{
"node": "6c4e7f40-d42d-4b43-899a-e04f53e00ea9",
"type": "main",
"index": 0
}
]
]
},
"9e10f930-6817-4123-85d5-532832ef28f0": {
"main": [
[
{
"node": "6c4e7f40-d42d-4b43-899a-e04f53e00ea9",
"type": "main",
"index": 0
}
]
]
},
"1899d016-5475-41b8-82e2-9b07727f617e": {
"main": [
[
{
"node": "58c457f8-4d8d-40c7-b2df-a2a4f3b93d80",
"type": "main",
"index": 1
}
]
]
},
"e01752f8-633f-4238-b568-d9f3cb7a1140": {
"main": [
[
{
"node": "e850e99e-5239-4fdd-92f6-07c2dc430972",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Avancé - Création de contenu, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Partager ce workflow