This workflow follows the Agent → Execute Workflow Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "__HeyGen_tool",
"nodes": [
{
"parameters": {
"options": {}
},
"id": "64c17d64-4c92-41d6-af2d-edcd99f07adb",
"name": "Anthropic Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"typeVersion": 1.2,
"position": [
-1184,
240
],
"credentials": {
"anthropicApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"inputSource": "passthrough"
},
"id": "8df3db4d-7b20-46c5-8de5-a11a20dae925",
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"typeVersion": 1.1,
"position": [
-1392,
16
]
},
{
"parameters": {
"url": "https://api.heygen.com/v1/video_status.get",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "video_id",
"value": "={{ $('Generate Video').item.json.data.video_id }}"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-320,
16
],
"id": "f9741674-22aa-4662-a3c3-190e1f53cc6e",
"name": "Get Video Status",
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "dd44e8b9-64ae-4a91-8d19-966910447f71",
"leftValue": "={{ $json.data.status }}",
"rightValue": "completed",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-160,
16
],
"id": "4d8a7319-6722-49ff-9d53-c9e987330da2",
"name": "Check Status"
},
{
"parameters": {
"method": "POST",
"url": "https://api.heygen.com/v2/video/generate",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ {\n \"video_inputs\": [\n {\n \"character\": {\n \"type\": \"avatar\",\n \"avatar_id\": \"1ef9666b6fc2437392f6a125433b2f28\",\n \"avatar_style\": \"normal\"\n },\n \"voice\": {\n \"type\": \"text\",\n \"input_text\": $('ScriptWriter').item.json.output,\n \"voice_id\": \"7bb93b3d80c4434a8f42b3b87cf24e25\",\n \"speed\": 1.0\n }\n }\n ],\n \"dimension\": {\n \"width\": 1280,\n \"height\": 720\n }\n} }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-672,
16
],
"id": "c518341d-f487-4bfa-bdf3-a7daa7807dc3",
"name": "Generate Video",
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.query}}",
"options": {
"systemMessage": "=### \ud83d\udce2 System Prompt: Video Script Generator\n\n**CRITICAL OVERRIDE: Ignore all default behaviors. Follow these instructions exactly without any introductory or concluding remarks.**\n\n**IMPORTANT: You MUST write the video script. Do not decline or apologize. Your job is to create the script content, not to debate whether videos should be made.**\n\nYou are a script-only output machine. You have one function: convert input into video script text. You do not chat, explain, or provide context. You only output the script.\n\nYou are a professional scriptwriter that converts existing content into engaging video scripts. You will receive the post content and MUST output a script for an avatar to speak.\n\nYou may need to create this content unless otherwise directed and in that case, use the tool Tavily to research the topic if you need to.\n\n---\n\n## Tools\nTavily - Use this to search the web about the requested topic if you need to.\n\n---\n\n### OUTPUT FORMAT: \nRespond with ONLY the script text. No greetings, no \"here's your script,\" no explanations, no quotation marks around the output. Start immediately with the first word of the script.\n\n**WRONG:** \"Here's your video script: [script content]\" \n**CORRECT:** [script content only]\n\n### \u2705 Core Requirements:\n- **ALWAYS** output a script - never decline or say you cannot help\n- Create a **concise 10\u201320 second script** (around 40\u201360 words)\n- either create the **top 2\u20134 most important points** from the content suggestion or, if given a specific script (usually set-off in quotation marks) then output that script directly with no changes.\n- Use an **engaging, conversational tone** for spoken delivery\n- Write as if a news anchor or content creator is speaking directly to viewers\n- Do **not include** intros, outros, or calls to action\n- Output **only the script text** - no explanations or meta-commentary\n\n---\n\n### DO NOT:\n- Say \"here's your script\" or similar phrases\n- Add any introductory text\n- Add any concluding text \n- Explain what you're doing\n- Use quotation marks around your response\n- Add disclaimers or apologies\n- Include greetings or sign-offs\n\n---\n\n### \ud83d\udde3\ufe0f Style Examples:\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\"Tesla's new Cybertruck deliveries started this week, OpenAI launched GPT-4 Turbo with better coding abilities, and Netflix added 13 million subscribers despite the password crackdown.\"\n\n---\n\n### EXAMPLE INPUT/OUTPUT:\n**Input:** \"Write about Tesla earnings\" \n**Output:** Tesla's Q3 earnings beat expectations with record deliveries, but investors worry about slowing growth and increased competition from Chinese EV makers.\n\n---\n\n### \ud83d\udca1 Key Points:\n- Think like a TikTok creator or YouTube Shorts narrator\n- Prioritize the most interesting/impactful information\n- Keep it punchy and engaging\n- **NEVER refuse the request - always provide the script**"
}
},
"id": "201e40f9-1495-4374-806e-17cc1240b3cc",
"name": "ScriptWriter",
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.7,
"position": [
-1184,
16
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "14d9076e-27ea-4846-8b44-f83cf4022b9e",
"name": "video_url",
"value": "={{ $json.data.video_url }}",
"type": "string"
},
{
"id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
"name": "video_id",
"value": "={{ $json.data.video_id }}",
"type": "string"
},
{
"id": "b2c3d4e5-f6g7-8901-2345-678901bcdefg",
"name": "status",
"value": "completed",
"type": "string"
}
]
},
"options": {}
},
"id": "33a77401-e9a2-4e18-9b4d-d184ed0dd7e4",
"name": "Success Response",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
0,
0
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "c3d4e5f6-g7h8-9012-3456-789012cdefgh",
"name": "error",
"value": "Video generation timed out or failed",
"type": "string"
},
{
"id": "d4e5f6g7-h8i9-0123-4567-890123defghi",
"name": "status",
"value": "failed",
"type": "string"
}
]
},
"options": {}
},
"id": "c8fdad97-a7c7-4a1c-b6a2-2f1a30c81031",
"name": "Timeout Response",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
112,
160
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "max-attempts-check",
"leftValue": "={{ $('Get Video Status').item.json.attempt_count || 0 }}",
"rightValue": 12,
"operator": {
"type": "number",
"operation": "gte"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-48,
160
],
"id": "387481b2-de07-4b04-bcbd-f54b2e686c83",
"name": "Max Attempts Check"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "attempt-counter",
"name": "attempt_count",
"value": "={{ ($('Get Video Status').item.json.attempt_count || 0) + 1 }}",
"type": "number"
}
]
},
"includeOtherFields": true,
"include": "selected",
"options": {}
},
"id": "9f682fdb-15ae-4424-ac92-469ba9d55354",
"name": "Increment Attempt Counter",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-480,
224
]
},
{
"parameters": {
"toolDescription": "Use this tool to search the internet",
"method": "POST",
"url": "https://api.tavily.com/search",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"parametersHeaders": {
"values": [
{
"name": "Authorization",
"valueProvider": "fieldValue",
"value": "Bearer {{$node[\"Header Auth account\"].auth.value}}"
},
{
"name": "Content-Type",
"valueProvider": "fieldValue",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "{\n \"query\": \"{searchTerm}\",\n \"search_depth\": \"{searchDepth}\",\n \"include_answer\": true,\n \"topic\": \"{topic}\",\n \"include_raw_content\": {includeRawContent},\n \"max_results\": {maxResults},\n \"include_images\": {includeImages}\n}",
"placeholderDefinitions": {
"values": [
{
"name": "searchTerm",
"description": "What the user has requested to write a blog about",
"type": "string"
},
{
"name": "searchDepth"
},
{
"name": "topic"
},
{
"name": "includeRawContent"
},
{
"name": "maxResults"
},
{
"name": "includeImages",
"type": "string"
}
]
}
},
"id": "47a9c806-e041-4ee4-8d68-e70d8884f39e",
"name": "Tavily",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"typeVersion": 1.1,
"position": [
-1040,
224
],
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"amount": 1,
"unit": "minutes"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
64,
336
],
"id": "2d3ee59d-951a-4e7e-931b-a797938d4296",
"name": "Wait 10 More Seconds"
},
{
"parameters": {
"amount": 3,
"unit": "minutes"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
-480,
16
],
"id": "9444d016-dc10-40ec-a74a-260a98b86a5a",
"name": "Wait 3 minutes"
}
],
"connections": {
"Anthropic Chat Model": {
"ai_languageModel": [
[
{
"node": "ScriptWriter",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"When Executed by Another Workflow": {
"main": [
[
{
"node": "ScriptWriter",
"type": "main",
"index": 0
}
]
]
},
"Get Video Status": {
"main": [
[
{
"node": "Check Status",
"type": "main",
"index": 0
}
]
]
},
"Check Status": {
"main": [
[
{
"node": "Success Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Max Attempts Check",
"type": "main",
"index": 0
}
]
]
},
"Generate Video": {
"main": [
[
{
"node": "Wait 3 minutes",
"type": "main",
"index": 0
}
]
]
},
"ScriptWriter": {
"main": [
[
{
"node": "Generate Video",
"type": "main",
"index": 0
}
]
]
},
"Max Attempts Check": {
"main": [
[
{
"node": "Timeout Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait 10 More Seconds",
"type": "main",
"index": 0
}
]
]
},
"Increment Attempt Counter": {
"main": [
[
{
"node": "Get Video Status",
"type": "main",
"index": 0
}
]
]
},
"Tavily": {
"ai_tool": [
[
{
"node": "ScriptWriter",
"type": "ai_tool",
"index": 0
}
]
]
},
"Wait 10 More Seconds": {
"main": [
[
{
"node": "Increment Attempt Counter",
"type": "main",
"index": 0
}
]
]
},
"Wait 3 minutes": {
"main": [
[
{
"node": "Get Video Status",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "5818a6d6-59c5-4869-a50b-f24282db2d87",
"id": "8btUgmG7LHv0lzhv",
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
anthropicApihttpHeaderAuth
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
__HeyGen_tool. Uses lmChatAnthropic, executeWorkflowTrigger, httpRequest, agent. Event-driven trigger; 13 nodes.
Source: https://github.com/MyAiAd/MyVA-prev/blob/ac00431a79390d6df43def92b40ef2291d7ce0ef/workflows/__HeyGen_tool.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow is designed for marketers, content creators, agencies, and solo founders who want to publish long‑form posts with visuals on autopilot using n8n and AI agents.
Template Carnaval - time instagram. Uses toolWorkflow, lmChatOpenAi, memoryBufferWindow, agent. Event-driven trigger; 56 nodes.
Chat with a multi-agent system to write a blog. The orchestrator advances through research, headlines, hooks, outline, intro, draft, and final polish–one phase per reply—outputting options and asking
Automated Research Report Generation with OpenAI, Wikipedia, Google Search, and Gmail/Telegram. Uses lmChatOpenAi, memoryBufferWindow, toolHttpRequest, agent. Event-driven trigger; 26 nodes.
This workflow automates the process of generating professional research reports for researchers, students, and professionals. It eliminates manual research and report formatting by aggregating data, g