
Turn TikTok Comments into AI Avatar Videos with Dumpling AI, GPT-4 & Captions.ai
Description
Categories
🤖 AI & Machine Learning
Nodes Used
n8n-nodes-base.ifn8n-nodes-base.coden8n-nodes-base.waitn8n-nodes-base.waitn8n-nodes-base.webhookn8n-nodes-base.airtablen8n-nodes-base.dataTablen8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNote
PriceGratis
Views0
Last Updated11/28/2025
workflow.json
{
"id": "M0sdqMfhe8MshZEw",
"meta": {
"instanceId": "a1ae5c8dc6c65e674f9c3947d083abcc749ef2546dff9f4ff01de4d6a36ebfe6",
"templateCredsSetupCompleted": true
},
"name": "Turn TikTok Comments into AI Avatar Videos with Dumpling AI, GPT-4 & Captions.ai",
"tags": [],
"nodes": [
{
"id": "8b13b364-be17-4cdd-a8db-9fe5ba441165",
"name": "Trigger on Schedule",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-1232,
176
],
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"typeVersion": 1.2
},
{
"id": "1211c905-6f77-487f-a226-2b3677042e8d",
"name": "Get TikTok Video & Comments from DataTable",
"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": "Get Transcript from 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": "Generate TikTok Script with GPT-4",
"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": "Clean Up Script Formatting",
"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": "Wait: For HeyGen to Process",
"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: Generate Avatar Video",
"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: Check Video Status",
"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": "Was the Captions.ai Video Created Successfully?",
"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": "Retry Delay Before Rechecking Status",
"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": "Send Final Video to Submagic for Enhancements",
"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 (Video Ready)",
"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": "Save Final Video Details to 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": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1232,
-160
],
"parameters": {
"color": 4,
"width": 1152,
"height": 576,
"content": "## 🎬 Create TikTok Script from Comment & Transcript\n\nThis branch runs on schedule and:\n1. Pulls a TikTok video + top comment from DataTable\n2. Sends the video URL to Dumpling AI to get the transcript\n3. Combines the transcript and comment into a GPT-4 prompt\n4. GPT-4 returns a ready-to-read TikTok script\n5. Cleans the script formatting using JavaScript\n\n✅ This script becomes the base content for the AI avatar video\n"
},
"typeVersion": 1
},
{
"id": "b5a7dc19-95a3-448c-b9b0-603395eb3ee9",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-32,
-160
],
"parameters": {
"color": 3,
"width": 1088,
"height": 640,
"content": "## 🤖 Create and Save AI Avatar Video with Captions.ai & Submagic\n\n1. Sends script to Captions.ai to generate avatar video \n2. Waits + checks if video is ready \n3. On success: sends the video to Submagic for auto-editing (subtitles, B-roll, etc.) \n4. Submagic sends the final version to a webhook \n\n\n✅ Fully automated short-form video generation pipeline\n"
},
"typeVersion": 1
},
{
"id": "6a9bba08-464f-44ba-aeb6-65bbac556fe3",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-720,
400
],
"parameters": {
"width": 912,
"height": 512,
"content": "## 📥 Webhook Branch – Save Final Video from Submagic\n\nThis webhook receives the enhanced video from Submagic once it's ready.\n\n1. Submagic calls the webhook with the final video details \n2. The webhook triggers Airtable \n3. Airtable saves:\n - `Video URL`\n - `Caption Video ID`\n\n✅ This ensures your final video is logged and ready for use or review\n"
},
"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
}
]
]
}
}
}