ChatGPTCreativeVideoAI score · 74/100AI-assisted edit · no obvious prompt-injection riskn8n.io

Auto-Generate and Cross-Post Social Videos via Telegram, GPT-4, and Kling AI

Send a Telegram message → GPT-4 refines the prompt → Kling generates video → voice-over, captions, and auto-publish to 9 platforms

ExperiencedStepsWorkflowPromptTip
Who
Content creators, social media managers, and marketers with a self-hosted n8n instance
You get
One Telegram message triggers an AI-generated short video with voice-over and captions, then cross-posts to Instagram, TikTok, YouTube, and 6 more platforms
You need
n8n · telegram · google-sheets · blotato · json2video · cloudinary

Constraints

Requires a self-hosted n8n instance (community nodes are not available on n8n Cloud). Prerequisites: Telegram Bot Token, OpenAI API Key, Kling API Key via piapi.ai, Cloudinary account, JSON2Video account, Google Sheets OAuth2 credentials, Blotato API Key, and platform-specific account IDs. The workflow is triggered by a Telegram message in the format: generate video <video description>, <caption/topic>.

What they did

Author drfiras published this workflow template on the n8n template gallery. The template demonstrates an end-to-end automation where a user sends a Telegram message and the workflow sequentially calls GPT-4 to refine the prompt, Kling to generate a video, OpenAI TTS for voice-over, JSON2Video to merge audio/video and add captions, GPT-4 again for title and social caption, Google Sheets for metadata logging, Telegram for preview, and finally Blotato's API to parallel-publish to Instagram, YouTube, TikTok, Facebook, Threads, Twitter/X, LinkedIn, Bluesky, and Pinterest. The template ships with 38 nodes and full connection mappings.

How it went

The author claims the workflow transforms a Telegram message into a 'fully produced and published social video' and provides a YouTube demo video and Notion guide. The template has 20,894 views on n8n.io (author_report). This site has not executed or verified the workflow.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Trigger: Telegram Prompt node: connect Telegram API credentials.
  • OpenAI Model Bridge node: connect OpenAI API credentials.
  • Generate Video via Kling API node: connect HTTP Header Auth credentials.
  • Get Generated Video URL node: connect HTTP Header Auth credentials.
  • Generate Voice-Over Script node: connect OpenAI API credentials.
  • Convert Script to Audio (TTS) node: connect OpenAI API credentials.
  • Upload Audio to Cloudinary node: connect HTTP Basic Auth credentials.
  • Merge Audio + Video node: connect HTTP Basic Auth credentials.
  • Merge Audio + Video node: connect HTTP Header Auth credentials.
  • Get Video URL with Audio node: connect HTTP Header Auth credentials.
  • Add Captions/Subtitles to Video node: connect HTTP Header Auth credentials.
  • Get Final Video URL (Audio + Captions) node: connect HTTP Header Auth credentials.
  • Generate Social Caption from Voiceover node: connect OpenAI API credentials.
  • Generate YouTube-Style Title node: connect OpenAI API credentials.
  • Save Video Metadata to Google Sheets node: connect Google Sheets OAuth2 credentials.
  • Send Final Video to Telegram node: connect Telegram API credentials.
  • Send Caption Link via Telegram node: connect Telegram API credentials.

Configuration to replace

  • Source template is n8n public workflow #3501 (~38 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-24

Steps

  1. Generate video: from Telegram prompt to Kling output

    Configure the Telegram Trigger node to receive messages, then use a Code node to parse the input: strip the 'generate video' prefix, split at the first comma into videoPrompt and captionIdea. Feed videoPrompt into an AI Agent node (GPT-4) to expand it into a cinematic scene description tuned for Kling, then call the Kling API via HTTP Request (https://api.piapi.ai/api/v1/task). After a 7-minute wait, query the task status to retrieve the generated video URL.

    Execution prompt · Source text。AI Agent node 'Transform Prompt for Kling (GPT-4)' systemMessage field

    =⚙️ System Instructions – AI Agent:
    You are a prompt optimization assistant for Kling AI, a cutting-edge text-to-video generation platform.
    
    🎯 Mission:
    Transform brief user inputs into cinematic, high-quality video prompts rich in sensory details, spatial context, and dynamic motion—perfectly tuned for Kling AI.
    
    ✍️ Instructions:
    Expand short ideas into visually immersive scenes.
    
    Use concrete visual elements: colors, textures, lighting, motion, atmosphere, camera angles.
    
    Keep descriptions concise but vivid, like a scene from a movie script.
    
    Output only the final prompt—no explanations, no formatting tips.
    
    🌟 Examples:
    User Input: “Rainy street at night”
    Final Prompt:
    Neon signs reflect in puddles on a dimly lit city street. Raindrops ripple across a parked motorcycle's chrome. A figure in a trench coat walks past flickering lights as steam rises from a nearby sewer grate. The camera tracks from ground level, capturing water splashing underfoot.
    
    User Input: “Mountain hike”
    Final Prompt:
    A hiker climbs a rugged mountain trail at sunrise, golden light hitting snow-capped peaks in the distance. Wind rustles through pine trees as birds soar overhead. The camera pans slowly from behind, revealing a vast valley below bathed in morning mist.
    
    User Input: “Cozy library”
    Final Prompt:
    A warm library room with wooden shelves lined with old books. Dust floats in the sunbeams streaming through tall windows. A cat naps on a leather armchair while a hand flips through a weathered novel. The camera gently rotates around the room, revealing small glowing lamps.
  2. Add voice-over: script, TTS, and audio-video merge

    Using the captionIdea from the parser, generate a ~7-second voice-over script (≈18–22 words) with GPT-4o, convert it to speech via OpenAI TTS, upload the audio to Cloudinary, then merge it with the video using the JSON2Video API. Wait about 1 minute, then fetch the merged video URL.

    Execution prompt · Source text。OpenAI node 'Generate Voice-Over Script' messages[0].content field

    =Task:
    Craft a short-form voice-over script that perfectly fits a 7-second video duration. The script should align with the following topic:
    
    {{ $('Extract Prompt & Caption').item.json.captionIdea }}
    
    Requirements:
    
    Match the average spoken word count for a 7-second voice-over (approximately 18–22 words, depending on pacing).
    
    The script must be tight, impactful, and written in a natural spoken tone suitable for narration.
    
    No intro text or labels — return only the plain voice-over script with no headers or commentary.
    
    ✅ Example (For Context Only):
    Topic: "Why cold showers boost productivity"
    Generated Output:
    Cold showers shock your system awake, boost focus, and kickstart circulation—training your brain to embrace discomfort.
  3. Add captions: overlay styled subtitles via JSON2Video

    Wait 30 seconds, then call JSON2Video to overlay professional subtitles on the merged video. Uses classic-progressive style, Oswald font at size 140, gold text with dark shadow and outline. Wait ~1 minute for rendering, then query for the final video URL.

  4. Save metadata and notify: title, caption, sheet, Telegram preview

    Use GPT-4o to generate a social caption and a YouTube-style title (under 70 chars, no special characters) based on the voice-over script. Append the original prompt, video URL, title, and description to Google Sheets. Then send the final video and caption link via Telegram for human review or reuse.

    Execution prompt · Source text。OpenAI node 'Generate Social Caption from Voiceover' messages[0].content field

    =📲 Prompt: Caption Generator for Voiceover-Based Social Posts
    Your Role:
    Create a concise and engaging social media caption that builds directly on the voiceover script below:
    {{ $('Generate Voice-Over Script').item.json.message.content }}
    
    🧠 Caption Guidelines:
    Keep it short, compelling, and value-driven.
    
    Avoid generic motivational fluff — focus on real, actionable insight or highlight a problem/solution pattern.
    
    
    Structure:
    
    One sentence per line.
    
    Note: Do not use this character: " in the result.
    Return a single short paragraph with no line breaks and no special characters.
    Note: Do not use this character: " in the result.

    Execution prompt · Source text。OpenAI node 'Generate YouTube-Style Title' messages[0].content field

    =Act as a YouTube Title Expert.
    Based on the following video description:
    {{ $('Generate Voice-Over Script').item.json.message.content }}
    Generate a short, punchy, and curiosity-driven YouTube video title that makes people want to click.
    Make it feel urgent, valuable, or surprising — and avoid generic or boring phrases.
    Keep it under 70 characters. Return only the title, no explanations.
    Note: The title must be free of special characters and the character ". Return only a plain text title.

    Execution prompt · Source text。Telegram node 'Send Caption Link via Telegram' text field

    ={{ $('Save Video Metadata to Google Sheets').item.json.DESCRIPTION }}
    
    Link here : {{ $('Save Video Metadata to Google Sheets').item.json['URL VIDEO'] }}
  5. Auto-publish to 9 platforms via Blotato

    Configure platform account IDs in a Set node (Instagram, YouTube, TikTok, Facebook, Threads, Twitter/X, LinkedIn, Bluesky, Pinterest). Upload the video to Blotato to obtain a media URL, then fire parallel HTTP requests to Blotato's API to publish to all platforms. Note: the template uses placeholder image URLs for Bluesky and Pinterest mediaUrls; replace these with the actual video URL before running.

  6. Prerequisites and credentials setup

    1. Connect your Telegram bot to the Telegram Trigger node. 2. Add your OpenAI API key to all GPT-related nodes. 3. Configure Kling API access in the Generate Video node (via piapi.ai). 4. Link your Cloudinary account for audio upload. 5. Connect JSON2Video for merging and captioning. 6. Set up Google Sheets with your spreadsheet ID. 7. Connect your Blotato API key and fill in platform IDs. 8. Test by sending: generate video A robot exploring Mars, Why AI will reshape humanity. Disclaimer: this workflow uses community nodes available only on self-hosted n8n.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant: confirm self-hosted environment and credential checklist before importing workflow.json

This block is the prompt. Ads are never placed here.

You are setting up an n8n workflow: triggered by Telegram, it uses GPT-4 and Kling AI to auto-generate a short video with voice-over and captions, then cross-posts to 9 social platforms. First confirm you have a self-hosted n8n instance, then configure credentials in this order: Telegram Bot → OpenAI → Kling (piapi.ai) → Cloudinary → JSON2Video → Google Sheets OAuth2 → Blotato. After importing workflow.json, replace all credential-id placeholders with live credentials, and test with the message format 'generate video <description>, <topic>'.

Self-hosted n8n only; requires 7 external API credentials; Bluesky/Pinterest mediaUrls in template are placeholders and must be replaced

Source

Generate & auto-post social videos to multiple platforms with GPT-4 and Kling AI · drfiras · n8n.io · 2025-04-09

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related