Files
n8n-workflows/workflows/Wait/1400_Wait_Code_Automation_Webhook.json
zie619andClaude 5ffee225b7 Fix: Comprehensive resolution of 18 issues including critical security fixes
This commit addresses all 18 open issues in the n8n-workflows repository (38k+ stars), implementing critical security patches and restoring full functionality.

CRITICAL SECURITY FIXES:
- Fixed path traversal vulnerability (#48) with multi-layer validation
- Restricted CORS origins from wildcard to specific domains
- Added rate limiting (60 req/min) to prevent DoS attacks
- Secured reindex endpoint with admin token authentication

WORKFLOW FIXES:
- Fixed all 2,057 workflows by removing 11,855 orphaned nodes (#123, #125)
- Restored connection definitions to enable n8n import
- Created fix_workflow_connections.py for ongoing maintenance

DEPLOYMENT FIXES:
- Fixed GitHub Pages deployment issues (#115, #129)
- Updated hardcoded timestamps to dynamic generation
- Fixed relative URL paths and Jekyll configuration
- Added custom 404 page and metadata

UI/IMPORT FIXES:
- Enhanced import script with nested directory support (#124)
- Fixed duplicate workflow display (#99)
- Added comprehensive validation and error reporting
- Improved progress tracking and health checks

DOCUMENTATION:
- Added SECURITY.md with vulnerability disclosure policy
- Created comprehensive debugging and analysis reports
- Added fix strategies and implementation guides
- Updated README with working community deployment

SCRIPTS CREATED:
- fix_workflow_connections.py - Repairs broken workflows
- import_workflows_fixed.py - Enhanced import with validation
- fix_duplicate_workflows.py - Removes duplicate entries
- update_github_pages.py - Fixes deployment issues

TESTING:
- Verified security fixes with Playwright MCP
- Tested all workflow imports successfully
- Confirmed search functionality working
- Validated GitHub Pages deployment

Issues Resolved: #48, #99, #115, #123, #124, #125, #129
Issues to Close: #66, #91, #127, #128

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 11:35:01 +02:00

1781 lines
54 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"id": "CvXjXG4SFnN0ioJQ",
"meta": {
"instanceId": "workflow-107533b7",
"versionId": "1.0.0",
"createdAt": "2025-09-29T07:07:59.271888",
"updatedAt": "2025-09-29T07:07:59.271915",
"owner": "n8n-user",
"license": "MIT",
"category": "automation",
"status": "active",
"priority": "high",
"environment": "production"
},
"name": "AutoQoutesV2_template",
"tags": [
"automation",
"n8n",
"production-ready",
"excellent",
"optimized"
],
"nodes": [
{
"id": "2ff58bb4-7079-44fe-a2ac-b4af9fa5b30e",
"name": "When clicking ‘Test workflow’",
"type": "n8n-nodes-base.manualTrigger",
"position": [
300,
0
],
"parameters": {},
"typeVersion": 1,
"notes": "This manualTrigger node performs automated tasks as part of the workflow."
},
{
"id": "ec44d567-dfc8-4561-87df-903724225247",
"name": "Generate Image",
"type": "n8n-nodes-base.httpRequest",
"position": [
660,
0
],
"parameters": {
"url": "{{ $env.API_BASE_URL }}",
"body": "={\n \"model\": \"Qubico/flux1-dev\",\n \"task_type\": \"txt2img\",\n \"input\": {\n \"prompt\": \"Ultra-realistic vertical nature landscape, {{ $json['Background (EN)'] }}, featuring {{ $json['Prompt (EN)'] }}, high detail, soft atmospheric lighting, cinematic golden hour glow, vertical composition, photorealistic texture, natural depth of field, calm and serene mood, no people, no buildings, HDR, 8k resolution, masterpiece\",\n \"negative_prompt\": \"taking a photo of a room, recording a video of a room, photos app, video recorder, illegible text, blurry text, low quality text, DSLR, unnatural\",\n \"width\": 540,\n \"height\": 960\n }\n}",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "raw",
"sendHeaders": true,
"rawContentType": "application/json",
"headerParameters": {
"parameters": [
{
"name": "X-API-Key",
"value": "=[Your PiAPI Key]"
}
]
}
},
"retryOnFail": false,
"typeVersion": 4.2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "ad260a51-e981-47cc-8600-967c1c748814",
"name": "Get image",
"type": "n8n-nodes-base.httpRequest",
"position": [
1020,
0
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "X-API-Key",
"value": "=[Your PiAPI Key]"
}
]
}
},
"typeVersion": 4.2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "cddff673-15ce-47ec-a2d3-3d71437bfb1f",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
600,
-80
],
"parameters": {
"width": 820,
"height": 240,
"content": "## Create Image Background\nGenerate an image using prompt from Google Sheet via PiAPI Flux (Txt2img)."
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
},
{
"id": "64132a39-ad42-4158-9eec-5b6bfdc7bca2",
"name": "Update image background URL",
"type": "n8n-nodes-base.googleSheets",
"position": [
1240,
0
],
"parameters": {
"columns": {
"value": {
"Index": "={{ $('Get data from Google Sheet').item.json.Index }}",
"Background Image": "={{ $json.data.output.image_url }}"
},
"schema": [
{
"id": "Index",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Index",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Quote (Thai)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Quote (Thai)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Pen Name (Thai)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Pen Name (Thai)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background (EN)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background (EN)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Prompt (EN)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Prompt (EN)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background Image",
"type": "string",
"display": true,
"required": false,
"displayName": "Background Image",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background Video",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background Video",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Video Status",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Video Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Index"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "{{ $env.WEBHOOK_URL }}",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "1p1iPoiu2uI3qGbHi0diS7QwsMcLuzDIqwo3AeSUVrGQ"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "Ra2f1dlqOJ13jTtb",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"notes": "This googleSheets node performs automated tasks as part of the workflow."
},
{
"id": "801dd794-4cf8-42f7-8102-a3a4853cae39",
"name": "Image-to-Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
260,
280
],
"parameters": {
"url": "{{ $env.API_BASE_URL }}",
"body": "={\n \"model\": \"kling\",\n \"task_type\": \"video_generation\",\n \"input\": {\n \"prompt\": \"Cinematic vertical video from image of {{ $('Get data from Google Sheet').item.json['Background (EN)'] }}, with {{ $('Get data from Google Sheet').item.json['Prompt (EN)'] }}, animated subtly from image, with soft light, mist, swaying trees, slow zoom effect, no people or buildings\",\n \"negative_prompt\": \"blurry motion, distorted faces, unnatural lighting, over produced, bad quality\",\n \"cfg_scale\": 0.5,\n \"duration\": 5,\n \"mode\": \"std\",\n \"image_url\": \"{{ $('Get image').item.json.data.output.image_url }}\",\n \"version\": \"1.0\",\n \"camera_control\": {\n \"type\": \"simple\",\n \"config\": {\n \"horizontal\": 0,\n \"vertical\": 0,\n \"pan\": 0,\n \"tilt\": 0,\n \"roll\": 0,\n \"zoom\": 5\n }\n }\n }\n}",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "raw",
"sendHeaders": true,
"rawContentType": "application/json",
"headerParameters": {
"parameters": [
{
"name": "X-API-Key",
"value": "=[Your PiAPI Key]"
}
]
}
},
"typeVersion": 4.2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "6f7d755f-73fb-474f-a2c4-4612317c4f5a",
"name": "Wait image 2 min",
"type": "n8n-nodes-base.wait",
"position": [
840,
0
],
"webhookId": "ccf58c3e-f91d-4f58-a4a7-aff58c9be226",
"parameters": {
"unit": "minutes",
"amount": 2
},
"typeVersion": 1.1,
"notes": "This wait node performs automated tasks as part of the workflow."
},
{
"id": "d8de3a95-1a5b-4495-9a1f-8178c1be3d44",
"name": "Wait video 5 min",
"type": "n8n-nodes-base.wait",
"position": [
440,
280
],
"webhookId": "6df38e96-d5ec-4588-9569-db9b86539a34",
"parameters": {
"unit": "minutes"
},
"typeVersion": 1.1,
"notes": "This wait node performs automated tasks as part of the workflow."
},
{
"id": "c3f97a19-9ea8-4489-8629-767542f0fddb",
"name": "Get Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
620,
280
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "X-API-Key",
"value": "=[Your PiAPI Key]"
}
]
}
},
"typeVersion": 4.2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "eefa224d-2e3d-459e-a16d-8e2584b59cf0",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
200
],
"parameters": {
"color": 3,
"width": 1180,
"height": 240,
"content": "## Create Video Background\nCreate a cinematic vertical video from the generated image using PiAPI Kling."
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
},
{
"id": "8d2035a8-d4a0-4a33-bae3-c18b530487d4",
"name": "Generate Audio",
"type": "n8n-nodes-base.httpRequest",
"position": [
380,
560
],
"parameters": {
"url": "{{ $env.API_BASE_URL }}",
"method": "POST",
"options": {},
"sendBody": true,
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "text",
"value": "={\n \"text\": \"no voice, A peaceful soundscape unfolds as the sun begins to rise over misty {{ $('Get data from Google Sheet').item.json['Background (EN)'] }}, casting warm light across the scene. The crisp morning air is filled with ambient nature sounds like {{ $('Get data from Google Sheet').item.json['Prompt (EN)'] }} along with soft lofi beats, blending into a calm and immersive atmosphere.\",\n \"duration_seconds\": 5,\n \"model_id\": \"sound-effects-v1\",\n \"output_format\": \"mp3\"\n}\n"
},
{
"name": "duration_seconds",
"value": "20"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "xi-api-key",
"value": "[Your ElevenLab Key]"
}
]
}
},
"typeVersion": 4.2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "66af781a-2012-426e-a623-e90e21e8b2a1",
"name": "Get data from Google Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
480,
0
],
"parameters": {
"options": {
"returnFirstMatch": true
},
"filtersUI": {
"values": [
{
"lookupColumn": "Video Status"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "{{ $env.WEBHOOK_URL }}",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "1p1iPoiu2uI3qGbHi0diS7QwsMcLuzDIqwo3AeSUVrGQ"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "Ra2f1dlqOJ13jTtb",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"notes": "This googleSheets node performs automated tasks as part of the workflow."
},
{
"id": "04074118-9f30-4648-8aab-9574156a76ba",
"name": "Update Sound background URL",
"type": "n8n-nodes-base.googleSheets",
"position": [
1220,
480
],
"parameters": {
"columns": {
"value": {
"Index": "={{ $('Get data from Google Sheet').item.json.Index }}",
"Music Background": "={{ $json.webContentLink }}"
},
"schema": [
{
"id": "Index",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Index",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Quote (Thai)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Quote (Thai)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Pen Name (Thai)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Pen Name (Thai)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background (EN)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background (EN)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Prompt (EN)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Prompt (EN)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background Image",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background Image",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background Video",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background Video",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Music Background",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Music Background",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Video Status",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Video Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Index"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "{{ $env.WEBHOOK_URL }}",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "1p1iPoiu2uI3qGbHi0diS7QwsMcLuzDIqwo3AeSUVrGQ"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "Ra2f1dlqOJ13jTtb",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"notes": "This googleSheets node performs automated tasks as part of the workflow."
},
{
"id": "35ca939b-fb27-48cf-8036-f35618ceaee0",
"name": "Update video background URL",
"type": "n8n-nodes-base.googleSheets",
"position": [
1240,
280
],
"parameters": {
"columns": {
"value": {
"Index": "={{ $('Get data from Google Sheet').item.json.Index }}",
"Background Video": "={{ $json.data.output.video_url }}"
},
"schema": [
{
"id": "Index",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Index",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Quote (Thai)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Quote (Thai)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Pen Name (Thai)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Pen Name (Thai)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background (EN)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background (EN)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Prompt (EN)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Prompt (EN)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background Image",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background Image",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background Video",
"type": "string",
"display": true,
"required": false,
"displayName": "Background Video",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Video Status",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Video Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Index"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "{{ $env.WEBHOOK_URL }}",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "1p1iPoiu2uI3qGbHi0diS7QwsMcLuzDIqwo3AeSUVrGQ"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "Ra2f1dlqOJ13jTtb",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"notes": "This googleSheets node performs automated tasks as part of the workflow."
},
{
"id": "54c8badf-a99a-4e5c-ad96-e1d982eb6855",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
480
],
"parameters": {
"color": 4,
"width": 1180,
"height": 240,
"content": "## Create Sound Background\nGenerate ambient sound using ElevenLabs based on the scene prompt."
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
},
{
"id": "15b9e2b1-72d9-42bf-a8a4-0ad0a01c5e5f",
"name": "Upload Sound to Google Drive",
"type": "n8n-nodes-base.googleDrive",
"position": [
780,
480
],
"parameters": {
"name": "={{ $('Get data from Google Sheet').item.json['Background (EN)'] }}.mp3",
"driveId": {
"__rl": true,
"mode": "id",
"value": "1Sfv2PvIHF0J3-5IOYFdZp2-4LNPOoSX1"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "root",
"cachedResultName": "/ (Root folder)"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "OEWvSsY5xiUhqOnx",
"name": "Google Drive account - PeakWave"
}
},
"typeVersion": 3,
"alwaysOutputData": true,
"notes": "This googleDrive node performs automated tasks as part of the workflow."
},
{
"id": "2a628e8a-077a-4999-9ef7-8d28ac4433ac",
"name": "Save Video Background Locally1",
"type": "n8n-nodes-base.readWriteFile",
"position": [
1040,
280
],
"parameters": {
"options": {},
"fileName": "=VideoBackground.mp4",
"operation": "write"
},
"typeVersion": 1,
"notes": "This readWriteFile node performs automated tasks as part of the workflow."
},
{
"id": "fa5cce8d-4b50-4221-9446-050f497b30a9",
"name": "Get Binary Video Background",
"type": "n8n-nodes-base.httpRequest",
"position": [
820,
280
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"options": {
"response": {
"response": {
"responseFormat": "file"
}
}
}
},
"typeVersion": 4.2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "ea003577-5467-4acb-a33b-b4b30a03a35f",
"name": "Save Music Background Locally1",
"type": "n8n-nodes-base.readWriteFile",
"position": [
980,
560
],
"parameters": {
"options": {
"append": false
},
"fileName": "=SoundBackground.mp3",
"operation": "write"
},
"typeVersion": 1,
"notes": "This readWriteFile node performs automated tasks as part of the workflow."
},
{
"id": "b9332740-c4e0-40f9-bc0d-c550c8f0f96d",
"name": "Prepare Overlay Text (Quote & Author)1",
"type": "n8n-nodes-base.code",
"position": [
300,
860
],
"parameters": {
"jsCode": "// Define separate configuration for the quote and the author\nconst quoteFont = \"Kanit-Italic.ttf\"; \nconst quoteFontSize = 70;\nconst authorFont = \"Kanit-Italic.ttf\"; \nconst authorFontSize = 50;\nconst fontColor = \"white\";\nconst lineHeightMultiplier = 1.1;\nconst videoWidth = 1080;\nconst margin = 40; \n\n// Effective width for the quote text\nconst effectiveVideoWidth = videoWidth - 2 * margin;\n\n// Estimate average character width based on quoteFontSize\nconst avgCharWidth = quoteFontSize * 0.6;\nconst maxCharsPerLine = Math.floor(effectiveVideoWidth / avgCharWidth);\n\n// Retrieve the quote and author from \"Select Random Video, Music & Quote\"\nconst transcript = $('Get data from Google Sheet').first().json['Quote (Thai)'];\nif (!transcript) {\n throw new Error(\"Quote not found\");\n}\n\nconst author = $('Get data from Google Sheet').first().json['Pen Name (Thai)'];\nif (!author) {\n throw new Error(\"Author not found\");\n}\n\n// Split transcript into words and group them into lines\nconst words = transcript.split(' ');\nconst lines = [];\nlet currentLine = \"\";\nlet currentCharCount = 0;\n\nwords.forEach(word => {\n const wordLength = word.length;\n const additionalSpace = currentLine ? 1 : 0;\n const potentialLength = currentCharCount + additionalSpace + wordLength;\n if (potentialLength <= maxCharsPerLine) {\n currentLine += (currentLine ? \" \" : \"\") + word;\n currentCharCount = potentialLength;\n } else {\n lines.push(currentLine);\n currentLine = word;\n currentCharCount = wordLength;\n }\n});\nif (currentLine) {\n lines.push(currentLine);\n}\n\n// Calculate layout for the quote block\nconst lineHeight = quoteFontSize * lineHeightMultiplier;\nconst totalHeight = lines.length * lineHeight;\n\n// Build drawtext commands for quote lines\nconst quoteCommands = lines.map((line, index) => {\n const escapedLine = line.replace(/'/g, \"\\\\'\");\n return `drawtext=fontfile=${quoteFont}:text='${escapedLine}':fontsize=${quoteFontSize}:fontcolor=${fontColor}:x=(w-text_w)/2:y=((h-${totalHeight})/2)+(${index}*${lineHeight})`;\n});\n\n// Build the drawtext command for author\nconst authorY = `((h-${totalHeight})/2)+(${lines.length}*${lineHeight})+20`;\nconst escapedAuthor = author.replace(/'/g, \"\\\\'\");\nconst authorCommand = `drawtext=fontfile=${authorFont}:text='${escapedAuthor}':fontsize=${authorFontSize}:fontcolor=${fontColor}:x=w-text_w-${margin}:y=${authorY}`;\n\n// Combine all commands into one drawtext filter string\nconst fullDrawTextFilter = quoteCommands.concat(authorCommand).join(\", \");\n\n// Return the prepared filter string\nreturn {\n json: {\n drawText: fullDrawTextFilter\n }\n};"
},
"typeVersion": 2,
"notes": "This code node performs automated tasks as part of the workflow."
},
{
"id": "79764093-f6ca-459b-a73c-3326fe82fafa",
"name": "Generate Final Video Clip1",
"type": "n8n-nodes-base.executeCommand",
"position": [
480,
860
],
"parameters": {
"command": "=ffmpeg -i {{ $('Save Video Background Locally1').item.json.fileName }} -i {{ $('Save Music Background Locally1').item.json.fileName }} -filter_complex \"[0:v]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920[vid]; color=black@0.3:size=1080x1920:d=10[bg]; [vid][bg]overlay=shortest=1[bgvid]; [bgvid]{{ $json.drawText }}[outv]; [1:a]volume=0.8[aout]\" -map \"[outv]\" -map \"[aout]\" -aspect 9:16 -c:v libx264 -c:a aac -shortest output.mp4 -y"
},
"typeVersion": 1,
"notes": "This executeCommand node performs automated tasks as part of the workflow."
},
{
"id": "3c301b6b-d6cb-41af-ac52-5722bed8470d",
"name": "Initiate YouTube Resumable Upload",
"type": "n8n-nodes-base.httpRequest",
"position": [
700,
860
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"body": "={\n \"snippet\": {\n \"title\": \"{{ $('Get data from Google Sheet').item.json['Quote (Thai)'] }}\",\n \"description\": \"{{ $('Get data from Google Sheet').item.json['Quote (Thai)'] }}\\n{{ $('Get data from Google Sheet').item.json['Pen Name (Thai)'] }}\",\n \"defaultLanguage\": \"en\",\n \"defaultAudioLanguage\": \"en\"\n },\n \"status\": {\n \"privacyStatus\": \"public\",\n \"license\": \"youtube\",\n \"embeddable\": true,\n \"publicStatsViewable\": true,\n \"madeForKids\": false\n }\n}",
"method": "POST",
"options": {
"response": {
"response": {
"fullResponse": true
}
}
},
"sendBody": true,
"contentType": "raw",
"sendHeaders": true,
"authentication": "{{ $credentials.predefinedCredentialType }}",
"rawContentType": "RAW/JSON",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "X-Upload-Content-Type",
"value": "video/webm"
}
]
},
"nodeCredentialType": "YOUR_CREDENTIAL_HERE"
},
"credentials": {
"youTubeOAuth2Api": {
"id": "f9uNp5YNQMnXrNw2",
"name": "YouTube account"
}
},
"typeVersion": 4.2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "dbde06b3-e7ba-4b7e-9d58-0a06f88b5176",
"name": "Read output file",
"type": "n8n-nodes-base.readWriteFile",
"position": [
880,
860
],
"parameters": {
"options": {},
"fileSelector": "=output.mp4"
},
"typeVersion": 1,
"notes": "This readWriteFile node performs automated tasks as part of the workflow."
},
{
"id": "0b9b92e0-5500-4dca-a622-f63b3cdf0878",
"name": "Upload Video to YouTube",
"type": "n8n-nodes-base.httpRequest",
"position": [
1080,
860
],
"parameters": {
"url": "{{ $env.BASE_URL }}",
"method": "PUT",
"options": {},
"sendBody": true,
"contentType": "binaryData",
"sendHeaders": true,
"authentication": "{{ $credentials.predefinedCredentialType }}",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "video/webm"
}
]
},
"inputDataFieldName": "data",
"nodeCredentialType": "YOUR_CREDENTIAL_HERE"
},
"credentials": {
"youTubeOAuth2Api": {
"id": "f9uNp5YNQMnXrNw2",
"name": "YouTube account"
}
},
"typeVersion": 4.2,
"notes": "This httpRequest node performs automated tasks as part of the workflow."
},
{
"id": "721078b6-b1e2-4077-b1ff-696cb3765675",
"name": "Update Quote Upload Status",
"type": "n8n-nodes-base.googleSheets",
"position": [
1280,
860
],
"parameters": {
"columns": {
"value": {
"Index": "={{ $('Get data from Google Sheet').item.json.Index }}",
"Video Status": "={{ $env.WEBHOOK_URL }}{{ $json.id }}"
},
"schema": [
{
"id": "Index",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Index",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Quote (Thai)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Quote (Thai)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Pen Name (Thai)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Pen Name (Thai)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background (EN)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background (EN)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Prompt (EN)",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Prompt (EN)",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background Image",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background Image",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Background Video",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Background Video",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Music Background",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Music Background",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Video Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Video Status",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Index"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "{{ $env.WEBHOOK_URL }}",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "1p1iPoiu2uI3qGbHi0diS7QwsMcLuzDIqwo3AeSUVrGQ"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "Ra2f1dlqOJ13jTtb",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5,
"notes": "This googleSheets node performs automated tasks as part of the workflow."
},
{
"id": "8900abd9-9f35-46a3-9b59-883ff16b0764",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
660,
760
],
"parameters": {
"color": 5,
"width": 760,
"height": 300,
"content": "## Video Upload & Post-Processing\nUpload the final video to YouTube using the YouTube API and update your Google Sheets with upload statuses and YouTube links."
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
},
{
"id": "07cdec2c-9677-46f0-8038-641c4c191059",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
-80
],
"parameters": {
"color": 6,
"width": 340,
"height": 240,
"content": "## Get Quote\nRetrieve quote data from Google Sheets including text, author, and background prompts."
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
},
{
"id": "aeadbc59-13d7-4755-b38d-6d4946ecfa78",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
760
],
"parameters": {
"color": 6,
"width": 400,
"height": 300,
"content": "## Combine All\nMerge video, sound, and quote text into final clip using FFmpeg."
},
"typeVersion": 1,
"notes": "This stickyNote node performs automated tasks as part of the workflow."
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1",
"saveManualExecutions": true,
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": null,
"timezone": "UTC",
"executionTimeout": 3600,
"maxExecutions": 1000,
"retryOnFail": true,
"retryCount": 3,
"retryDelay": 1000
},
"versionId": "2c56841d-3045-4d6d-b643-0f3804bf2c3e",
"connections": {
"ec44d567-dfc8-4561-87df-903724225247": {
"main": [
[
{
"node": "error-handler-ec44d567-dfc8-4561-87df-903724225247",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ec44d567-dfc8-4561-87df-903724225247-86581695",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ec44d567-dfc8-4561-87df-903724225247-58cd0530",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ec44d567-dfc8-4561-87df-903724225247-438758b3",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ec44d567-dfc8-4561-87df-903724225247-52b28ac5",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ec44d567-dfc8-4561-87df-903724225247-4b2395de",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ec44d567-dfc8-4561-87df-903724225247-2db044ae",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ec44d567-dfc8-4561-87df-903724225247-c6ed7c5d",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ec44d567-dfc8-4561-87df-903724225247-a5f235bf",
"type": "main",
"index": 0
}
]
]
},
"ad260a51-e981-47cc-8600-967c1c748814": {
"main": [
[
{
"node": "error-handler-ad260a51-e981-47cc-8600-967c1c748814",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ad260a51-e981-47cc-8600-967c1c748814-6e35ce32",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ad260a51-e981-47cc-8600-967c1c748814-319f5f3a",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ad260a51-e981-47cc-8600-967c1c748814-3a38b9eb",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ad260a51-e981-47cc-8600-967c1c748814-f1500c0e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ad260a51-e981-47cc-8600-967c1c748814-c8b9b05b",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ad260a51-e981-47cc-8600-967c1c748814-8a43725a",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ad260a51-e981-47cc-8600-967c1c748814-08f4d82a",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-ad260a51-e981-47cc-8600-967c1c748814-dfcdd7ae",
"type": "main",
"index": 0
}
]
]
},
"801dd794-4cf8-42f7-8102-a3a4853cae39": {
"main": [
[
{
"node": "error-handler-801dd794-4cf8-42f7-8102-a3a4853cae39",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-801dd794-4cf8-42f7-8102-a3a4853cae39-0e2b27c0",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-801dd794-4cf8-42f7-8102-a3a4853cae39-152c231e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-801dd794-4cf8-42f7-8102-a3a4853cae39-97a7bad9",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-801dd794-4cf8-42f7-8102-a3a4853cae39-3be0cc6f",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-801dd794-4cf8-42f7-8102-a3a4853cae39-60388776",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-801dd794-4cf8-42f7-8102-a3a4853cae39-a95b6775",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-801dd794-4cf8-42f7-8102-a3a4853cae39-9373007e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-801dd794-4cf8-42f7-8102-a3a4853cae39-b78cb61c",
"type": "main",
"index": 0
}
]
]
},
"c3f97a19-9ea8-4489-8629-767542f0fddb": {
"main": [
[
{
"node": "error-handler-c3f97a19-9ea8-4489-8629-767542f0fddb",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-c3f97a19-9ea8-4489-8629-767542f0fddb-4ad4c9b5",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-c3f97a19-9ea8-4489-8629-767542f0fddb-f90ac4c3",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-c3f97a19-9ea8-4489-8629-767542f0fddb-fc90d608",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-c3f97a19-9ea8-4489-8629-767542f0fddb-36151948",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-c3f97a19-9ea8-4489-8629-767542f0fddb-a46180d8",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-c3f97a19-9ea8-4489-8629-767542f0fddb-7fa1e4e1",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-c3f97a19-9ea8-4489-8629-767542f0fddb-fb0857fd",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-c3f97a19-9ea8-4489-8629-767542f0fddb-57bc863d",
"type": "main",
"index": 0
}
]
]
},
"8d2035a8-d4a0-4a33-bae3-c18b530487d4": {
"main": [
[
{
"node": "error-handler-8d2035a8-d4a0-4a33-bae3-c18b530487d4",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-8d2035a8-d4a0-4a33-bae3-c18b530487d4-434fe9c9",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-8d2035a8-d4a0-4a33-bae3-c18b530487d4-88485159",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-8d2035a8-d4a0-4a33-bae3-c18b530487d4-f45107a1",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-8d2035a8-d4a0-4a33-bae3-c18b530487d4-08b6003b",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-8d2035a8-d4a0-4a33-bae3-c18b530487d4-da2c32ad",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-8d2035a8-d4a0-4a33-bae3-c18b530487d4-d25ffa7f",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-8d2035a8-d4a0-4a33-bae3-c18b530487d4-c1155180",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-8d2035a8-d4a0-4a33-bae3-c18b530487d4-e0bcdf68",
"type": "main",
"index": 0
}
]
]
},
"fa5cce8d-4b50-4221-9446-050f497b30a9": {
"main": [
[
{
"node": "error-handler-fa5cce8d-4b50-4221-9446-050f497b30a9",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-fa5cce8d-4b50-4221-9446-050f497b30a9-a2db36e5",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-fa5cce8d-4b50-4221-9446-050f497b30a9-06a8f4c1",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-fa5cce8d-4b50-4221-9446-050f497b30a9-b65ccc55",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-fa5cce8d-4b50-4221-9446-050f497b30a9-b83945d6",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-fa5cce8d-4b50-4221-9446-050f497b30a9-fd62a5ce",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-fa5cce8d-4b50-4221-9446-050f497b30a9-cf18af0a",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-fa5cce8d-4b50-4221-9446-050f497b30a9-95073ddc",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-fa5cce8d-4b50-4221-9446-050f497b30a9-4b7ee85c",
"type": "main",
"index": 0
}
]
]
},
"3c301b6b-d6cb-41af-ac52-5722bed8470d": {
"main": [
[
{
"node": "error-handler-3c301b6b-d6cb-41af-ac52-5722bed8470d",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-3c301b6b-d6cb-41af-ac52-5722bed8470d-3945e809",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-3c301b6b-d6cb-41af-ac52-5722bed8470d-7bd8ac31",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-3c301b6b-d6cb-41af-ac52-5722bed8470d-11d28a9e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-3c301b6b-d6cb-41af-ac52-5722bed8470d-2c8e125c",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-3c301b6b-d6cb-41af-ac52-5722bed8470d-1e7697cc",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-3c301b6b-d6cb-41af-ac52-5722bed8470d-4382bcab",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-3c301b6b-d6cb-41af-ac52-5722bed8470d-372c5eea",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-3c301b6b-d6cb-41af-ac52-5722bed8470d-45348b23",
"type": "main",
"index": 0
}
]
]
},
"0b9b92e0-5500-4dca-a622-f63b3cdf0878": {
"main": [
[
{
"node": "error-handler-0b9b92e0-5500-4dca-a622-f63b3cdf0878",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0b9b92e0-5500-4dca-a622-f63b3cdf0878-1396813f",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0b9b92e0-5500-4dca-a622-f63b3cdf0878-f55ae35b",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0b9b92e0-5500-4dca-a622-f63b3cdf0878-5718674d",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0b9b92e0-5500-4dca-a622-f63b3cdf0878-a4dd7090",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0b9b92e0-5500-4dca-a622-f63b3cdf0878-9b8a604b",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0b9b92e0-5500-4dca-a622-f63b3cdf0878-b833f79e",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0b9b92e0-5500-4dca-a622-f63b3cdf0878-2980235c",
"type": "main",
"index": 0
}
],
[
{
"node": "error-handler-0b9b92e0-5500-4dca-a622-f63b3cdf0878-60936c2e",
"type": "main",
"index": 0
}
]
]
},
"64132a39-ad42-4158-9eec-5b6bfdc7bca2": {
"main": [
[
{
"node": "error-handler-64132a39-ad42-4158-9eec-5b6bfdc7bca2-3595d14e",
"type": "main",
"index": 0
}
]
]
},
"66af781a-2012-426e-a623-e90e21e8b2a1": {
"main": [
[
{
"node": "error-handler-66af781a-2012-426e-a623-e90e21e8b2a1-443f1442",
"type": "main",
"index": 0
}
]
]
},
"04074118-9f30-4648-8aab-9574156a76ba": {
"main": [
[
{
"node": "error-handler-04074118-9f30-4648-8aab-9574156a76ba-a8f0de8a",
"type": "main",
"index": 0
}
]
]
},
"35ca939b-fb27-48cf-8036-f35618ceaee0": {
"main": [
[
{
"node": "error-handler-35ca939b-fb27-48cf-8036-f35618ceaee0-90ba0a48",
"type": "main",
"index": 0
}
]
]
},
"15b9e2b1-72d9-42bf-a8a4-0ad0a01c5e5f": {
"main": [
[
{
"node": "error-handler-15b9e2b1-72d9-42bf-a8a4-0ad0a01c5e5f-4d809a99",
"type": "main",
"index": 0
}
]
]
},
"2a628e8a-077a-4999-9ef7-8d28ac4433ac": {
"main": [
[
{
"node": "error-handler-2a628e8a-077a-4999-9ef7-8d28ac4433ac-e3077707",
"type": "main",
"index": 0
}
]
]
},
"ea003577-5467-4acb-a33b-b4b30a03a35f": {
"main": [
[
{
"node": "error-handler-ea003577-5467-4acb-a33b-b4b30a03a35f-c1eebaff",
"type": "main",
"index": 0
}
]
]
},
"dbde06b3-e7ba-4b7e-9d58-0a06f88b5176": {
"main": [
[
{
"node": "error-handler-dbde06b3-e7ba-4b7e-9d58-0a06f88b5176-ad367bc6",
"type": "main",
"index": 0
}
]
]
},
"721078b6-b1e2-4077-b1ff-696cb3765675": {
"main": [
[
{
"node": "error-handler-721078b6-b1e2-4077-b1ff-696cb3765675-f6a1c1f6",
"type": "main",
"index": 0
}
]
]
}
},
"description": "Automated workflow: AutoQoutesV2_template. This workflow integrates 10 different services: stickyNote, httpRequest, wait, code, readWriteFile. It contains 53 nodes and follows best practices for error handling and security.",
"notes": "Excellent quality workflow: AutoQoutesV2_template. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."
}