8
n8n 中文网amn8n.com

Heygen

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 19 个节点。主要使用 If, Wait, HttpRequest, ManualTrigger, Agent 等节点。 自动化新闻视频生成,使用HeyGen AI、Apify和GPT-4.1 Mini

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "w8QekiNgdTB5djK1",
  "meta": {
    "instanceId": "8cf060ebda3ec45b5ebb6a30779eaf0c03dfba83865feab3f32adb31b82caa08"
  },
  "name": "Heygen",
  "tags": [],
  "nodes": [
    {
      "id": "119f9823-bc06-42fd-85c3-76fe550fa241",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        704,
        720
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "10660213-21c8-4033-bb66-c9117bdcd766",
      "name": "生成视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        768,
        384
      ],
      "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\": \"avatar_id\",\n        \"avatar_style\": \"normal\"\n      },\n      \"voice\": {\n        \"type\": \"text\",\n        \"input_text\": \"Hey AI Automation Society Family. You guys rock.\",\n        \"voice_id\": \"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"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6822a4a1-44fa-4d7d-bbf1-896467040057",
      "name": "获取语音",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1184,
        112
      ],
      "parameters": {
        "url": "https://api.heygen.com/v2/voices",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "23db5e20-fbd7-4b69-93d3-11a7b5143b03",
      "name": "获取虚拟形象",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        768,
        112
      ],
      "parameters": {
        "url": "https://api.heygen.com/v2/avatars",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "64cb67a7-7689-4e6d-949e-8f329d6cb7c4",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 260,
        "content": "# 获取虚拟形象ID"
      },
      "typeVersion": 1
    },
    {
      "id": "7dc2273e-3558-4d53-8270-88550e98787c",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 260,
        "content": "# 获取语音ID"
      },
      "typeVersion": 1
    },
    {
      "id": "e961a99e-730a-4765-8fe2-f6b7d8498054",
      "name": "获取视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1184,
        384
      ],
      "parameters": {
        "url": "https://api.heygen.com/v1/video_status.get",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "video_id",
              "value": "={{ $json.data.video_id }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0e16f240-5132-4973-a02e-9c89bea17030",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        288
      ],
      "parameters": {
        "color": 6,
        "width": 400,
        "height": 300,
        "content": "# 创建视频"
      },
      "typeVersion": 1
    },
    {
      "id": "58027971-0bb5-41d5-9f85-5a1e226fce58",
      "name": "新闻",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        864,
        720
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/apify~website-content-crawler/run-sync-get-dataset-items",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n    \"aggressivePrune\": false,\n    \"clickElementsCssSelector\": \"[aria-expanded=\\\"false\\\"]\",\n    \"clientSideMinChangePercentage\": 15,\n    \"crawlerType\": \"playwright:adaptive\",\n    \"debugLog\": false,\n    \"debugMode\": false,\n    \"expandIframes\": true,\n    \"ignoreCanonicalUrl\": false,\n    \"keepUrlFragments\": false,\n    \"proxyConfiguration\": {\n        \"useApifyProxy\": true\n    },\n    \"readableTextCharThreshold\": 100,\n    \"removeCookieWarnings\": true,\n    \"removeElementsCssSelector\": \"nav, footer, script, style, noscript, svg, img[src^='data:'],\\n[role=\\\"alert\\\"],\\n[role=\\\"banner\\\"],\\n[role=\\\"dialog\\\"],\\n[role=\\\"alertdialog\\\"],\\n[role=\\\"region\\\"][aria-label*=\\\"skip\\\" i],\\n[aria-modal=\\\"true\\\"]\",\n    \"renderingTypeDetectionPercentage\": 10,\n    \"respectRobotsTxtFile\": true,\n    \"saveFiles\": false,\n    \"saveHtml\": false,\n    \"saveHtmlAsFile\": false,\n    \"saveMarkdown\": true,\n    \"saveScreenshots\": false,\n    \"startUrls\": [\n        {\n            \"url\": \"https://www.morningbrew.com/issues/latest\",\n            \"method\": \"GET\"\n        }\n    ],\n    \"useSitemaps\": false\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "a16f49b8-db54-4c67-b771-29dbf2d717e1",
      "name": "脚本编写器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1024,
        720
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=### 📢 System Prompt: Morning Brew Video Recap Script Generator\n\nYou are a sharp, engaging scriptwriter AI who specializes in converting daily newsletter content into **fast-paced, digestible news recaps** for short-form video. You will be given the full text of a *Morning Brew* issue. Your job is to create a **concise 10–20 second script** (around 40–60 words) summarizing **the top 2–4 most important stories** in an **engaging, headline-driven tone** that sounds natural when spoken aloud.\n\n---\n\n### ✅ Core Requirements:\n- Output a **single paragraph** written for **spoken delivery**, not robotic narration.\n- Cover **only the top 2–4 stories** with the widest impact or highest interest.\n- Use a **punchy, conversational tone** — brief but informative.\n- Do **not include** intros, outros, or calls to action.\n- Keep the total script under **20 seconds of spoken content** (~40–60 words).\n\n---\n\n### 🗣️ Style Example:\n\n\"Stocks jumped after inflation cooled again in April, TikTok sued the US government over its forced sale law, and McDonald’s is dropping AI drive-thrus after too many sauce mishaps.\"\n\n---\n\n### 💡 Notes:\n- Prioritize clarity and relevance.\n- Avoid niche stories unless they’re especially compelling or viral.\n- Think of the recap as something someone could say on a podcast or short TikTok video.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "2c02c01e-8f81-47ed-8a96-21787bae81f0",
      "name": "GPT 4.1 Mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1152,
        864
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "5021e8aa-a5f6-48d2-b5d6-01c120447d70",
      "name": "获取视频1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1008,
        960
      ],
      "parameters": {
        "url": "https://api.heygen.com/v1/video_status.get",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "video_id",
              "value": "={{ $('Generate Video1').item.json.data.video_id }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5fc211f7-a172-45f4-80b4-2daf263a9dc7",
      "name": "30 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        848,
        960
      ],
      "webhookId": "c6346cbc-9d67-4868-80a4-bfc927f0830a",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "9e1fdc59-3f59-4700-87dd-59348f47d328",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        1168,
        960
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "dd44e8b9-64ae-4a91-8d19-966910447f71",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "11e66f0d-ee78-4079-9354-98ae32c1fd79",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        1344,
        960
      ],
      "webhookId": "9f7623f7-6605-4455-a927-09b536ee9e99",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "a8ba10ae-eb12-4482-9124-ba853f722407",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        608
      ],
      "parameters": {
        "color": 4,
        "width": 960,
        "height": 560,
        "content": "# 创建视频(带轮询)"
      },
      "typeVersion": 1
    },
    {
      "id": "ffd56330-7fc5-4a8a-90b0-1f852db2ffaf",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        288
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 300,
        "content": "# 获取视频"
      },
      "typeVersion": 1
    },
    {
      "id": "777c35f3-788a-40ea-abb9-7e109de28dbd",
      "name": "生成视频1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1360,
        720
      ],
      "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\": \"avatar_id\",\n        \"avatar_style\": \"normal\"\n      },\n      \"voice\": {\n        \"type\": \"text\",\n        \"input_text\": \"Hey AI Automation Society Family. You guys rock.\",\n        \"voice_id\": \"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"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "228d907b-f1fa-4af4-bcc0-3a5d2415bf34",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 600,
        "height": 600,
        "content": "# 🛠️设置指南"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1d4c1db2-af0c-402b-979d-ed781eccbe31",
  "connections": {
    "If": {
      "main": [
        [],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "News": {
      "main": [
        [
          {
            "node": "Script Writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Video1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "30 Seconds": {
      "main": [
        [
          {
            "node": "Get Video1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video1": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT 4.1 Mini": {
      "ai_languageModel": [
        [
          {
            "node": "Script Writer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Script Writer": {
      "main": [
        [
          {
            "node": "Generate Video1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Video": {
      "main": [
        [
          {
            "node": "Get Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Video1": {
      "main": [
        [
          {
            "node": "30 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

工作流信息
难度等级
高级
节点数量19
分类2
节点类型7
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者

Hi 👋 I'm Jadai kongolo. As an AI Automation Expert, I’m passionate about simplifying tech and empowering small businesses and young coders through AI automation. With my AI agency, Oki, I create efficient, n8n-powered workflows that save time, streamline operations, and boost growth for SMBs.

外部链接
在 n8n.io 查看

分享此工作流