{"id":"mlCmbtSHIWYMXzuV","meta":{"instanceId":"a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462"},"name":"Image-to-Video with MiniMax Hailuo 02 and upload on Youtube and TikTok","tags":[],"nodes":[{"id":"a8a67e64-0f0b-46c2-9fcf-8b6254b6f6e9","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[0,2040],"parameters":{},"typeVersion":1},{"id":"2a5c8f94-c94b-48f4-8c63-611f75cba992","name":"Get status","type":"n8n-nodes-base.httpRequest","position":[1060,2040],"parameters":{"url":"=https://queue.fal.run/fal-ai/minimax/requests/{{ $('Create video').item.json.request_id }}/status ","options":{},"authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth"},"credentials":{"httpHeaderAuth":{"id":"daOZafXpRXLtoLUV","name":"Fal.run API"}},"typeVersion":4.2},{"id":"cebf2524-3bd8-4c01-b9c7-338d0ea8a7bf","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[0,420],"parameters":{"color":6,"width":540,"height":360,"content":"## Image\n![image](https://n3wstorage.b-cdn.net/n3witalia/girl-beach.jpeg)"},"typeVersion":1},{"id":"82f89972-2c96-4e43-bede-4797afad0f64","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[0,820],"parameters":{"color":4,"width":540,"height":180,"content":"## Prompt\nThe girl is windsurfing with her dog\n\n## Result\nhttps://n3wstorage.b-cdn.net/n3witalia/girl-beach.mp4"},"typeVersion":1},{"id":"ff479d7a-f475-4290-9f12-0593eb694c94","name":"Wait 60 sec.","type":"n8n-nodes-base.wait","position":[880,2040],"webhookId":"351bd496-a9cc-445c-86f6-a56189df0028","parameters":{"amount":60},"typeVersion":1.1},{"id":"9dd6e755-896d-4db7-bd7c-11cb22e82da3","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[0,1900],"parameters":{"rule":{"interval":[{"field":"minutes"}]}},"typeVersion":1.2},{"id":"8e6f9c27-df72-47de-839d-596027a90aa5","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[0,140],"parameters":{"color":3,"width":540,"height":240,"content":"# Image to Video with MiniMax Hailuo 02\n\nThis automated workflow takes a static image and a textual prompt and transforms them into an animated video using the **MiniMax Hailuo 02** model. It then uploads the generated video to **YouTube and TikTok**, and updates a Google Sheet with relevant links and metadata."},"typeVersion":1},{"id":"187b9864-95c5-45d2-970f-fde41b28163a","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[0,1040],"parameters":{"width":740,"height":220,"content":"## STEP 1 - GOOGLE SHEET\nCreate a [Google Sheet like this](https://docs.google.com/spreadsheets/d/193tDO6xw8aSMO7lVC5kFyvlnmAdpHyGMmUbLBJUhhNs/edit?usp=sharing).\n\nPlease insert:\n- in the \"IMAGE\" column the basic image of your face\n- in the \"PROMPT\" column set the prompt\n\nLeave the \"VIDEO\" and \"YOUTUBE\" column unfilled. It will be inserted by the system once the image has been created"},"typeVersion":1},{"id":"3801fdb4-ff38-41e1-ab99-18cbe0daf3c5","name":"Completed?","type":"n8n-nodes-base.if","position":[1240,2040],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"383d112e-2cc6-4dd4-8985-f09ce0bd1781","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.status }}","rightValue":"COMPLETED"}]}},"typeVersion":2.2},{"id":"8f5c867f-97e4-4aba-8f5f-29e2e85afe20","name":"Update result","type":"n8n-nodes-base.googleSheets","position":[920,2300],"parameters":{"columns":{"value":{"RESULT":"={{ $('Get Url Video').item.json.video.url }}","row_number":"={{ $('Get new video').item.json.row_number }}"},"schema":[{"id":"FACE IMAGE","type":"string","display":true,"removed":false,"required":false,"displayName":"FACE IMAGE","defaultMatch":false,"canBeUsedToMatch":true},{"id":"GIF IMAGE","type":"string","display":true,"removed":false,"required":false,"displayName":"GIF IMAGE","defaultMatch":false,"canBeUsedToMatch":true},{"id":"RESULT","type":"string","display":true,"removed":false,"required":false,"displayName":"RESULT","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":false,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["row_number"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/11ebWJvwwXHgvQld9kxywKQUvIoBw6xMa0g0BuIqHDxE/edit#gid=0","cachedResultName":"Foglio1"},"documentId":{"__rl":true,"mode":"list","value":"193tDO6xw8aSMO7lVC5kFyvlnmAdpHyGMmUbLBJUhhNs","cachedResultUrl":"https://docs.google.com/spreadsheets/d/193tDO6xw8aSMO7lVC5kFyvlnmAdpHyGMmUbLBJUhhNs/edit?usp=drivesdk","cachedResultName":"Image to Video"}},"credentials":{"googleSheetsOAuth2Api":{"id":"JYR6a64Qecd6t8Hb","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"ca4e06ec-2d0d-4e31-b5d1-a14a2125f077","name":"Set data","type":"n8n-nodes-base.set","position":[440,2040],"parameters":{"options":{},"assignments":{"assignments":[{"id":"c713d31f-9abd-496a-ac79-e8e2efe60aa0","name":"image","type":"string","value":"={{ $json.IMAGE }}"},{"id":"58fb5e76-6576-4d16-8b25-b931c7935c01","name":"prompt","type":"string","value":"={{ $json.PROMPT }}"}]}},"typeVersion":3.4},{"id":"9bfda76a-d6ed-47bb-897a-1f7ce68950fd","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[0,1740],"parameters":{"width":740,"height":100,"content":"## STEP 4 - MAIN FLOW\nStart the workflow manually or periodically by hooking the \"Schedule Trigger\" node. It is recommended to set it at 5 minute intervals."},"typeVersion":1},{"id":"f51bfb2a-cbe0-4cfa-84b6-8b893ca2c475","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[0,1300],"parameters":{"width":740,"height":140,"content":"## STEP 2 - GET API KEY (YOURAPIKEY)\nCreate an account [here](https://fal.ai/) and obtain API KEY.\nIn the node \"Create Image\" set \"Header Auth\" and set:\n- Name: \"Authorization\"\n- Value: \"Key YOURAPIKEY\""},"typeVersion":1},{"id":"cb265072-6c63-4134-8ace-6e0597dfa779","name":"Upload Video","type":"n8n-nodes-base.googleDrive","position":[740,2300],"parameters":{"name":"={{ $now.format('yyyyLLddHHmmss') }}-{{ $json.video.file_name }}","driveId":{"__rl":true,"mode":"list","value":"My Drive"},"options":{},"folderId":{"__rl":true,"mode":"list","value":"1aHRwLWyrqfzoVC8HoB-YMrBvQ4tLC-NZ","cachedResultUrl":"https://drive.google.com/drive/folders/1aHRwLWyrqfzoVC8HoB-YMrBvQ4tLC-NZ","cachedResultName":"Fal.run"}},"credentials":{"googleDriveOAuth2Api":{"id":"HEy5EuZkgPZVEa9w","name":"Google Drive account (n3w.it)"}},"typeVersion":3},{"id":"e71b084f-bb35-4f76-ba82-1da85b835666","name":"Get Url Video","type":"n8n-nodes-base.httpRequest","position":[0,2300],"parameters":{"url":"=https://queue.fal.run/fal-ai/minimax/requests/{{ $json.request_id }}","options":{},"authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth"},"credentials":{"httpHeaderAuth":{"id":"daOZafXpRXLtoLUV","name":"Fal.run API"}},"typeVersion":4.2},{"id":"79831c8a-8248-4604-82ea-1bd993b268fc","name":"Generate title","type":"@n8n/n8n-nodes-langchain.openAi","position":[180,2300],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4o-mini","cachedResultName":"GPT-4O-MINI"},"options":{},"messages":{"values":[{"content":"=Input: {{ $('Get new video').item.json.PROMPT }}"},{"role":"system","content":"You are a YouTube SEO expert specialized in creating engaging and optimized titles.\n\nYour task is to generate an effective title for a YouTube video based on the user's video description.\n\nGUIDELINES:\n- Maximum 60 characters to avoid truncation\n- Use relevant keywords for SEO\n- Make the title catchy and clickable\n- Avoid excessive or misleading clickbait\n- Consider the target audience of the content\n- Use numbers, questions, or power words when appropriate\n- IMPORTANT: Generate the title in the same language as the input description\n\nOUTPUT FORMAT:\nProvide only the title, without additional explanations.\n\nEXAMPLE:\nInput: \"Tutorial video on how to cook perfect pasta carbonara\"\nOutput: \"PERFECT Carbonara in 10 Minutes - Chef's Secrets\""}]}},"credentials":{"openAiApi":{"id":"TefveNaDaMERl1hY","name":"OpenAi account (Eure)"}},"typeVersion":1.8},{"id":"e16a883b-6210-4577-bcda-ae5f12ee5c83","name":"Get File Video","type":"n8n-nodes-base.httpRequest","position":[520,2300],"parameters":{"url":"={{ $('Get Url Video').item.json.video.url }}","options":{}},"typeVersion":4.2},{"id":"3a7e9d11-9bb1-4d8f-b7a5-d8bf085a6d2e","name":"Update Youtube URL","type":"n8n-nodes-base.googleSheets","position":[920,2540],"parameters":{"columns":{"value":{"row_number":"={{ $('Get new video').item.json.row_number }}","YOUTUBE_URL":"=https://youtu.be/{{ $json.results.youtube.video_id }}"},"schema":[{"id":"PROMPT","type":"string","display":true,"removed":false,"required":false,"displayName":"PROMPT","defaultMatch":false,"canBeUsedToMatch":true},{"id":"DURATION","type":"string","display":true,"removed":false,"required":false,"displayName":"DURATION","defaultMatch":false,"canBeUsedToMatch":true},{"id":"VIDEO","type":"string","display":true,"removed":false,"required":false,"displayName":"VIDEO","defaultMatch":false,"canBeUsedToMatch":true},{"id":"YOUTUBE_URL","type":"string","display":true,"removed":false,"required":false,"displayName":"YOUTUBE_URL","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":false,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["row_number"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/11ebWJvwwXHgvQld9kxywKQUvIoBw6xMa0g0BuIqHDxE/edit#gid=0","cachedResultName":"Foglio1"},"documentId":{"__rl":true,"mode":"list","value":"193tDO6xw8aSMO7lVC5kFyvlnmAdpHyGMmUbLBJUhhNs","cachedResultUrl":"https://docs.google.com/spreadsheets/d/193tDO6xw8aSMO7lVC5kFyvlnmAdpHyGMmUbLBJUhhNs/edit?usp=drivesdk","cachedResultName":"Image to Video"}},"credentials":{"googleSheetsOAuth2Api":{"id":"JYR6a64Qecd6t8Hb","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"e9c82e9e-bb66-4cb9-aa74-86b3944a4c56","name":"Get new video","type":"n8n-nodes-base.googleSheets","position":[220,2040],"parameters":{"options":{},"filtersUI":{"values":[{"lookupColumn":"VIDEO"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/193tDO6xw8aSMO7lVC5kFyvlnmAdpHyGMmUbLBJUhhNs/edit#gid=0","cachedResultName":"Foglio1"},"documentId":{"__rl":true,"mode":"list","value":"193tDO6xw8aSMO7lVC5kFyvlnmAdpHyGMmUbLBJUhhNs","cachedResultUrl":"https://docs.google.com/spreadsheets/d/193tDO6xw8aSMO7lVC5kFyvlnmAdpHyGMmUbLBJUhhNs/edit?usp=drivesdk","cachedResultName":"Image to Video"}},"credentials":{"googleSheetsOAuth2Api":{"id":"JYR6a64Qecd6t8Hb","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"d7a46ca6-dc36-4e7d-b117-d8c836e71bbd","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[700,2480],"parameters":{"width":180,"height":440,"content":"Set YOUR_USERNAME in Step 3"},"typeVersion":1},{"id":"cefa654d-4572-4520-a545-77152c9ef25a","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[0,1480],"parameters":{"width":740,"height":220,"content":"## STEP 3 - Upload video on Youtube and TikTok\n- Find your API key in your [Upload-Post Manage Api Keys](https://app.upload-post.com/) 10 FREE uploads per month\n- Set the the \"Auth Header\":\n-- Name: Authorization\n-- Value: Apikey YOUR_API_KEY_HERE\n- Create profiles to manage your social media accounts. The \"Profile\" you choose will be used in the field YOUR_USERNAME (eg. test1 or test2).  \n\n\nThe free plan allows uploads to all platforms except TikTok. To enable, please upgrade to a paid plan."},"typeVersion":1},{"id":"93158511-58ed-4890-9aac-48eba0ccfbdf","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[620,1980],"parameters":{"width":180,"height":200,"content":"Set duration (6 or 10 sec.)"},"typeVersion":1},{"id":"f3205b9f-e939-4b68-8f27-098c8a02e763","name":"Create video","type":"n8n-nodes-base.httpRequest","position":[660,2040],"parameters":{"url":"https://queue.fal.run/fal-ai/minimax/hailuo-02/standard/image-to-video","method":"POST","options":{},"jsonBody":"={\n     \"prompt\": \"{{ $json.prompt }}\",\n     \"image_url\": \"{{ $json.image }}\",\n     \"duration\": \"6\",\n     \"prompt_optimizer\": true\n   }","sendBody":true,"sendHeaders":true,"specifyBody":"json","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","headerParameters":{"parameters":[{"name":"Content-Type","value":"application/json"}]}},"credentials":{"httpHeaderAuth":{"id":"daOZafXpRXLtoLUV","name":"Fal.run API"}},"typeVersion":4.2},{"id":"d87b77a8-81b7-4598-b05c-4ff97cdd32c3","name":"Upload on Youtube","type":"n8n-nodes-base.httpRequest","position":[740,2540],"parameters":{"url":"https://api.upload-post.com/api/upload","method":"POST","options":{},"sendBody":true,"contentType":"multipart-form-data","authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"title","value":"={{ $('Generate title').item.json.message.content }}"},{"name":"user","value":"YOUR_USERNAME"},{"name":"platform[]","value":"youtube"},{"name":"video","parameterType":"formBinaryData","inputDataFieldName":"data"}]},"genericAuthType":"httpHeaderAuth"},"credentials":{"httpHeaderAuth":{"id":"DEE2XGvhGodgbAJh","name":"Upload-post.com API"}},"typeVersion":4.2},{"id":"63a38338-b734-4e94-bfa9-648e9fa2a3b6","name":"Upload on TikTok","type":"n8n-nodes-base.httpRequest","position":[740,2760],"parameters":{"url":"https://api.upload-post.com/api/upload","method":"POST","options":{},"sendBody":true,"contentType":"multipart-form-data","authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"title","value":"={{ $('Generate title').item.json.message.content }}"},{"name":"user","value":"YOUR_USERNAME"},{"name":"platform[]","value":"tiktok"},{"name":"video","parameterType":"formBinaryData","inputDataFieldName":"data"}]},"genericAuthType":"httpHeaderAuth"},"credentials":{"httpHeaderAuth":{"id":"DEE2XGvhGodgbAJh","name":"Upload-post.com API"}},"typeVersion":4.2}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"814bbb25-af62-433e-985e-b9e2c15e3c1c","connections":{"Set data":{"main":[[{"node":"Create video","type":"main","index":0}]]},"Completed?":{"main":[[{"node":"Get Url Video","type":"main","index":0}],[{"node":"Wait 60 sec.","type":"main","index":0}]]},"Get status":{"main":[[{"node":"Completed?","type":"main","index":0}]]},"Create video":{"main":[[{"node":"Wait 60 sec.","type":"main","index":0}]]},"Upload Video":{"main":[[{"node":"Update result","type":"main","index":0}]]},"Wait 60 sec.":{"main":[[{"node":"Get status","type":"main","index":0}]]},"Get Url Video":{"main":[[{"node":"Generate title","type":"main","index":0}]]},"Get new video":{"main":[[{"node":"Set data","type":"main","index":0}]]},"Generate title":{"main":[[{"node":"Get File Video","type":"main","index":0}]]},"Get File Video":{"main":[[{"node":"Upload Video","type":"main","index":0},{"node":"Upload on Youtube","type":"main","index":0},{"node":"Upload on TikTok","type":"main","index":0}]]},"Upload on Youtube":{"main":[[{"node":"Update Youtube URL","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Get new video","type":"main","index":0}]]}}}