🎬 Create & share AI videos with Telegram, Gemini & post to TikTok, Instagram, FB

⚡ 2,309 views · 🎬 Content Creation & Video

💡 Pro Tip — Heads up — if this workflow’s Instagram scraping breaks (it happens whenever Meta updates their frontend), ScraperNode is a community node that handles profiles, posts, reels, and comments without any HTML parsing.

View All Scrapers

Description

Video Generation with Telegram Bot and Gemini API – Auto-Post to TikTok, Instagram & Facebook

This n8n workflow turns your Telegram messenger into a full video content pipeline: you send a text or voice idea to a Telegram bot, collaborate with an AI on the script and caption, let Gemini generate the video, and then automatically publish it to TikTok, Instagram and Facebook – all with status tracking and Telegram confirmations.


What You Need to Get Started

This workflow connects several external services. You’ll need:

*** Blotato API Key***

Once these credentials are configured in n8n, the workflow runs end-to-end from Telegram idea to multi-platform publishing.


How the Workflow Operates – Step by Step

1. Input & Initial Processing (Telegram + Voice Handling)

This phase listens to your messages and normalizes them into a single text input for the AI.

Node NameRole in Workflow
Listen for incoming eventsTelegram Trigger node that starts the workflow whenever your bot receives a message (text or voice).
Voice or TextSet node that structures the incoming payload and prepares a unified text field for downstream nodes.
A Voice?IF node that checks whether the incoming message is a voice note or plain text.
Get Voice FileIf voice is detected, this Telegram node downloads the audio file from Telegram.
Speech to TextUses OpenAI Whisper to convert the voice note into a text transcript.

The output of this stage is always a clean text string representing your idea.


2. AI Core & Approval Loop (Script + Caption via AI)

Here the AI designs the video prompt (for Gemini) and the social media caption (for all platforms), then iterates with you until you approve.

Node NameRole in Workflow
AI AgentCentral logic agent. Takes your idea text and applies the system prompt to create a video prompt and social media caption. Handles revisions based on your feedback.
OpenAI Chat ModelThe LLM backing the agent (OpenAI Chat model).
Window Buffer MemoryMemory buffer that stores recent turns, so the agent can keep context across your “make it shorter / more fun / more technical” requests.
Send questions or proposal to userTelegram node that sends the AI’s suggested prompt + caption back to you for review.
Approved from user?IF node that checks whether the agent’s output is the “approved” JSON (meaning you said “ok” / “approved”) or just a normal suggestion.

Video Prompt Assistant System Prompt (Internal Instructions)

The AI Agent is configured with a system message like:

> You are a video prompt assistant for Telegram. > > 1. Analyze the user’s message and create a video prompt. > 2. Create relevant social media text with hashtags. > 3. Present both to the user and ask for feedback. > 4. If the user requests changes, refine and present again. > 5. Only when the user says “approved” or “ok”, output a final JSON: > { "videoPrompt": "...", "socialMediaText": "..." }

Key behavior:

JSON Parsing

Node NameRole in Workflow
Parse AI OutputCode node that extracts videoPrompt and socialMediaText from the agent’s output. It is tolerant of different formats (e.g. JSON wrapped in markdown) and throws errors if required fields are missing.

If the AI output is approved JSON, this node returns two clean fields:

These are used in all subsequent steps.


3. User Feedback & Logging

Right after parsing the final JSON, the workflow informs you and logs the content.

Node NameRole in Workflow
Inform user about processingTelegram node that tells you: “Okay. Your video is being prepared now. I’ll let you know as soon as it’s online.”
Save Prompt & Post-TextGoogle Sheets node that appends a new row containing the videoPrompt and socialMediaText to a sheet (e.g., for tracking which prompts/captions you used).

This gives you both visibility (confirmation message) and historical tracking of your content ideas.


4. Video Generation with Gemini

Now the actual video is created using Google Gemini’s video model.

Node NameRole in Workflow
Generate a videoGemini node (model models/veo-3.0-fast-generate-001) that uses videoPrompt to generate a vertical video (aspect ratio 9:16).

The videoPrompt from the AI agent is passed directly into this node. The resulting binary output is a generated short-form video suitable for TikTok, Reels and Stories.


5. Staging the Video in Google Drive

To make the video accessible for Blotato, the workflow uses Google Drive as a simple file staging area.

Node NameRole in Workflow
Upload videoUploads the generated video binary to a specific folder in Google Drive (n8n_videos). The file name is taken from the binary metadata or defaults to video.mp4.
Download Video from Drive1Immediately downloads the uploaded video by file ID, this time as binary data suitable for passing into [Blotato].

Using Drive ensures that the file is properly hosted and addressable when uploading to [Blotato]’s media API.


6. Uploading to [Blotato]and Creating Posts

First, the video is sent to [Blotato] as a media asset. Then three separate posts are created for TikTok, Instagram, and Facebook.

Media Upload

Node NameRole in Workflow
Upload media1[Blotato] media node. Uploads the binary video as a media asset and returns a public url used by all post creation nodes.

Platform-Specific Post Creation

From the uploaded media, the workflow fans out into three branches:

Node NamePlatformRole in Workflow
Create TikTok postTikTokCreates a TikTok post using the media URL and socialMediaText as the caption. Also sets the flag that the video is AI-generated.
Create post1InstagramCreates an Instagram (or related) post linked to the [Blotato] account (e.g., aimaginate_xx), using the same socialMediaText and media URL.
Create Facebook postFacebook PageCreates a Facebook post on your specified page, again using the shared caption and media URL.

At this point, all three platforms have an initial “post submission” created via [Blotato]. Next, the workflow tracks their publishing status.


7. Status Monitoring & Retry Loops

Each platform has its own mini-loop that polls [Blotato]) until the post is either published or failed.

TikTok Status Loop

Node NameRole in Workflow
WaitInitial 5-second (or configured) pause after creating the TikTok post.
Check Post StatusBlotato “get” operation that fetches the current status (published, in-progress, etc.) of the TikTok post by postSubmissionId.
Published to TikTok?IF node that checks if status === "published".
Confirm publishing to TiktokTelegram node that notifies you when the TikTok post is live (often including a link or at least a confirmation text).
In Progress?IF node that checks if status === "in-progress".
Give Blotat other 5s :)Wait node that sleeps a bit before checking again. Feeds back into Published to TikTok? to create a polling loop.
Send TikTok Error MessageTelegram node that informs you if the status is neither published nor in progress (i.e., a failure).

Instagram Status Loop

Node NameRole in Workflow
Wait1Wait node after Create post1, giving Blotato time to process the Instagram post.
Get post1Blotato “get” operation to read status of the Instagram post.
Published to Instagram?IF node checking if status === "published".
Confirm publishing to InstagramTelegram message with confirmation that your Instagram post is live.
In Progress?1IF node checking if status === "in-progress".
Give Blotat more timeWait node that loops back to Published to Instagram? for another status check.
Send Instagram Error MessageTelegram notification if the Instagram post fails.

Facebook Status Loop

Node NameRole in Workflow
Wait2Wait node after Create Facebook post (longer pause, e.g. 30 seconds).
Get Facebook postBlotato “get” operation to fetch Facebook post status.
Published to Facebook?IF node testing for status === "published".
Confirm publishing to FacebookTelegram notification that the Facebook post is online.
In Progress?2IF node checking if the Facebook post is still in progress.
Give Blotat other 5s :)2Wait node that loops back into Published to Facebook? for repeated checks.
Send Facebook Error MessageTelegram notification if the Facebook post fails or ends in an unexpected state.

This structure ensures that each platform is monitored independently, with clear success or error messages delivered right into your Telegram chat.


🛠️ Personalizing Your Video Content Bot

The real power of this workflow is how easy it is to adapt it to your own style, platforms, and preferences.

1. Tweak the AI Prompt & Behavior

You can also extend it, e.g.:

2. Change Video Model or Aspect Ratio

3. Modify Which Platforms You Post To

You can:

4. Adjust Wait Times and Retry Logic

5. Extend Logging & Analytics


In short, this workflow gives you a full AI-powered video pipeline:

  1. Idea (text/voice) via Telegram
  2. Drafting & approval of video prompt + caption via OpenAI agent
  3. Video generation with Gemini (veo)
  4. Staging in Google Drive
  5. Auto-posting and status monitoring across TikTok, Instagram & Facebook via Blotato
  6. All communication and confirmations returned directly to Telegram

And everything is fully editable so you can adapt it precisely to your personal brand and content strategy.

đź”— Nodes Used

Google Sheets, Telegram, Telegram Trigger, Google Drive, AI Agent, OpenAI Chat Model

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup