AutomationMart
Home/Browse/Viral video generator: HeyGen to TikTok & Instagram auto-post + any content
n8n

Viral video generator: HeyGen to TikTok & Instagram auto-post + any content

n8nn8n21 modulesv1.0
Google SheetsOpenAIInstagramPerplexity

HeyGen AI Video Generation with Social Media Publishing Description This workflow automates the entire process of creating AI-generated videos from trending news content and publishing them to social media platforms (Instagram and TikTok). It runs daily at 6 AM, finds viral-worthy news, generates scripts, creates AI avatar videos using HeyGen, and automatically publishes to multiple social platforms. How it works Content Discovery & Script Generation 1. Schedule Trigger: Runs daily at 6 AM or an

At a glance

Viral video generator: HeyGen to TikTok & Instagram auto-post + any content is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Google Sheets, OpenAI, Instagram, Perplexity. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Google Sheets, OpenAI, Instagram, Perplexity
Modules
21
Price
Free
Version
v1.0
Viral video generator: HeyGen to TikTok & Instagram auto-post + any content workflow diagram

About this workflow

HeyGen AI Video Generation with Social Media Publishing Description This workflow automates the entire process of creating AI-generated videos from trending news content and publishing them to social media platforms (Instagram and TikTok). It runs daily at 6 AM, finds viral-worthy news, generates scripts, creates AI avatar videos using HeyGen, and automatically publishes to multiple social platforms. How it works Content Discovery & Script Generation 1. Schedule Trigger: Runs daily at 6 AM or any time you choose. 2. Perplexity Search: Finds trending news articles that would make good viral content 3. Write Video Script: Uses GPT-4.1 to create a 30-second video script with hook, main content, and CTA 4. Extract URL: Parses the article URL and script data for further processing Video Creation Pipeline 5. Get Screenshot: Uses ScreenshotOne API to create an animated scrolling video of the news article 6. Upload to Cloudinary: Temporarily stores the background video 7. Write Video Caption: Generates an engaging social media caption (150-200 characters) 8. Prepare Avatar Data: Combines all data needed for HeyGen video generation 9. Create Avatar Video: Sends request to HeyGen API to generate AI avatar video with: - Talking photo avatar - Text-to-speech voice - Background video from the news article - 720x1280 dimensions (vertical format) Data Management 10. Prepare Sheets Data: Formats video metadata 11. Store to Google Sheets: Saves videoid, caption, timestamp, and status for tracking Webhook Processing (Asynchronous) 12. HeyGen Webhook: Receives callback when video generation is complete 13. Process HeyGen Callback: Extracts video URLs and status from webhook 14. Get Caption from Sheets: Retrieves the associated caption using videoid 15. Combine Data: Merges video data with caption Social Media Publishing 16. Upload to Blotato: Uploads the completed video to Blotato media service 17. Extract Blotato URL: Gets the media URL for social posting 18. Assign Social Media IDs: Sets the account IDs for each platform 19. INSTAGRAM: Posts video to Instagram with caption 20. TIKTOK: Posts video to TikTok with caption and appropriate settings Setup Prerequisites 1. API Keys Required: - Perplexity API (for news search) - OpenAI API (for script and caption generation) - ScreenshotOne API (for article screenshots) - HeyGen API (for AI video generation) - Cloudinary account (for temporary video storage) - Blotato API (for social media posting) - Google Sheets API (for data tracking) 2. HeyGen Setup: - Create a talking photo avatar and get the talkingphotoid - Select a voice and get the voiceid - Set up a webhook endpoint in n8n for callbacks 3. Google Sheets Setup: - Create a new Google Sheet - Add headers: videoid, caption, timestamp, status - Get the sheet ID from the URL 4. Social Media Setup: - Connect Instagram and TikTok accounts to Blotato - Get the account IDs for each platform Configuration Steps 1. Replace all placeholder values: - YOURTALKINGPHOTOID - HeyGen avatar ID - YOURVOICEID - HeyGen voice ID - YOURWEBHOOKURL - Your n8n webhook URL - YOURGOOGLESHEETID - Google Sheets document ID - YOURINSTAGRAMACCOUNTID - Blotato Instagram account ID - YOURTIKTOKACCOUNTID - Blotato TikTok account ID - YOURCLOUDNAME - Cloudinary cloud name - YOURUPLOADPRESET - Cloudinary upload preset 2. Add credentials in n8n: - Perplexity API credentials - OpenAI API credentials - HeyGen API credentials (create custom API credentials with X-Api-Key) - Blotato API credentials - Google Sheets OAuth2 - ScreenshotOne API credentials 3. Configure the webhook: - Copy the webhook URL from the "HeyGen Webhook" node - Use this URL in the "Create Avatar Video" node's callbackurl Notes - The workflow uses a two-part asynchronous process: initial video creation and webhook-based completion - Videos are optimized for vertical format (720x1280) for mobile social media - The Google Sheet acts as a database to link video IDs with captions - All sensitive content (URLs, API keys) should be replaced with your own values - Consider content moderation and copyright when selecting news sources - Monitor API usage and costs, especially for HeyGen video generation Customization Options - Content Sources: Modify the Perplexity search query to target specific news sources or topics - Video Style: Adjust avatar position, scale, and background video settings - Voice Settings: Change voiceid, speed, and pitch for different narration styles - Publishing Schedule: Modify the Schedule Trigger for different times or frequencies - Social Platforms: Add more platforms by duplicating the Blotato posting nodes

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Create or update ActiveCampaign contacts and add tags from Google Sheets data

Automatically update ActiveCampaign contacts and add tags using data from Google Sheets. Streamline contact management with this seamless integration.

Free

Send video responses to Google Sheets for easy tracking and management

Automatically log video responses from VideoAsk into Google Sheets for streamlined tracking and management, ensuring all data is organized and accessible.

Free

Save your form entries from Cognito Forms to Google Sheets

Every time someone fills out your Cognito Form, Make will automatically save the form entry to a new row in your Google Sheets spreadsheet. The template uses this [sample spreadsheet](https://goo.gl/aTGHKq).

Free

Select podcast content ideas from Feedly articles using ChatGPT

Generate engaging podcast topics by transforming Feedly articles with ChatGPT. Stay ahead with fresh ideas and captivating content for your next podcast episode. The template is part of this [Webinar.](https://www.youtube.com/watch?v=EwfCfoVpLgQ)

Free

Add a new row in Google Sheets when the cloud bot completes a task

Automatically log completed cloud bot tasks in Google Sheets. When a task finishes, Make adds a new row with details to your spreadsheet.

Free

Create a new Airtable record for every new email received in Gmail using ChatGPT

This template creates a new Airtable record for every email received in Gmail. Use ChatGPT to generate insightful content for each record.

Free

iMessage food photo nutritional analysis with GPT-4 Vision & Memory Storage

iMessage AI-Powered Smart Calorie Tracker > 📌 What it looks like in use: > This image shows a visual of the workflow in action. Use it for reference when replicating or customizing the template. This n8n template transforms a user-submitted food photo into a detailed, friendly, AI-generated nutritional report — sent back seamlessly as a chat message. It combines OpenAI's visual reasoning, Postgres-based memory, and real-time messaging with Blooio to create a hands-free calorie and nutri

Free

Transform RSS feeds into content with GPT-4o for Medium, LinkedIn & Instagram

Related News to Content Marketing Automation Overview This workflow automatically collects news from an RSS feed, identifies the most relevant article(s), and generates ready-to-use social media and blog content tailored for Medium, LinkedIn, and Instagram. It’s ideal for: • Marketing teams who want a steady flow of fresh content. • Social media managers looking to save time on research and writing. • Startups and creators who want consistent posting with minimal effort. Instead o

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free