{ "name": "POV_n8n_Video_WF", "nodes": [ { "parameters": { "operation": "binaryToPropery", "options": {} }, "type": "n8n-nodes-base.extractFromFile", "typeVersion": 1.1, "position": [ -16, -448 ], "id": "8c84b774-4efc-426e-8cdb-c4631392cc12", "name": "Extract from File" }, { "parameters": {}, "type": "n8n-nodes-base.wait", "typeVersion": 1.1, "position": [ -1056, -224 ], "id": "b9991191-2d51-43df-9934-37f9a5294c52", "name": "Wait For Video", "webhookId": "5b2cecda-a3f6-4560-8743-f866e096ac82" }, { "parameters": { "mode": "runOnceForEachItem", "jsCode": "// Takes input from 1st NODE (Google sheet)\n// Output JSON file has new field name: JSON_User_Input\n// Renamed it (Not prompt as in the YT tutorial)\n// $('Reads AI sheet').item.json.Prompt\n\n// Get the input from previous node\nconst userInput = $json.Prompt;\n\n// Return the formatted JSON\nreturn {\n Json_User_Input: userInput\n};" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ -720, -416 ], "id": "daccade6-7e8a-4f3d-b628-7b1ac2782e01", "name": "Code in JS" }, { "parameters": { "documentId": { "__rl": true, "value": "1DeZWJ29SCCzF5DkQi5xp-jhSTvRHi-BPzYdFDRGU6rw", "mode": "list", "cachedResultName": "Rogue Earth", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DeZWJ29SCCzF5DkQi5xp-jhSTvRHi-BPzYdFDRGU6rw/edit?usp=drivesdk" }, "sheetName": { "__rl": true, "value": "Sheet1", "mode": "name" }, "filtersUI": { "values": [ { "lookupColumn": "SEQ", "lookupValue": "4" } ] }, "options": {} }, "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.7, "position": [ -1152, -432 ], "id": "e3135840-ab2c-4452-8544-a84ceace9ae2", "name": "Reads AI sheet", "credentials": { "googleSheetsOAuth2Api": { "id": "0b6SdVCqqmdlTufU", "name": "GS Oauth2 API" } } }, { "parameters": { "operation": "write", "fileName": "=D:\\Videos\\n8n\\rogue{{$node['Reads AI sheet'].json.SEQ}}.mp4", "options": {} }, "type": "n8n-nodes-base.readWriteFile", "typeVersion": 1.1, "position": [ 96, -224 ], "id": "524865d6-bb35-4fbe-9a6c-edaf79382170", "name": "Write Video To Disk" }, { "parameters": { "operation": "write", "fileName": "=D:/Videos/n8n/rogue{{$node['Reads AI sheet'].json.SEQ}}.png", "options": {} }, "type": "n8n-nodes-base.readWriteFile", "typeVersion": 1.1, "position": [ -288, -592 ], "id": "b320d4ca-84ef-45b8-a854-0748d0d0fba0", "name": "Write Img to Disk" }, { "parameters": { "method": "POST", "url": "https://router.huggingface.co/hf-inference/models/black-forest-labs/FLUX.1-schnell", "authentication": "genericCredentialType", "genericAuthType": "httpCustomAuth", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Accept", "value": "image/png" } ] }, "sendBody": true, "bodyParameters": { "parameters": [ { "name": "inputs", "value": "={{ $json.Json_User_Input }}" } ] }, "options": { "response": { "response": { "responseFormat": "file" } } } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [ -528, -448 ], "id": "53ef59da-24a2-433e-b7d1-26e39d46d619", "name": "Gen HF image", "credentials": { "httpCustomAuth": { "id": "6yqqIo6SGwRndXHs", "name": "HuggingFace API" } } }, { "parameters": { "url": "=https://api.dev.runwayml.com/v1/tasks/{{ $('Run Runway ML').item.json.id }}", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Authorization", "value": "=Bearer YOUR_RUNWAYML_API_KEY" }, { "name": "X-Runway-Version", "value": "2024-11-06" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [ -800, -224 ], "id": "5d36a13c-3da8-4f9f-8487-f100ffa1bc92", "name": "Get video URL" }, { "parameters": { "method": "POST", "url": "https://api.dev.runwayml.com/v1/image_to_video", "authentication": "genericCredentialType", "genericAuthType": "httpCustomAuth", "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"promptImage\": \"data:image/jpeg;base64,{{ $json.data }}\",\n \"model\": \"gen3a_turbo\",\n \"promptText\": \"{{ $('Code in JS').item.json.Json_User_Input }}\",\n \"duration\": 10,\n \"ratio\": \"1280:768\",\n \"watermark\": false\n}", "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [ -1264, -240 ], "id": "58c453ca-d77b-406e-aa38-107c2361c58c", "name": "Run Runway ML", "credentials": { "httpCustomAuth": { "id": "XAffM6a5yaw3Fcvx", "name": "Runway API" } } }, { "parameters": { "url": "={{ $json.output[0] }}", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Authorization", "value": "Bearer YOUR_RUNWAYML_API_KEY" } ] }, "options": { "response": { "response": { "responseFormat": "file" } } } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [ -112, -224 ], "id": "b6ae5749-b865-4cb8-921c-0e42eeabb0ca", "name": "Get Video bin" }, { "parameters": {}, "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -1312, -432 ], "id": "0a2f49d8-307c-407c-8816-68cea5d2697d", "name": "Click to Exec WF" }, { "parameters": { "fileSelector": "=D:\\Videos\\n8n\\rogue{{ $json.SEQ }}.png", "options": {} }, "type": "n8n-nodes-base.readWriteFile", "typeVersion": 1.1, "position": [ -944, -512 ], "id": "e9de9a4d-04aa-48ca-842e-7dfdf7e6ea34", "name": "Check If Img Exists", "onError": "continueErrorOutput" }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "id": "793b7b21-3c5e-4f83-8f61-452a10149f47", "leftValue": "={{$json[\"status\"]}}", "rightValue": "SUCCEEDED", "operator": { "type": "string", "operation": "equals" } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2.3, "position": [ -544, -224 ], "id": "34a0b90c-a20f-4a8d-b806-a94d6815f279", "name": "Check Status" } ], "pinData": {}, "connections": { "Extract from File": { "main": [ [ { "node": "Run Runway ML", "type": "main", "index": 0 } ] ] }, "Wait For Video": { "main": [ [ { "node": "Get video URL", "type": "main", "index": 0 } ] ] }, "Code in JS": { "main": [ [ { "node": "Gen HF image", "type": "main", "index": 0 } ] ] }, "Reads AI sheet": { "main": [ [ { "node": "Check If Img Exists", "type": "main", "index": 0 } ] ] }, "Gen HF image": { "main": [ [ { "node": "Extract from File", "type": "main", "index": 0 }, { "node": "Write Img to Disk", "type": "main", "index": 0 } ] ] }, "Get video URL": { "main": [ [ { "node": "Check Status", "type": "main", "index": 0 } ] ] }, "Run Runway ML": { "main": [ [ { "node": "Wait For Video", "type": "main", "index": 0 } ] ] }, "Get Video bin": { "main": [ [ { "node": "Write Video To Disk", "type": "main", "index": 0 } ] ] }, "Click to Exec WF": { "main": [ [ { "node": "Reads AI sheet", "type": "main", "index": 0 } ] ] }, "Check If Img Exists": { "main": [ [], [ { "node": "Code in JS", "type": "main", "index": 0 } ] ] }, "Check Status": { "main": [ [ { "node": "Get Video bin", "type": "main", "index": 0 } ], [ { "node": "Wait For Video", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1", "binaryMode": "separate", "availableInMCP": false }, "versionId": "7440d7d5-fff2-4d28-ac1d-eed044388c4b", "meta": { "templateCredsSetupCompleted": true, "instanceId": "f5cbeb104fcb1da35ed0d675cddcba7e50239a16067369cdda0f3988f8c52e03" }, "id": "kWV8Uzmiqkuyb3V1", "tags": [] }