「Reddit帖子自动化转视频:n8n工作流详解」
从抓取Reddit内容到AI解析,
再到视频渲染与上传——
这份n8n工作流定义,
帮你省去90%重复劳动。
{
"name": "Reddit Post and Video Automation Workflow",
"nodes": [
{
"parameters": {
"triggerOn": "manual"
},
"name": "Form Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [250, 300],
"webhookId": "form-trigger-webhook"
},
{
"parameters": {
"url": "https://www.reddit.com",
"options": {}
},
"name": "Scrape Reddit Post",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [450, 300],
"credentials": {}
},
{
"parameters": {
"mode": "parseHtml",
"options": {
"output": "structured"
}
},
"name": "AI Content Parsing",
"type": "n8n-nodes-base.html",
"typeVersion": 1,
"position": [650, 300],
"credentials": {
"googleGeminiApi": {
"apiKey": "your-gemini-api-key"
}
}
},
{
"parameters": {
"url": "https://api.reddit-image-generator.com",
"options": {
"method": "GET",
"headerParameters": {
"Authorization": "Bearer your-api-key"
}
}
},
"name": "Generate And Upload Reddit Post Image",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [850, 300],
"credentials": {}
},
{
"parameters": {
"filePath": "reddit_image.jpg",
"operation": "upload"
},
"name": "Upload Image",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 1,
"position": [1050, 250],
"credentials": {
"googleDriveApi": {
"refreshToken": "your-google-drive-refresh-token"
}
}
},
{
"parameters": {
"filePath": "reddit_image.jpg",
"operation": "share"
},
"name": "Share File",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 1,
"position": [1050, 350],
"credentials": {
"googleDriveApi": {
"refreshToken": "your-google-drive-refresh-token"
}
}
},
{
"parameters": {
"url": "https://api.replicate.com/v1/audio",
"options": {
"method": "POST",
"body": {
"model": "minimax/speech-02-hd"
}
}
},
"name": "Generate Audio From Replicate API",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [1250, 300],
"credentials": {
"replicateApi": {
"apiKey": "your-replicate-api-key"
}
}
},
{
"parameters": {
"filePath": "audio_file.mp3",
"operation": "upload"
},
"name": "Upload Audio to GDrive",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 1,
"position": [1450, 300],
"credentials": {
"googleDriveApi": {
"refreshToken": "your-google-drive-refresh-token"
}
}
},
{
"parameters": {
"resource": "file",
"operation": "getAll",
"filters": {
"name": "clips"
}
},
"name": "Get Clips Folder",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 1,
"position": [1650, 200],
"credentials": {
"googleDriveApi": {
"refreshToken": "your-google-drive-refresh-token"
}
}
},
{
"parameters": {
"resource": "file",
"operation": "getAll",
"filters": {
"name": "clips/*"
}
},
"name": "List Clips Files",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 1,
"position": [1650, 300],
"credentials": {
"googleDriveApi": {
"refreshToken": "your-google-drive-refresh-token"
}
}
},
{
"parameters": {
"functionCode": "return $json.randomItem($node['List Clips Files'].json);"
},
"name": "Aggregate Clips & Select A Random Clip",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [1650, 400],
"credentials": {}
},
{
"parameters": {
"url": "https://api.json2video.cc/render",
"options": {
"method": "POST",
"body": {
"renderObject": {}
}
}
},
"name": "Start The Video Rendering",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [1850, 300],
"credentials": {}
},
{
"parameters": {
"url": "https://api.json2video.cc/status",
"options": {
"method": "GET"
}
},
"name": "Check Progress",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [2050, 300],
"credentials": {}
},
{
"parameters": {
"functionCode": "if ($node['Check Progress'].json.status === 'completed') { return $node['Check Progress'].json; } return null;"
},
"name": "If True",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [2250, 300],
"credentials": {}
},
{
"parameters": {
"filePath": "video_file.mp4",
"operation": "upload"
},
"name": "Upload the Video",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 1,
"position": [2450, 300],
"credentials": {
"googleDriveApi": {
"refreshToken": "your-google-drive-refresh-token"
}
}
}
],
"connections": {
"Form Trigger": {
"main": [
[
{
"node": "Scrape Reddit Post",
"type": "main",
"index": 0
}
]
]
},
"Scrape Reddit Post": {
"main": [
[
{
"node": "AI Content Parsing",
"type": "main",
"index": 0
}
]
]
},
"AI Content Parsing": {
"main": [
[
{
"node": "Generate And Upload Reddit Post Image",
"type": "main",
"index": 0
}
]
]
},
"Generate And Upload Reddit Post Image": {
"main": [
[
{
"node": "Upload Image",
"type": "main",
"index": 0
}
],
[
{
"node": "Share File",
"type": "main",
"index": 0
}
]
]
},
"Upload Image": {
"main": [
[
{
"node": "Generate Audio From Replicate API",
"type": "main",
"index": 0
}
]
]
},
"Share File": {
"main": [
[
{
"node": "Generate Audio From Replicate API",
"type": "main",
"index": 0
}
]
]
},
"Generate Audio From Replicate API": {
"main": [
[
{
"node": "Upload Audio to GDrive",
"type": "main",
"index": 0
}
]
]
},
"Upload Audio to GDrive": {
"main": [
[
{
"node": "Get Clips Folder",
"type": "main",
"index": 0
},
{
"node": "List Clips Files",
"type": "main",
"index": 0
},
{
"node": "Aggregate Clips & Select A Random Clip",
"type": "main",
"index": 0
}
]
]
},
"Aggregate Clips & Select A Random Clip": {
"main": [
[
{
"node": "Start The Video Rendering",
"type": "main",
"index": 0
}
]
]
},
"Start The Video Rendering": {
"main": [
[
{
"node": "Check Progress",
"type": "main",
"index": 0
}
]
]
},
"Check Progress": {
"main": [
[
{
"node": "If True",
"type": "main",
"index": 0
}
]
]
},
"If True": {
"main": [
[
{
"node": "Upload the Video",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
}
}
Notes by Grok:
Node Types: I used n8n's built-in node types (e.g., webhook, httpRequest, googleDrive, function, if) to match the actions in the flowchart. You may need to adjust the exact parameters or credentials based on your setup.
Credentials: Placeholder API keys and refresh tokens are included (e.g., your-api-key). Replace these with actual credentials.
Positions: Approximate position values are set to reflect the layout in the image, but you can adjust them in the n8n UI.
Connections: The connections object defines the flow between nodes, following the sequence in the image.
Required APIs: The workflow assumes the use of Reddit Post Render API and Replicate API, which are integrated via HTTP requests. You’ll need to configure these APIs with valid endpoints and keys.