This workflow follows the Agent → 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 →
{
"name": "AI Video Generator",
"nodes": [
{
"parameters": {
"promptType": "define",
"text": "={{ $json[\"video image propmt\"] }}",
"hasOutputParser": true,
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.7,
"position": [
440,
0
],
"id": "eba995fa-ba39-4c50-ae74-924c357d6a0d",
"name": "AI Agent"
},
{
"parameters": {
"modelName": "models/gemini-2.0-pro-exp",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
400,
220
],
"id": "a4483649-d6fb-4a29-8784-c6cb36d3d48e",
"name": "Google Gemini Chat Model",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsonSchemaExample": "{\n\t\"prompts\": [\"Los Angeles\", \"San Francisco\", \"San Diego\"]\n}"
},
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"typeVersion": 1.2,
"position": [
620,
240
],
"id": "6ae102cd-22d9-4f4f-8daf-398ce0048b91",
"name": "Structured Output Parser"
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
1060,
0
],
"id": "259648a8-5996-4b17-98a1-e9aae760fb6e",
"name": "Loop Over Items"
},
{
"parameters": {
"fieldToSplitOut": "output.prompts",
"options": {}
},
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"position": [
800,
0
],
"id": "bd42119e-5fcb-488f-bf7c-30ad29528f3c",
"name": "Split Out"
},
{
"parameters": {
"method": "POST",
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp-image-generation:generateContent?key=YOUR_API_KEY",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"contents\": [{\n \"parts\": [\n {\"text\": \"Hi, can you create a 3d rendered image of {{ $json[\"output.prompts\"] }} it should be very relastic and modern and it size should be veritcal for example width:1080 - height: 1920\"}\n ]\n }],\n \"generationConfig\":{\"responseModalities\":[\"Text\",\"Image\"]}\n }",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1300,
20
],
"id": "e6d37ef1-4d50-4ec1-b142-3ed01366b195",
"name": "HTTP Request"
},
{
"parameters": {
"operation": "toBinary",
"sourceProperty": "candidates[0].content.parts[0].inlineData.data",
"options": {}
},
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
1300,
280
],
"id": "a5885dd4-fc71-49d1-84a7-990f2c022d7d",
"name": "Convert to File"
},
{
"parameters": {
"name": "={{ $('Loop Over Items').item.json[\"output.prompts\"].replaceAll(\" \",\"\") }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"folderId": {
"__rl": true,
"mode": "list",
"value": "root",
"cachedResultName": "/ (Root folder)"
},
"options": {}
},
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 3,
"position": [
1060,
280
],
"id": "9de98f3c-d947-488d-83a2-0e4fc70c242e",
"name": "Google Drive",
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "const result = [];\n\nfor (let i = 0; i < $input.all().length; i++) {\n result.push({\n id: `img_${i}`,\n type: \"image\",\n src: $input.all()[i].json.imageUrl.slice(0,-5),\n width: 1080,\n height: 1920,\n x: 0,\n y: 0,\n duration: 3,\n pan: \"left\",\n \"fade-in\": 1,\n start: 3 + i * 3\n });\n\n result.push({\n id: `txt_${i}`,\n type: \"text\",\n style: \"002\",\n settings: {\n \"font-size\": \"12vw\",\n \"font-family\": \"Arial\"\n },\n start: 3 + i * 3,\n duration: 3,\n \"fade-in\": 1,\n x: 3,\n y: 757,\n text: `${i + 1}`\n });\n}\n\nreturn result;"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1480,
-140
],
"id": "71b86826-da7e-495a-93ad-7edb03cf7f6e",
"name": "Code"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "df69e4bd-c474-4903-be78-7981f299b8bf",
"name": "imageUrl",
"value": "={{ $json.thumbnailLink }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1300,
-140
],
"id": "af024190-57bb-4249-94ce-a2e8fb602ab7",
"name": "Edit Fields"
},
{
"parameters": {
"amount": 500
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
2000,
-140
],
"id": "f76aa332-82be-4b37-a1f3-b174fa37cc35",
"name": "Wait"
},
{
"parameters": {
"resource": "video",
"operation": "upload",
"title": "={{ $('On form submission').first().json['video caption'] }}",
"regionCode": "TR",
"categoryId": "1",
"options": {
"description": "=Merhaba! YouTube kanal\u0131mda, izlerken g\u00fclmekten kendinizi alamayaca\u011f\u0131n\u0131z e\u011flenceli ve komik videolar bulabilirsiniz. Kanal\u0131mda, pop\u00fcler klipleri T\u00fcrk\u00e7e altyaz\u0131larla payla\u015farak, hem e\u011flenceyi hem de dili birle\u015ftiriyorum. Farkl\u0131 i\u00e7erikler ve esprili alt yaz\u0131larla her ya\u015ftan izleyiciye hitap ediyorum. Videolar\u0131mda g\u00fcld\u00fcren anekdotlar, ilgin\u00e7 diyaloglar ve s\u00fcrprizler sizi bekliyor! Amac\u0131m yaln\u0131zca insanlar\u0131 g\u00fcld\u00fcrmek ve e\u011flendirmek. Stresi bir kenara b\u0131rak\u0131p, keyifli bir deneyim ya\u015famak isteyenler i\u00e7in do\u011fru yerdesiniz!\n\nHer videoda, g\u00fclmek i\u00e7in bir neden bulacaks\u0131n\u0131z! \u00d6zellikle T\u00fcrk\u00e7e altyaz\u0131 ve e\u011flenceli metinlerle izleyicilerimi g\u00fcld\u00fcrmeyi hedefliyorum. G\u00fclmeyi \u00f6zleyen, y\u00fczlerinde bir tebess\u00fcm g\u00f6rmek isteyen ve s\u0131k\u0131c\u0131 g\u00fcnlerinden kurtulmak isteyen herkese hitap ediyorum. E\u011flenceli videolarla dolu kanal\u0131mda zaman ge\u00e7irmek, kahkahalarla dolu bir d\u00fcnyaya ad\u0131m atmak istiyorsan\u0131z abone olmay\u0131 unutmay\u0131n! Burada, sadece g\u00fclen y\u00fczler g\u00f6rmek i\u00e7in yer var!\n\n#E\u011flence #Komedi #T\u00fcrk\u00e7eAltyaz\u0131 #G\u00fclmek\u0130\u00e7in #MutluOl #Kahkaha #E\u011flenceliVideolar #KomikAnlar #G\u00fcl\u00fcmse #KliplerleE\u011flence #E\u011flenceli\u0130\u00e7erik #G\u00fclmekZaman\u0131 #T\u00fcrk\u00e7eAltyaz\u0131l\u0131 #E\u011flenceKanali",
"notifySubscribers": true,
"publicStatsViewable": true,
"selfDeclaredMadeForKids": false,
"tags": "E\u011flence, Komedi, Film, Dizi, GOT, Game Of Thrones, Jon Snow"
}
},
"type": "n8n-nodes-base.youTube",
"typeVersion": 1,
"position": [
2520,
-140
],
"id": "b2ed5583-6c00-43d9-84bf-67ba8e464cf5",
"name": "YouTube",
"credentials": {
"youTubeOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"method": "POST",
"url": "https://api.json2video.com/v2/movies",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "YOUR_API_KEY"
}
]
},
"sendBody": true,
"contentType": "raw",
"rawContentType": "application/json",
"body": "={\n \"id\": \"q72196y7\",\n \"resolution\": \"instagram-story\",\n \"quality\": \"high\",\n \"draft\": true,\n \"scenes\": [\n {\n \"id\": \"qzdzn1q3\",\n \"elements\": [\n {\n \"id\": \"qny2isg3\",\n \"type\": \"video\",\n \"width\": 3413,\n \"height\": 1920,\n \"x\": -8,\n \"y\": -8,\n \"src\": \"https://videos.pexels.com/video-files/2126081/2126081-uhd_2560_1440_24fps.mp4\",\n \"start\": 0,\n \"duration\": 3\n },\n {\n \"id\": \"qtg3b2el\",\n \"type\": \"text\",\n \"style\": \"002\",\n \"text\": \"{{ $('On form submission').first().json['video caption'] }}\",\n \"settings\": {\n \"color\": \"#FFFFFF\",\n \"font-size\": \"80px\",\n \"font-family\": \"Roboto Condensed\",\n \"shadow\": 2,\n \"text-align\": \"left\",\n \"vertical-align\": \"top\"\n },\n \"width\": 808,\n \"x\": 172,\n \"y\": 765,\n \"height\": 396,\n \"start\": 0,\n \"duration\": 3\n },\n {\n \"id\": \"qgdxzl3u\",\n \"type\": \"audio\",\n \"src\": \"https://ncsmusic.s3.eu-west-1.amazonaws.com/tracks/000/001/769/ark-slowed-1727366513-EYEsh6OTuC.mp3\",\n \"duration\": 16,\n \"start\": 0\n },\n {{ $json.data.map(item => JSON.stringify(item)) }}\n ]\n }\n ],\n \"elements\": [],\n \"width\": 1080,\n \"height\": 1920\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1820,
-140
],
"id": "356eb55b-efc1-4b43-8972-0e6ee8e4f536",
"name": "HTTP Request3"
},
{
"parameters": {
"aggregate": "aggregateAllItemData",
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
1660,
-140
],
"id": "b4ff1aef-068e-4c6d-8054-350277b3420f",
"name": "Aggregate"
},
{
"parameters": {
"url": "=https://api.json2video.com/v2/movies/?project={{ $json.project }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "YOUR_API_KEY"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
2160,
-140
],
"id": "49943ecb-b804-48b0-a2c2-83cb1a450d56",
"name": "HTTP Request1"
},
{
"parameters": {
"url": "={{ $json.movie.url }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
2340,
-140
],
"id": "22b10feb-c710-451c-a255-5a2ab55b2fcb",
"name": "HTTP Request2"
},
{
"parameters": {
"formTitle": "Video title and content form",
"formDescription": "Video content form",
"formFields": {
"values": [
{
"fieldLabel": "video image propmt",
"requiredField": true
},
{
"fieldLabel": "video caption",
"requiredField": true
}
]
},
"options": {}
},
"type": "n8n-nodes-base.formTrigger",
"typeVersion": 2.2,
"position": [
220,
0
],
"id": "1df03108-5f0a-4a92-8407-222bd4aa86b3",
"name": "On form submission"
}
],
"connections": {
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "AI Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
],
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Convert to File",
"type": "main",
"index": 0
}
]
]
},
"Convert to File": {
"main": [
[
{
"node": "Google Drive",
"type": "main",
"index": 0
}
]
]
},
"Google Drive": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "HTTP Request1",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request3": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "HTTP Request3",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request1": {
"main": [
[
{
"node": "HTTP Request2",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request2": {
"main": [
[
{
"node": "YouTube",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "f9eac6f2-7775-456d-9a42-cb7509a97a60",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "faIamMRgmo4yPuf1",
"tags": []
}
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.
googleDriveOAuth2ApigooglePalmApiyouTubeOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
AI Video Generator. Uses agent, lmChatGoogleGemini, outputParserStructured, httpRequest. Event-driven trigger; 17 nodes.
Source: https://gist.github.com/omergocmen/3817f0741135f6fa272d3c5da2509868 — 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.
Automatically generate SEO-optimized YouTube Titles, Descriptions, Tags & Hashtags – enriched with blog articles, affiliate links, and product recommendations!
Transform YouTube videos into structured Active Learning study sheets using AI.
🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.
How it Works
Resume Screening & Behavioral Interviews with Gemini, Elevenlabs, & Notion ATS copy. Uses outputParserStructured, chainLlm, googleDrive, stickyNote. Webhook trigger; 67 nodes.