8
n8n 中文网amn8n.com

使用Dumpling AI和HeyGen从最新AI新闻生成虚拟形象视频

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 If, Wait, Limit, SplitOut, Aggregate 等节点。 使用Dumpling AI、GPT-4o和HeyGen创建AI新闻虚拟形象视频

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "I0Tzx8whIWYdQJVn",
  "meta": {
    "instanceId": "a1ae5c8dc6c65e674f9c3947d083abcc749ef2546dff9f4ff01de4d6a36ebfe6",
    "templateCredsSetupCompleted": true
  },
  "name": "使用Dumpling AI和HeyGen从最新AI新闻生成虚拟形象视频",
  "tags": [],
  "nodes": [
    {
      "id": "8a457904-7d80-4bf8-a433-d25dbce33c45",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -840,
        -95
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "90cf1daa-9652-4717-84af-f96a1a3d7dc6",
      "name": "Dumpling AI:搜索AI新闻",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -620,
        -95
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/search-news",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"query\": \"AI Agent\",\n  \"language\": \"en\",\n  \"dateRange\": \"pastHour\",\n  \"page\": \"1\"\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "RLFzAcGRepr5eXZB",
          "name": "Dumpling AI-n8n"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "321da41d-6a13-4a00-95c1-915fa6d8f5e6",
      "name": "拆分:单个新闻条目",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -400,
        -95
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "news"
      },
      "typeVersion": 1
    },
    {
      "id": "d7e5fcf2-7a24-4277-9459-9e828d3a98ef",
      "name": "限制:前4个新闻结果",
      "type": "n8n-nodes-base.limit",
      "position": [
        -180,
        -95
      ],
      "parameters": {
        "maxItems": 4
      },
      "typeVersion": 1
    },
    {
      "id": "c1847dce-9564-44ae-b9a9-1ac48e42d2c8",
      "name": "Dumpling AI:抓取文章内容",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        40,
        -95
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/scrape",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"url\": \"{{ $json.link }}\",\n  \"cleaned\": \"true\"\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "RLFzAcGRepr5eXZB",
          "name": "Dumpling AI-n8n"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f6e8c80e-72b7-47ba-a3b6-0d43a0ee1615",
      "name": "合并:整合抓取的新闻内容",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        260,
        -95
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "content"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7c203f11-51ca-4aaa-a3c5-a571af36accd",
      "name": "GPT-4o代理:编写视频脚本",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        480,
        -95
      ],
      "parameters": {
        "text": "=Here is the topic:{{ $json.content }}\n\n\nHere is the news article:{{ $('Dumpling AI: Search AI News').item.json.searchParameters.q }}\n",
        "options": {
          "systemMessage": "=You are a creative content writer. I will give you a news article and the intended topic or angle I want to focus on. Your job is to turn that into a short, engaging script suitable for a 30 to 60-second video. Write in a natural, conversational tone that sounds like someone talking to a general audience. Keep it simple, clear, and focused on the most interesting or important angle based on the topic I provide. Avoid technical jargon. The goal is to grab attention and make the message easy to understand and relatable. Very important: Output the final script as a single line only — no new lines, no paragraph breaks, no titles or formatting. Just plain text in one continuous sentence."
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "b5bc7652-ba15-4d8d-a3ab-08e65f7ea54f",
      "name": "GPT-4o模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        568,
        125
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "dd8NvMC6rvx8RITo",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c60ba871-f5a9-4ec2-b3d9-5aa4583c8f43",
      "name": "HeyGen:生成虚拟形象视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        856,
        -95
      ],
      "parameters": {
        "url": "https://api.heygen.com/v2/video/generate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"video_inputs\": [\n    {\n      \"character\": {\n        \"type\": \"avatar\",\n        \"avatar_id\": \"\",\n        \"avatar_style\": \"normal\"\n      },\n      \"voice\": {\n        \"type\": \"text\",\n        \"input_text\": \"{{ $json.output }}\",\n        \"voice_id\": \"\",\n        \"speed\": 1.1\n      }\n    }\n  ],\n  \"dimension\": {\n    \"width\": 1280,\n    \"height\": 720\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "h1B8sEXHl3ik4IwS",
          "name": "heygen 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "97b7db8d-2233-4bb5-b615-a93885ddfcfa",
      "name": "等待:HeyGen处理",
      "type": "n8n-nodes-base.wait",
      "position": [
        1076,
        -95
      ],
      "webhookId": "f78db6d8-9a63-4961-8abb-ac44b4c230d1",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "33b34d1e-4674-44fe-937e-ad907a6ff6ca",
      "name": "HeyGen:检查视频状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1296,
        -95
      ],
      "parameters": {
        "url": "https://api.heygen.com/v1/video_status.get",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "video_id",
              "value": "={{ $json.data.video_id }}"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "h1B8sEXHl3ik4IwS",
          "name": "heygen 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "27a6d57c-f518-43fd-93f0-2a237ccf0a99",
      "name": "条件判断:视频完成?",
      "type": "n8n-nodes-base.if",
      "position": [
        1516,
        -170
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "fbed8c0e-f2ad-4519-9eb9-1423731654ea",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "99219ffb-7d15-4393-877a-a9cb592c025b",
      "name": "等待:如果未完成则重试",
      "type": "n8n-nodes-base.wait",
      "position": [
        1736,
        5
      ],
      "webhookId": "82e9f0a0-05e2-4eae-9b8c-d08e554a9704",
      "parameters": {
        "amount": 20
      },
      "typeVersion": 1.1
    },
    {
      "id": "6761efd6-79c8-4a79-970e-a30d26a18336",
      "name": "Google Sheets:记录视频URL",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1736,
        -220
      ],
      "parameters": {
        "columns": {
          "value": {
            "Video link": "={{ $json.data.video_url }}"
          },
          "schema": [
            {
              "id": "Video link",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Video link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Video link"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1AUADRf5MafbEazIZKuEBuDb7ETBEpCI0WSEnxFDJqn4/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1AUADRf5MafbEazIZKuEBuDb7ETBEpCI0WSEnxFDJqn4/edit?usp=drivesdk",
          "cachedResultName": "Videos"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "GaJqJHuS5mQxap7q",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "294f5c10-e0fa-42c2-8a7a-f823ae4ed477",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -840,
        -700
      ],
      "parameters": {
        "width": 800,
        "height": 660,
        "content": "### 🎥 工作流概览:自动生成AI新闻虚拟形象视频"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3339c6da-749b-481d-85d4-e90f923c83c9",
  "connections": {
    " GPT-4o Model": {
      "ai_languageModel": [
        [
          {
            "node": "GPT-4o Agent: Write Video Script",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Dumpling AI: Search AI News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF: Video Completed?": {
      "main": [
        [
          {
            "node": "Google Sheets: Log Video URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": " Wait: Retry if Not Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit: Top 4 News Results": {
      "main": [
        [
          {
            "node": "Dumpling AI: Scrape Article Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HeyGen: Check Video Status": {
      "main": [
        [
          {
            "node": "IF: Video Completed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dumpling AI: Search AI News": {
      "main": [
        [
          {
            "node": "Split: Individual News Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait: For HeyGen to Process": {
      "main": [
        [
          {
            "node": "HeyGen: Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " Wait: Retry if Not Complete": {
      "main": [
        [
          {
            "node": "HeyGen: Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split: Individual News Items": {
      "main": [
        [
          {
            "node": "Limit: Top 4 News Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " HeyGen: Generate Avatar Video": {
      "main": [
        [
          {
            "node": "Wait: For HeyGen to Process",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4o Agent: Write Video Script": {
      "main": [
        [
          {
            "node": " HeyGen: Generate Avatar Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dumpling AI: Scrape Article Content": {
      "main": [
        [
          {
            "node": " Combine: Merge Scraped News Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " Combine: Merge Scraped News Content": {
      "main": [
        [
          {
            "node": "GPT-4o Agent: Write Video Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 内容创作, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量15
分类2
节点类型11
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流