This workflow corresponds to n8n.io template #9967 — we link there as the canonical source.
This workflow follows the Agent → Form 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 →
{
"id": "KZ6T2tfBJK5KgUvj",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Scout + HeyGen for Video Lead Generation",
"tags": [],
"nodes": [
{
"id": "e99fcbb3-b043-4751-8c2f-77b3a78627c3",
"name": "On form submission",
"type": "n8n-nodes-base.formTrigger",
"position": [
-1056,
80
],
"parameters": {
"options": {},
"formTitle": "Inbound Form",
"formFields": {
"values": [
{
"fieldLabel": "first_name"
},
{
"fieldType": "email",
"fieldLabel": "middle_name"
},
{
"fieldLabel": "last_name"
},
{
"fieldLabel": "address"
},
{
"fieldLabel": "city"
},
{
"fieldLabel": "state"
},
{
"fieldLabel": "county"
},
{
"fieldLabel": "zip_code"
},
{
"fieldType": "dropdown",
"fieldLabel": "exactmatch",
"fieldOptions": {
"values": [
{
"option": "true"
},
{
"option": "false"
}
]
}
},
{
"fieldType": "number",
"fieldLabel": "minscore"
},
{
"fieldType": "number",
"fieldLabel": "maxscore"
},
{
"fieldType": "number",
"fieldLabel": "count"
},
{
"fieldType": "dropdown",
"fieldLabel": "level",
"fieldOptions": {
"values": [
{
"option": "address"
},
{
"option": "city"
},
{
"option": "state"
},
{
"option": "county"
},
{
"option": "zip"
}
]
}
},
{
"fieldLabel": "phone"
},
{
"fieldLabel": "email"
},
{
"fieldType": "number",
"fieldLabel": "count"
}
]
},
"formDescription": "Fill Out This Form to Get More Info on Scout"
},
"typeVersion": 2.2
},
{
"id": "bf92dc23-9683-4b17-b2d5-5865d98bcf1d",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
128,
80
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "e6e54dcf-86d1-4e1a-8bf1-91bccdb8656f",
"name": "If1",
"type": "n8n-nodes-base.if",
"position": [
656,
80
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "3ef3edd0-7a3a-41ba-9f6f-7acf11a00a3a",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.data.status }}",
"rightValue": "completed"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "2df19f5b-c9ee-42f1-b684-1c84b6df65f1",
"name": "Wait1",
"type": "n8n-nodes-base.wait",
"position": [
608,
352
],
"parameters": {
"amount": 20
},
"typeVersion": 1.1
},
{
"id": "e38e477a-883c-4395-970d-788df2777d08",
"name": "Selfie Video Prompt Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-432,
80
],
"parameters": {
"text": "=Here is the information we have looked up on this lead:\n\nFirst Name: {{ $json.matched_first_name }}\nLast Name: {{ $json.matched_last_name }}\nCity/State: {{ $json.city }}, {{ $json.state }}\nCounty: {{ $json.county }}\nHome Owner Code (H/P/R/U): {{ $json.homeownercd }}\nProperty Type: {{ $json.prop_type }}\nDwelling Type: {{ $json.dwelltype }}\nHousehold Income: {{ $json.hhi }}\nNet Worth: {{ $json.wealth }}\nLength of Residence (Yrs): {{ $json.lor }}\nYear Built: {{ $json.year_built }}\nVacancy: {{ $json.vacant }}\nOccupation: {{ $json.occupation }}\nChildren: {{ $json.children }}\nLanguage: {{ $json.language }}\n\nGenerate the script following the System Message rules.",
"options": {
"systemMessage": "=You are an expert video script agent generating short, professional selfie-style scripts for the Heygen API.\n\n**Task:** Write a first-touch outreach script for Sam, a real estate agent who works with Maria at Best Real Estate. The script must sound credible, approachable, and tailored. Every script must illustrate three potential discussion paths, so the lead sees themselves in the examples and understands why connecting is valuable.\n\n**Dynamic Data (may or may not be present):**\n- Name: {{ $json.matched_first_name }}\n- Location: {{ $json.city }}, {{ $json.state }}\n- Property: {{ $json.prop_type }}, {{ $json.year_built }}, {{ $json.square_feet }}\n- Ownership: {{ $json.homeownercd }}, {{ $json.lor }}\n- Financials: {{ $json.hhi }}, {{ $json.wealth }}\n- Other: {{ $json.language }}, {{ $json.occupation }}, {{ $json.children }}\n\n**Core Principles:**\n1. **Greeting:** Always start with the lead\u2019s first name if available. Example: \"Hey {{ $json.matched_first_name }}, this is Sam...\"\n2. **Language:** Deliver the full script in {{ $json.language }} if provided, otherwise default to English.\n3. **Personalization:** Use ownership type, property type, and city context to frame the first two client scenarios. Never present the data as an absolute fact about the lead\u2014frame it as a common situation or client story.\n - \u274c \"You\u2019re renting a condo in San Francisco.\" \n - \u2705 \"Many renters in San Francisco\u2019s condo market are exploring ownership...\"\n4. **Social Proof via Three Discussion Paths:** \n Every script should mention **three reasons clients like this lead connect with us**: \n - (1) A likely driver inferred from data (ownership status, property type, city). \n - (2) A second common driver phrased as a different client use case or story. \n - (3) An open door for the lead\u2019s own goals. \n5. **Reasons to Connect:** Explicitly show that clients benefit by gaining clarity, finding opportunities, and avoiding mistakes. \n6. **Length:** Keep the script under 15 seconds (~55\u201370 words). \n7. **Structure:** \n - Greeting & intro \n - Three client paths (driver #1, driver #2, other goals) \n - Call-to-Action: \"I\u2019ve included a link below to my calendar\u2014let\u2019s book a quick 15 minutes this week.\"\n\n**Output:** ONLY the complete script in the target language. Do not include explanations, reasoning, or metadata."
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "a8e7dca3-17fc-4569-b80a-110f149ee13a",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-448,
288
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "6980158c-d632-4bc2-bd99-3f5189f6d29c",
"name": "Get Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
400,
80
],
"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 Video').item.json.data.video_id }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "17ecfb6c-cccb-430f-b253-28b5052b4114",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
880,
64
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1",
"cachedResultName": "GPT-4.1"
},
"options": {},
"messages": {
"values": [
{
"content": "=Prospect Information:\nName: {{ $('HTTP Request').item.json.matched_first_name }} (use Title Case)\nEmail Address: {{ $('HTTP Request').item.json.email1 }}\n\nThumbnail URL: {{ $json.data.thumbnail_url }}\nVideo Link: {{ $('Get Video').item.json.data.video_url }}"
},
{
"role": "system",
"content": "You're an email agent for Sam at Best Real Estate. Your job is to craft an impactful email based on the information you've received from a form submission, and to pass along a short intro video along with the email. The goal of the email is to ask the prospect to book a time with you on https://calendly.com/best-real-estate.\n\nYou will also receive the video link and thumbnail to embed in the user input, please embed the video link on to the thumbnail instead of showing the entire long URL.\n\nOutput in HTML so that the thumbnail and video format is correct - only output the body of the email to the next node, as the next node is the gmail node."
}
]
}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "245edf28-804c-4e15-b7c6-090a050896e1",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1184,
-144
],
"parameters": {
"width": 260,
"height": 740,
"content": "Form Submission Trigger"
},
"typeVersion": 1
},
{
"id": "f6fd2259-4d7e-4e4f-a9e3-48a06c221231",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-896,
-144
],
"parameters": {
"color": 2,
"width": 360,
"height": 740,
"content": "Script Agent"
},
"typeVersion": 1
},
{
"id": "b7b0fbb7-98da-44e9-9637-86b8ca9c7726",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-528,
-144
],
"parameters": {
"color": 6,
"width": 360,
"height": 740,
"content": "Post & Wait"
},
"typeVersion": 1
},
{
"id": "c0dae26b-1bce-4ce3-b0e2-a1822852ba41",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-144,
-144
],
"parameters": {
"color": 4,
"width": 500,
"height": 740,
"content": "Get Video"
},
"typeVersion": 1
},
{
"id": "cf0ab846-53c4-4f56-b228-215914a5bdf0",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
400,
-144
],
"parameters": {
"color": 3,
"width": 992,
"height": 740,
"content": "Send Outreach Email with Video"
},
"typeVersion": 1
},
{
"id": "d5ff7511-076b-4ea3-87ad-2170ede0ad12",
"name": "Send Email & Video",
"type": "n8n-nodes-base.gmail",
"position": [
1200,
64
],
"parameters": {
"sendTo": "={{ $('On form submission').item.json['Email Address'] }}",
"message": "={{ $json.message.content }}",
"options": {},
"subject": "Hey from Scout"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "1c5154dc-b604-4d5e-bfdc-84c7c476ed5d",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2080,
-144
],
"parameters": {
"width": 880,
"height": 1296,
"content": "\ud83c\udfa5 AI-Powered Inbound Video Agent \u2013 Auto-Respond to Leads with Personalized Videos\n\nDescription:\nThis workflow helps you instantly respond to inbound leads with a hyper-personalized video and email\u2014fully automated using n8n, Scout, Heygen API, and OpenAI.\n\n\ud83d\udce5 How It Works:\n\nForm Trigger\n\u2003Captures user inputs like name, email, address, and additional data points from Scout.\n\nAI Video Prompt Agent\n\n\u2003Uses LangChain + OpenAI to write a short, personalized script (e.g., \u201cHey this is Jason from Top Real Estate...\u201d).\n\nRetrieve Data\n\u2003Gets data from Scout to personalize your outreach.\n\nVideo Generation (Heygen API)\n\u2003Triggers a video using a selected avatar and voice style.\n\nVideo Status & Wait Logic\n\u2003Monitors the video generation status until completed.\n\nGet Final Video URL & Thumbnail\n\u2003Retrieves the finished video and prepares for embedding.\n\nEmail Writer (GPT-4)\n\u2003Generates an HTML-based outreach email including the lead's info and embedded video thumbnail with a booking link.\n\nEmail Delivery (Gmail Node)\n\u2003Sends the full message to the inbound lead automatically.\n\n\u2699\ufe0f Tools & Integrations:\nn8n (self-hosted or cloud)\n\nHeygen API \u2013 for video generation\n\nLangChain + OpenAI GPT-4 \u2013 for script writing and email creation\n\nGmail Node \u2013 for automated outreach delivery\n\n\ud83d\udd27 Setup Instructions:\nHeygen API Key\n\u2003Create a Heygen account and retrieve your API key. Set it up as a credential in n8n (httpHeaderAuth).\n\nScout API Key\n\u2003Add your Scout API key in your Scout account at app.trustscout.com.\n\nOpenAI Key\n\u2003Add your OpenAI API key under OpenAI credentials.\n\nGmail OAuth2\n\u2003Connect your Gmail account using OAuth2 for sending emails.\n\nCustomize the Prompt\n\u2003Modify the system message in the LangChain Agent node to reflect your brand tone or CTA.\n\nCalendly Link\n\u2003Update the call-to-action links in both the video prompt and email generator nodes with your real booking URL.\n\n\ud83d\udca1 Use Cases:\nAutomating welcome sequences for new signups\n\nPersonalized video lead responses for agencies and outreach"
},
"typeVersion": 1
},
{
"id": "60d7e8ac-fa24-447b-9d76-23441064fa93",
"name": "Generate Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
-48,
80
],
"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\": \"Gala_standing_businesssofa_side_close\",\n \"avatar_style\": \"normal\"\n },\n \"voice\": {\n \"type\": \"text\",\n \"input_text\": \"{{ $json.output }}\",\n \"voice_id\": \"35b75145af9041b298c720f23375f578\",\n \"speed\": 1.0\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": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "214e7415-18cb-4353-a854-7251f85c6068",
"name": "Get Avatars",
"type": "n8n-nodes-base.httpRequest",
"position": [
-48,
320
],
"parameters": {
"url": "https://api.heygen.com/v2/avatars",
"options": {},
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "31aa6c74-0f87-432e-9eb5-083c30b5dc0e",
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"position": [
-784,
80
],
"parameters": {
"url": "https://api.trustscout.com/enterprise/people/lookup/",
"method": "POST",
"options": {},
"jsonBody": "={\n \"first_name\": \"{{ $json.first_name }}\",\n \"middle_name\": \"{{ $json.middle_name }}\",\n \"last_name\": \"{{ $json.last_name }}\",\n \"address\": \"{{ $json.address }}\",\n \"city\": \"{{ $json.city }}\",\n \"state\": \"{{ $json.state }}\",\n \"county\": \"{{ $json.county }}\",\n \"zip_code\": \"{{ $json.zip_code }}\",\n \"exactmatch\": false,\n \"minscore\": 0.0,\n \"maxscore\": 100.0,\n \"count\": 1,\n \"level\": \"{{ $json.level }}\",\n \"phone\": \"{{ $json.phone }}\",\n \"email\": \"{{ $json.email }}\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "ADD YOUR SCOUT API KEY HERE"
}
]
}
},
"typeVersion": 4.2
}
],
"active": false,
"settings": {
"callerPolicy": "workflowsFromSameOwner",
"executionOrder": "v1"
},
"versionId": "ac049f24-dab4-4c55-87ed-1506672e30f5",
"connections": {
"If1": {
"main": [
[
{
"node": "OpenAI",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Get Video",
"type": "main",
"index": 0
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "Get Video",
"type": "main",
"index": 0
}
]
]
},
"OpenAI": {
"main": [
[
{
"node": "Send Email & Video",
"type": "main",
"index": 0
}
]
]
},
"Get Video": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Selfie Video Prompt Agent",
"type": "main",
"index": 0
}
]
]
},
"Generate Video": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Selfie Video Prompt Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Selfie Video Prompt Agent": {
"main": [
[
{
"node": "Generate Video",
"type": "main",
"index": 0
}
]
]
}
}
}
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.
gmailOAuth2httpHeaderAuthopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
🎥 AI-Powered Inbound Video Agent: Auto-Respond to Leads with Personalized Videos Description: This workflow automates the first-touch response for inbound leads by creating and delivering a hyper-personalized video and follow-up email, all in seconds, using a powerful stack:…
Source: https://n8n.io/workflows/9967/ — 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 n8n workflow automates turning short user ideas into production-ready real-estate marketing assets (photorealistic images and optional 360° videos). A form submission seeds a prompt board → an LL
This workflow automates the process of competitor creative analysis for Facebook Pages. When a user submits their email and a target Facebook Page URL via a web form, the workflow: Scrapes the latest
This n8n workflow is designed for e-commerce businesses, digital marketers, and content creators who want to automatically generate professional 3D product videos from product images. It's perfect for
Whether you’re a product manager, developer, or simply curious about workflow automation, you’re in the right place. This n8n workflow is designed to help you streamline and automate your social media
🎥 AI-Powered Inbound Sales Rep Video Agent – Auto-Respond to Leads with Personalized Videos Description: