
Personalized videos are one of the most powerful tools in modern marketing and sales. They create connection, build trust, and increase conversion rates dramatically – especially when they appear right after someone signs up or shows interest in your service.
In this article, I’ll show you how I built an AI Agent that creates personalized videos with Heygen, fully automated in n8n – no manual work needed.
🎯 The Use Case: Video Messages for Every Lead

Let’s say a new lead signs up via a contact form. Instead of a boring confirmation email, they instantly get a short video message – addressed to them by name.
For example:
“Hey Lisa, great to have you here! Here’s what we do and how we can help…”
This is 100% automated using Heygen’s Template V2 API, and runs fully in the background via n8n.
⚙️ Step 1: Get First Name & Last Name from a Form
You can use any form – WordPress, Webflow, or even Google Forms. I used a simple form on my website with two fields: first_name
and last_name
.
In n8n, you trigger the workflow with a Webhook node or Form submission trigger, and pass the name values into your flow.
🧪 Step 2: Choose or Create a Great Heygen Template
This step is key for quality.
Here’s what makes a good template in Heygen:
- ✅ Short & to the point: 15–30 seconds work best.
- ✅ Use variables smartly – e.g.
first_name
,company
,offer
. - ✅ Background: Use your branding or something neutral and clean.
- ✅ Voice: Choose a natural tone that matches your audience.
Tip: You can create templates directly in Heygen under the Template Studio. Don’t forget to mark variable placeholders with double braces like {{first_name}}
.
📡 Step 3: Call the Heygen Generate API in n8n

Now comes the API part.
You use a HTTP Request node in n8n with the following:
- Method:
POST
- Endpoint:
https://api.heygen.com/v2/template/<template_id>/generate
- Headers:
X-Api-Key
andContent-Type: application/json
- Body (JSON):
jsonKopierenBearbeiten{
"caption": false,
"title": "Personalized Video",
"variables": {
"first_name": {
"name": "first_name",
"type": "text",
"properties": {
"content": "John"
}
}
}
}
You can add multiple variables like company
, email
, or offer_code
– as long as they exist in your template.
⏳ Step 4: Wait Until Video Is Ready
After submitting, you’ll get a video_id
– but the video is not instantly ready.
You need to poll the status with another HTTP node:
- Endpoint:
https://api.heygen.com/v1/video/<video_id>
- Check if
video_url
exists. If not, wait 10–15 seconds and check again.
Tip: Use the IF
node and Wait
node in n8n to loop until the video is ready.
For longer videos, you might need 30–120 seconds.
🔗 Step 5: Embed the Video into Your Website

Once you receive the video_url
, you can:
- ✅ Embed it into a WordPress post or custom HTML
- ✅ Send it via email (great for onboarding!)
- ✅ Show it directly in a dynamic landing page
- ✅ Store it in your CRM for future interactions
Here’s a simple embed HTML:
htmlKopierenBearbeiten<video width="100%" controls>
<source src="https://video_url_from_heygen.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
🎁 Pro Tips for Video Personalization
- 🧩 Use segmentation: Create different video templates per persona or industry.
- 🪄 Add UTM parameters to track engagement per video.
- 🧠 Reuse templates with dynamic fields – saves cost and keeps things fast.
- 📦 Optimize resolution: Start with lower quality during testing to stay within free credits.
🚀 What’s the Benefit?
- 💡 High-quality first impressions
- 💬 Increased engagement & replies
- 🤝 Trust through personalization
- 💰 Better lead conversion rates
- 🔁 Scalable automation
This is marketing automation with a human touch – and your AI Agent does all the work.
And here you can see the result:
Need Help?
Want to set up your own video-based AI Agent for lead generation, onboarding, or customer engagement?
I’d be happy to support you – reach out via ai-agent-lab.io
Leave a Reply