8
n8n 中文网amn8n.com

使用 Dumpling AI、GPT-4 和 Captions.ai 将 TikTok 评论转化为 AI 头像视频

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 16 个节点。主要使用 If, Code, Wait, Webhook, Airtable 等节点。 使用Dumpling AI、GPT-4和Captions.ai将TikTok评论转换为AI头像视频

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • Airtable API Key
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "M0sdqMfhe8MshZEw",
  "meta": {
    "instanceId": "a1ae5c8dc6c65e674f9c3947d083abcc749ef2546dff9f4ff01de4d6a36ebfe6",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 Dumpling AI、GPT-4 和 Captions.ai 将 TikTok 评论转化为 AI 头像视频",
  "tags": [],
  "nodes": [
    {
      "id": "8b13b364-be17-4cdd-a8db-9fe5ba441165",
      "name": "按计划触发",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1232,
        176
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1211c905-6f77-487f-a226-2b3677042e8d",
      "name": "从数据表获取 TikTok 视频和评论",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -1008,
        176
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "Keywords",
              "condition": "isNotEmpty"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "2fPy6VQQ9KIeBIFC",
          "cachedResultUrl": "/projects/BTzFLWjYjhwngt0G/datatables/2fPy6VQQ9KIeBIFC",
          "cachedResultName": "Tik Tok Keywords"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "16d72cf4-12ee-40b4-9ff5-c2aeffa95b6a",
      "name": "从 Dumpling AI 获取转录",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -784,
        176
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/get-tiktok-transcript",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "videoUrl",
              "value": "={{ $json.Videos }}"
            },
            {
              "name": "requestSource",
              "value": "API"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "RLFzAcGRepr5eXZB",
          "name": "Dumpling AI-n8n"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5e5c0d36-7104-497e-b1a8-ab3205396e4c",
      "name": "使用 GPT-4 生成 TikTok 脚本",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -560,
        176
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "GPT-4.1"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a skilled TikTok content creator. I will give you a video transcript and the top comment from that video. Study both carefully and find the best content idea from the comment that can spark engagement and curiosity. Using that idea, write a very engaging TikTok video script that someone can read word for word when filming.\n\nThe script should feel natural, conversational, and attention grabbing right from the first line. Do not include titles, labels, explanations, or any extra text before or after the script. I only want the raw script itself."
            },
            {
              "content": "=Here is the video transcript:{{ $json.transcript }}\n\nHere is the top comment: {{ $('Get TikTok Video & Comments from DataTable').item.json.Keywords }}\n"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "dd8NvMC6rvx8RITo",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "f4820b75-2297-4f55-959c-cff1e639712c",
      "name": "清理脚本格式",
      "type": "n8n-nodes-base.code",
      "position": [
        -208,
        176
      ],
      "parameters": {
        "jsCode": "// Removes new lines from message.content on every item\n// Paste into an n8n Code node set to JavaScript\n\nreturn items.map((item) => {\n  const obj = item.json ?? item;\n\n  // Get the content wherever it lives\n  let content =\n    obj?.message?.content ??\n    obj?.content ??\n    \"\";\n\n  // Replace new lines with spaces, collapse extra spaces, and trim\n  const cleaned = String(content)\n    .replace(/(\\r\\n|\\n|\\r)/g, \" \")\n    .replace(/\\s{2,}/g, \" \")\n    .trim();\n\n  // Put it back where it came from\n  if (obj?.message && typeof obj.message === \"object\") {\n    obj.message.content = cleaned;\n  } else {\n    obj.content = cleaned;\n  }\n\n  item.json = obj;\n  return item;\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "3ceca227-c5ff-4e1d-80f1-be464f4ac82b",
      "name": "等待:HeyGen 处理",
      "type": "n8n-nodes-base.wait",
      "position": [
        240,
        176
      ],
      "webhookId": "f78db6d8-9a63-4961-8abb-ac44b4c230d1",
      "parameters": {
        "amount": 80
      },
      "typeVersion": 1.1
    },
    {
      "id": "95846b2e-5272-4d23-a6f9-9cd3a21b4b11",
      "name": "Captions:生成头像视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        16,
        176
      ],
      "parameters": {
        "url": "https://api.captions.ai/api/creator/submit",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"script\": \"{{ $json.message.content }}\",\n  \"creatorName\": \"twin-3-Blessed\"\n}\n\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "WijpUT5YZUeu1xCS",
          "name": "VEO 3"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dfd4f3f4-9312-4bd8-a8e4-9802b0002ac5",
      "name": "Caption:检查视频状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        464,
        176
      ],
      "parameters": {
        "url": "https://api.captions.ai/api/creator/poll",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"operationId\": \"{{$('Captions: Generate Avatar Video').item.json.operationId}}\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "WijpUT5YZUeu1xCS",
          "name": "VEO 3"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ce5572bc-fc8a-4bd2-894f-bc16d3166eb4",
      "name": "Captions.ai 视频是否创建成功?",
      "type": "n8n-nodes-base.if",
      "position": [
        688,
        96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "ab430d75-e191-4639-a191-203f06a25b3c",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.state }}",
              "rightValue": "COMPLETE"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7b73084a-f72b-4f3f-aaee-8587e1b771ac",
      "name": "重新检查状态前的重试延迟",
      "type": "n8n-nodes-base.wait",
      "position": [
        912,
        272
      ],
      "webhookId": "416aa824-961a-4e96-a449-ca798dcdaaa9",
      "parameters": {
        "unit": "minutes",
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "fb3c8eb6-b88e-4058-b461-79d48e56b652",
      "name": "将最终视频发送到 Submagic 进行增强",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        912,
        48
      ],
      "parameters": {
        "url": "https://api.submagic.co/v1/projects",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"title\": \"AI Avatar video {{$now.format('yyyy-MM-dd')}}\",\n    \"language\": \"en\",\n    \"videoUrl\": \"{{ $json.url }}\",\n    \"webhookUrl\": \"https://ownit.app.n8n.cloud/webhook-test/e364bc53-f9d7-42df-88d6-2e19f6ac0958\",\n    \"dictionary\": [\"Submagic\", \"AI-powered\", \"captions\"],\n    \"magicZooms\": true,\n    \"magicBrolls\": true,\n    \"magicBrollsPercentage\": 75\n  }",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "WijpUT5YZUeu1xCS",
          "name": "VEO 3"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "10bf72ee-38a7-4f49-8731-5a35cb936705",
      "name": "Submagic Webhook(视频就绪)",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -448,
        688
      ],
      "webhookId": "e364bc53-f9d7-42df-88d6-2e19f6ac0958",
      "parameters": {
        "path": "e364bc53-f9d7-42df-88d6-2e19f6ac0958",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "60e555be-2e84-430f-835d-fdce19e356ff",
      "name": "将最终视频详情保存到 Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -224,
        688
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appVyAu1sNdfYE6Xp",
          "cachedResultUrl": "https://airtable.com/appVyAu1sNdfYE6Xp",
          "cachedResultName": "AI videos"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblXzPNz2U1KRpAfS",
          "cachedResultUrl": "https://airtable.com/appVyAu1sNdfYE6Xp/tblXzPNz2U1KRpAfS",
          "cachedResultName": "Videos"
        },
        "columns": {
          "value": {
            "Video URL": "={{ $json.body.downloadUrl }}",
            "Caption Video ID": "={{ $json.body.projectId }}"
          },
          "schema": [
            {
              "id": "Caption Video ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Caption Video ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Video URL",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Video URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Approved?",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Approved",
                  "value": "Approved"
                },
                {
                  "name": "Not Approved",
                  "value": "Not Approved"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Approved?",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "hX3wPN3fUWW9Ctx9",
          "name": "Airtable Personal Access Token account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f528e56d-199a-4dce-8b01-e6b5e12141cf",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 1152,
        "height": 576,
        "content": "## 🎬 从评论和转录创建 TikTok 脚本"
      },
      "typeVersion": 1
    },
    {
      "id": "b5a7dc19-95a3-448c-b9b0-603395eb3ee9",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -160
      ],
      "parameters": {
        "color": 3,
        "width": 1088,
        "height": 640,
        "content": "## 🤖 使用 Captions.ai 和 Submagic 创建并保存 AI 头像视频"
      },
      "typeVersion": 1
    },
    {
      "id": "6a9bba08-464f-44ba-aeb6-65bbac556fe3",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        400
      ],
      "parameters": {
        "width": 912,
        "height": 512,
        "content": "## 📥 Webhook 分支 – 从 Submagic 保存最终视频"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bc90d6da-89a4-4e24-86e8-6a96c210de7a",
  "connections": {
    "Trigger on Schedule": {
      "main": [
        [
          {
            "node": "Get TikTok Video & Comments from DataTable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Up Script Formatting": {
      "main": [
        [
          {
            "node": "Captions: Generate Avatar Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Caption: Check Video Status": {
      "main": [
        [
          {
            "node": "Was the Captions.ai Video Created Successfully?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait: For HeyGen to Process": {
      "main": [
        [
          {
            "node": "Caption: Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Submagic Webhook (Video Ready)": {
      "main": [
        [
          {
            "node": "Save Final Video Details to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Captions: Generate Avatar Video": {
      "main": [
        [
          {
            "node": "Wait: For HeyGen to Process",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Transcript from Dumpling AI": {
      "main": [
        [
          {
            "node": "Generate TikTok Script with GPT-4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate TikTok Script with GPT-4": {
      "main": [
        [
          {
            "node": "Clean Up Script Formatting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retry Delay Before Rechecking Status": {
      "main": [
        [
          {
            "node": "Caption: Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get TikTok Video & Comments from DataTable": {
      "main": [
        [
          {
            "node": "Get Transcript from Dumpling AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Was the Captions.ai Video Created Successfully?": {
      "main": [
        [
          {
            "node": "Send Final Video to Submagic for Enhancements",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Retry Delay Before Rechecking Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流