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 →
{
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 8 * * *"
}
]
}
},
"id": "0e7d892a-827c-40fb-9530-8925c42fa7f9",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
864,
-576
]
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "models/gemini-2.5-flash",
"mode": "list",
"cachedResultName": "models/gemini-2.5-flash"
},
"messages": {
"values": [
{
"content": "=H\u00f4m nay {{ $now.toFormat('dd/MM/yyyy') }}.\n\nCh\u1ecdn m\u1ed9t kh\u00e1i ni\u1ec7m t\u1eeb danh s\u00e1ch \u01b0u ti\u00ean sau (theo th\u1ee9 t\u1ef1):\n1. M\u00f4 h\u00ecnh ki\u1ebfn tr\u00fac: REST API, GraphQL, Microservices, Event-Driven, MVC\n2. Giao th\u1ee9c m\u1ea1ng: TCP/IP, HTTP/HTTPS, WebSocket, DNS, OAuth\n3. L\u1eadp tr\u00ecnh h\u01b0\u1edbng \u0111\u1ed1i t\u01b0\u1ee3ng: OOP, SOLID, Design Patterns, Dependency Injection\n4. C\u01a1 s\u1edf d\u1eef li\u1ec7u: Index, Transaction, CAP Theorem, Sharding, Caching\n5. DevOps: CI/CD, Docker, Kubernetes, Load Balancer, Rate Limiting\n\n\u01afu ti\u00ean ch\u1ecdn kh\u00e1i ni\u1ec7m ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u hay th\u1eafc m\u1eafc nh\u1ea5t. T\u1ea1o JSON theo schema."
}
]
},
"builtInTools": {},
"options": {
"systemMessage": "B\u1ea1n l\u00e0 chuy\u00ean gia gi\u1ea3i th\u00edch c\u00f4ng ngh\u1ec7 cho ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u b\u1eb1ng ti\u1ebfng Vi\u1ec7t.\n\nCh\u1ec9 tr\u1ea3 v\u1ec1 M\u1ed8T JSON object duy nh\u1ea5t. Kh\u00f4ng c\u00f3 text n\u00e0o kh\u00e1c. Kh\u00f4ng markdown. Kh\u00f4ng backtick.\n\nSchema b\u1eaft bu\u1ed9c:\n{\"concept\":\"...\",\"hook\":\"...\",\"definition\":\"...\",\"code_snippet\":\"...\",\"key_points\":[\"...\",\"...\",\"...\"],\"tts_script\":\"...\"}\n\nR\u00e0ng bu\u1ed9c t\u1eebng field:\n- concept: t\u00ean kh\u00e1i ni\u1ec7m, t\u1ed1i \u0111a 6 t\u1eeb\n- hook: c\u00e2u h\u1ecfi g\u00e2y t\u00f2 m\u00f2, t\u1ed1i \u0111a 12 t\u1eeb, k\u1ebft th\u00fac b\u1eb1ng d\u1ea5u ?\n- definition: gi\u1ea3i th\u00edch b\u1eb1ng v\u00ed d\u1ee5 \u0111\u1eddi th\u01b0\u1eddng, t\u1ed1i \u0111a 25 t\u1eeb\n- code_snippet: v\u00ed d\u1ee5 code 1 d\u00f2ng, d\u00f9ng ; ng\u0103n c\u00e1ch, t\u1ed1i \u0111a 80 k\u00fd t\u1ef1\n- key_points: \u0111\u00fang 3 items, m\u1ed7i item t\u1ed1i \u0111a 6 t\u1eeb, b\u1eaft \u0111\u1ea7u b\u1eb1ng \u0111\u1ed9ng t\u1eeb\n\nR\u00e0ng bu\u1ed9c tts_script - QUAN TR\u1eccNG:\nVideo d\u00e0i 25 gi\u00e2y, TTS \u0111\u1ecdc ~3 t\u1eeb/gi\u00e2y. Script ph\u1ea3i vi\u1ebft \u0110\u00daNG theo th\u1ee9 t\u1ef1 xu\u1ea5t hi\u1ec7n c\u1ee7a t\u1eebng scene tr\u00ean video:\n\n\u0110o\u1ea1n 1 - Hook (0 \u0111\u1ebfn 4 gi\u00e2y, t\u1ed1i \u0111a 12 t\u1eeb):\n \u0110\u1ecdc l\u1ea1i n\u1ed9i dung hook, gi\u1ecdng t\u00f2 m\u00f2, k\u1ebft th\u00fac b\u1eb1ng d\u1ea5u ?\n\n\u0110o\u1ea1n 2 - Gi\u1ea3i th\u00edch (4 \u0111\u1ebfn 7 gi\u00e2y, t\u1ed1i \u0111a 9 t\u1eeb):\n Gi\u1ea3i th\u00edch ng\u1eafn g\u1ecdn kh\u00e1i ni\u1ec7m b\u1eb1ng v\u00ed d\u1ee5 \u0111\u1eddi th\u01b0\u1eddng\n\n\u0110o\u1ea1n 3 - Code (7 \u0111\u1ebfn 9 gi\u00e2y, t\u1ed1i \u0111a 6 t\u1eeb):\n N\u00f3i \"V\u00ed d\u1ee5 trong code nh\u01b0 th\u1ebf n\u00e0y\"\n\n\u0110o\u1ea1n 4 - Key points (9 \u0111\u1ebfn 14 gi\u00e2y, t\u1ed1i \u0111a 15 t\u1eeb):\n \u0110\u1ecdc l\u1ea7n l\u01b0\u1ee3t 3 key points, m\u1ed7i point 1 c\u00e2u ng\u1eafn\n\n\u0110o\u1ea1n 5 - Outro (14 \u0111\u1ebfn 25 gi\u00e2y, t\u1ed1i \u0111a 33 t\u1eeb):\n M\u1edf r\u1ed9ng th\u00eam \u00fd ngh\u0129a th\u1ef1c t\u1ebf, t\u1ea1i sao quan tr\u1ecdng, k\u1ebft th\u00fac b\u1eb1ng l\u1eddi khuy\u00ean h\u1ecdc ti\u1ebfp\n\nVi\u1ebft tts_script li\u1ec1n m\u1ea1ch 1 \u0111o\u1ea1n kh\u00f4ng xu\u1ed1ng d\u00f2ng, t\u1ed5ng 60-75 t\u1eeb.\n\nC\u1ea5m tuy\u1ec7t \u0111\u1ed1i trong M\u1eccI field:\n- D\u00f9ng d\u1ea5u nh\u00e1y \u0111\u01a1n ' \u1edf b\u1ea5t k\u1ef3 \u0111\u00e2u\n- K\u00fd t\u1ef1 xu\u1ed1ng d\u00f2ng b\u00ean trong gi\u00e1 tr\u1ecb\n- D\u00f9ng d\u1ea5u ngo\u1eb7c k\u00e9p b\u00ean trong tts_script"
}
},
"id": "7ff7d911-5a5d-4ff4-bbbb-42be6d73282c",
"name": "Gemini AI",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"typeVersion": 1.1,
"position": [
1088,
-576
],
"credentials": {}
},
{
"parameters": {
"jsCode": "let rawText = $input.item.json.content.parts[0].text;\n\nlet data = null;\nconst required = ['concept', 'hook', 'definition', 'code_snippet', 'key_points', 'tts_script'];\n\nlet startPositions = [];\nfor (let i = 0; i < rawText.length; i++) {\n if (rawText[i] === '{') startPositions.push(i);\n}\n\nfor (const start of startPositions) {\n let end = rawText.lastIndexOf('}');\n while (end > start) {\n try {\n const candidate = rawText.substring(start, end + 1);\n const parsed = JSON.parse(candidate);\n const hasAll = required.every(f => parsed[f]);\n if (hasAll) { data = parsed; break; }\n } catch (e) {}\n end = rawText.lastIndexOf('}', end - 1);\n }\n if (data) break;\n}\n\nif (!data) throw new Error(`Kh\u00f4ng t\u00ecm \u0111\u01b0\u1ee3c JSON | Raw: ${rawText.substring(0, 400)}`);\n\nif (data.code_snippet) data.code_snippet = data.code_snippet.replace(/\\n/g, ' ; ');\n\n// L\u00e0m s\u1ea1ch tts_script\nlet ttsScript = data.tts_script || '';\nttsScript = ttsScript\n .replace(/\\n/g,' ').replace(/\\r/g,'')\n .replace(/\"/g,'').replace(/'/g,'')\n .replace(/\\s+/g,' ').trim();\n\n// Fix c\u1ee9ng 25s, xo\u00e1 tts_script kh\u1ecfi video data\nconst videoDuration = 25;\ndelete data.tts_script;\ndata.video_duration = videoDuration;\n\nconst safeJson = JSON.stringify(data).replace(/'/g, \"'\\\\''\");\nconst jobId = `job-${Date.now()}`;\nconst workDir = `/tmp/video_jobs/${jobId}`;\n\nreturn [{ json: {\n safeJson,\n ttsScript,\n concept: data.concept,\n jobId,\n workDir,\n videoPath: `${workDir}/video_silent.mp4`,\n audioPath: `${workDir}/voice.mp3`,\n mixPath: `${workDir}/audio_mix.mp3`,\n finalPath: `${workDir}/final.mp4`,\n bgPath: '/opt/coding-video/assets/background.mp3'\n} }];"
},
"id": "a017dc31-383a-4a14-9e72-e43fb076fc94",
"name": "Validate + Script + Duration",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1440,
-576
]
},
{
"parameters": {
"command": "=mkdir -p {{ $json.workDir }} && \\\ncd /opt/coding-video && \\\nnpx --yes hyperframes@0.6.2 render \\\n --docker \\\n --variables='{{ $json.safeJson }}' \\\n -o {{ $json.videoPath }} && \\\necho \"Done: $(du -sh {{ $json.videoPath }} | cut -f1)\""
},
"id": "1b996a32-7a44-4082-be05-38568d31aadb",
"name": "SSH Render Video",
"type": "n8n-nodes-base.ssh",
"typeVersion": 1,
"position": [
896,
-368
],
"credentials": {
"sshPassword": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "file",
"operation": "download",
"path": "/tmp/video_jobs/job-1778748859666/final.mp4",
"options": {}
},
"type": "n8n-nodes-base.ssh",
"typeVersion": 1,
"position": [
1568,
-368
],
"id": "501fe015-86bf-4daf-b9ec-365c9a8c89c6",
"name": "Download a file",
"credentials": {
"sshPassword": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"command": "=/usr/local/bin/edge-tts \\\n --voice vi-VN-NamMinhNeural \\\n --text \"{{ $('Validate + Script + Duration').first().json.ttsScript }}\" \\\n --write-media {{ $('Validate + Script + Duration').first().json.audioPath }} && \\\necho \"Voice: $(du -sh {{ $('Validate + Script + Duration').first().json.audioPath }} | cut -f1)\""
},
"type": "n8n-nodes-base.ssh",
"typeVersion": 1,
"position": [
1120,
-368
],
"id": "4140cba9-50f5-4194-9e8f-88faec5a8385",
"name": "SSH Edge TTS:",
"credentials": {
"sshPassword": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"command": "=VIDEO_DURATION=$(ffprobe -v quiet -print_format json -show_format \"{{ $('Validate + Script + Duration').first().json.videoPath }}\" \\\n | python3 -c \"import sys,json; print(json.load(sys.stdin)['format']['duration'])\") && \\\n\nVOICE_DURATION=$(ffprobe -v quiet -print_format json -show_format \"{{ $('Validate + Script + Duration').first().json.audioPath }}\" \\\n | python3 -c \"import sys,json; print(json.load(sys.stdin)['format']['duration'])\") && \\\n\nSPEED=$(python3 -c \"print(round($VOICE_DURATION / $VIDEO_DURATION, 4))\") && \\\n\necho \"Video: ${VIDEO_DURATION}s | Voice: ${VOICE_DURATION}s | Speed: ${SPEED}x\" && \\\n\nffmpeg -y \\\n -i \"{{ $('Validate + Script + Duration').first().json.audioPath }}\" \\\n -filter:a \"atempo=${SPEED}\" \\\n -t \"$VIDEO_DURATION\" \\\n \"{{ $('Validate + Script + Duration').first().json.mixPath }}\" && \\\n\nffmpeg -y \\\n -i \"{{ $('Validate + Script + Duration').first().json.videoPath }}\" \\\n -i \"{{ $('Validate + Script + Duration').first().json.mixPath }}\" \\\n -c:v copy \\\n -c:a aac \\\n -b:a 128k \\\n -shortest \\\n \"{{ $('Validate + Script + Duration').first().json.finalPath }}\" && \\\n\necho \"Final: $(du -sh {{ $('Validate + Script + Duration').first().json.finalPath }} | cut -f1)\""
},
"type": "n8n-nodes-base.ssh",
"typeVersion": 1,
"position": [
1344,
-368
],
"id": "3abd546f-c35c-49a2-bf5b-d6f16777977d",
"name": "FFmpeg",
"credentials": {
"sshPassword": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"postSettings": {
"text": "test",
"visibilityType": 0,
"allowComment": 1,
"scheduleTime": 0
}
},
"type": "n8n-nodes-social-tiktok.tikTokUpload",
"typeVersion": 1,
"position": [
1744,
-352
],
"id": "54695239-9908-41e4-87e8-c396a4a69a82",
"name": "TikTok Upload",
"credentials": {
"tiktokApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Gemini AI",
"type": "main",
"index": 0
}
]
]
},
"Gemini AI": {
"main": [
[
{
"node": "Validate + Script + Duration",
"type": "main",
"index": 0
}
]
]
},
"Validate + Script + Duration": {
"main": [
[
{
"node": "SSH Render Video",
"type": "main",
"index": 0
}
]
]
},
"SSH Render Video": {
"main": [
[
{
"node": "SSH Edge TTS:",
"type": "main",
"index": 0
}
]
]
},
"Download a file": {
"main": [
[
{
"node": "TikTok Upload",
"type": "main",
"index": 0
}
]
]
},
"SSH Edge TTS:": {
"main": [
[
{
"node": "FFmpeg",
"type": "main",
"index": 0
}
]
]
},
"FFmpeg": {
"main": [
[
{
"node": "Download a file",
"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.
sshPasswordtiktokApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Gen Video. Uses googleGemini, ssh, n8n-nodes-social-tiktok. Scheduled trigger; 8 nodes.
Source: https://github.com/DoanDuyThanh71/lmsv1/blob/b8627a2c443760d9b77fad30d6fc6eac76b41714/n8n_workflows/gen_video.json — 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.
Gemini Mockup Generator v1.1. Uses httpRequest, googleGemini, microsoftOutlook. Scheduled trigger; 98 nodes.
AI Institutional Stock Valuation Engine with Risk Scoring & Scenario Targets
Overview This is a production-grade, fully automated stock analysis system built entirely in n8n. It combines institutional-level financial analysis, dual AI model consensus, and a self-improving back
This workflow is a complete outbound automation system that discovers local businesses, extracts contact emails, generates personalized cold emails using AI, and runs a multi-step follow-up sequence —
A professional AI equity analysis automation built on n8n that transforms structured financial data and real-time news into disciplined, risk-adjusted price targets and actionable BUY/HOLD/SELL signal