Telegram + OpenAI: UGC videos delivered back fast
You know the loop. Someone drops a “quick UGC idea” in chat, you ask for a photo, you ask for a script, you ask for a hook, then you wait on edits and exports. Meanwhile the campaign is sitting there with nothing new to test.
This Telegram UGC automation hits performance marketers first, but ecommerce founders and agency leads feel it too. The outcome is simple: you send a product photo and a short brief, and you get a UGC-style ad video back in Telegram without the back-and-forth.
Below you’ll see how the workflow runs, what it replaces day-to-day, and what you can customize if you want longer videos, different models, or a tracking sheet.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Telegram + OpenAI: UGC videos delivered back fast
flowchart LR
subgraph sg0["Telegram Flow"]
direction LR
n0@{ icon: "mdi:wrench", form: "rounded", label: "Think", pos: "b", h: 48 }
n1@{ icon: "mdi:brain", form: "rounded", label: "GPT", pos: "b", h: 48 }
n2@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out", pos: "b", h: 48 }
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Create Video"]
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Video"]
n5@{ icon: "mdi:cog", form: "rounded", label: "Wait 2", pos: "b", h: 48 }
n6@{ icon: "mdi:cog", form: "rounded", label: "Wait 3", pos: "b", h: 48 }
n7@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If ", pos: "b", h: 48 }
n8@{ icon: "mdi:cog", form: "rounded", label: "Aggregate", pos: "b", h: 48 }
n9@{ icon: "mdi:cog", form: "rounded", label: "Wait", pos: "b", h: 48 }
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Send Video"]
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Telegram Trigger"]
n12@{ icon: "mdi:swap-vertical", form: "rounded", label: "Bot ID", pos: "b", h: 48 }
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Img Path"]
n14@{ icon: "mdi:robot", form: "rounded", label: "Describe Img", pos: "b", h: 48 }
n15["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>In Progress"]
n16@{ icon: "mdi:robot", form: "rounded", label: "Structured Output 1", pos: "b", h: 48 }
n17@{ icon: "mdi:robot", form: "rounded", label: "Structured Output 2", pos: "b", h: 48 }
n18["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Create Image"]
n19["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Image"]
n20["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Combine Clips"]
n21["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Final Video"]
n22@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If 2", pos: "b", h: 48 }
n23@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If", pos: "b", h: 48 }
n24@{ icon: "mdi:robot", form: "rounded", label: "UGC Video AI Agent", pos: "b", h: 48 }
n25@{ icon: "mdi:robot", form: "rounded", label: "UGC Image AI Agent", pos: "b", h: 48 }
n23 --> n8
n23 --> n5
n1 -.-> n24
n1 -.-> n25
n1 -.-> n16
n1 -.-> n17
n7 --> n24
n7 --> n6
n22 --> n10
n22 --> n9
n9 --> n21
n0 -.-> n24
n0 -.-> n25
n12 --> n13
n5 --> n4
n6 --> n19
n8 --> n20
n19 --> n7
n4 --> n23
n2 --> n3
n15 --> n25
n18 --> n6
n3 --> n5
n14 --> n15
n13 --> n14
n20 --> n9
n21 --> n22
n11 --> n12
n25 --> n18
n16 -.-> n24
n17 -.-> n25
n24 --> n2
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n11 trigger
class n14,n16,n17,n24,n25 ai
class n1 aiModel
class n0 ai
class n7,n22,n23 decision
class n3,n4,n13,n18,n19,n20,n21 api
classDef customIcon fill:none,stroke:none
class n3,n4,n10,n11,n13,n15,n18,n19,n20,n21 customIcon
The Problem: UGC video production is a bottleneck
UGC-style ads look “casual,” but producing them is anything but. You still need a product angle, a believable scene plan, a few short clips that don’t feel too polished, and a final merge that actually matches the brief. When you do it manually, the work splinters across DMs, folders, editing tools, and “can you resend that file” moments. It’s not just time. It’s the mental load of keeping versions straight, plus the opportunity cost of not testing new hooks this week because production got stuck.
It adds up fast. Here’s where it breaks down.
- You spend about an hour per variant just coordinating inputs, fixes, and exports.
- Briefs get interpreted differently across creators, so you end up rewriting the same “style rules” every time.
- Clip length and pacing are inconsistent, which means extra edits before you can even run a clean test.
- When you need five new concepts, production doesn’t scale; it just turns into more waiting.
The Solution: Telegram in, UGC ad video out
This workflow turns Telegram into a simple “creative intake” channel. You message your bot with one compressed image (product, and optionally a character) plus a short instruction like “make a 20-second UGC ad.” n8n grabs that image from Telegram, then OpenAI analyzes what’s in it so the prompts stay grounded in the actual product details. From there, an AI agent generates a realistic, UGC-style image prompt (think iPhone photo vibes), creates the image via an external model, then plans scenes and dialogue for short video clips. Those clips are generated, checked until ready, collected, and stitched into one continuous video. Finally, the finished download link is delivered back to your Telegram chat.
The workflow starts with a Telegram message and a file fetch. Then OpenAI handles analysis plus structured scene planning, while HTTP requests create images, generate clips, and merge them. At the end, you get a single UGC-style video back in the same place you requested it.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you want 5 new UGC ad variants for a product this week. Manually, a “simple” loop (briefing, finding/refining hooks, getting 3 short clips, stitching, exporting, and sending) can easily run about 2 hours per variant, so you lose a full day. With this workflow, you drop a photo and a sentence into Telegram in about 2 minutes, then wait for the AI generation and merge (often around 20 minutes). You still review the output, but you’re no longer doing the busywork. That’s roughly 8–10 hours back in a week.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Telegram to collect photos and briefs.
- OpenAI for image analysis and scene planning.
- Key.AI / File.AI endpoints (get the API key from your provider dashboard)
Skill level: Intermediate. You’ll connect credentials, paste API keys, and adjust a couple of prompts without breaking the flow.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A Telegram message kicks things off. You send one compressed image plus a short instruction (length, vibe, angle). The bot receives it and n8n grabs the file behind the scenes.
The workflow extracts what matters from the image. OpenAI analyzes the photo and turns it into structured details, so the prompts stay consistent and don’t “hallucinate” basic product attributes.
AI plans the UGC story, then generates the assets. An image prompt is created first, then an image is generated and checked until it’s ready. Next, the workflow builds a scene plan (dialogue, setting, pacing), splits it into short clips (often around 8 seconds each), and generates each clip via HTTP requests while n8n waits and re-checks status.
The clips are merged and delivered back to you. Once all URLs are collected, the workflow sends them to an FFmpeg merge service and polls until the final video is available. Then it posts the finished video link back to Telegram, ready for review and testing.
You can easily modify the clip length and model choice to match your testing cadence. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Telegram Trigger
This workflow starts when a user sends a Telegram message with a photo and caption.
- Add the Incoming Telegram node and keep Updates set to
message. - Credential Required: Connect your
telegramApicredentials in Incoming Telegram.
Step 2: Connect Telegram Bot Token and Fetch the Image File
The next nodes fetch the image file path from Telegram using your bot token.
- In Assign Bot Token, set the field bot id to your Telegram bot token value, replacing
[CONFIGURE_YOUR_TOKEN]. - In Retrieve File Path, set URL to
=https://api.telegram.org/bot{{ $('Assign Bot Token').item.json['bot id'] }}/getFile?file_id={{ $('Incoming Telegram').first(0,0).json.message.photo[2].file_id }}. - Confirm that Assign Bot Token connects to Retrieve File Path, and Retrieve File Path connects to Analyze Image.
[CONFIGURE_YOUR_TOKEN] in Assign Bot Token, Telegram file retrieval will fail. Replace it with the real bot token.Step 3: Set Up AI Analysis and Prompt Agents
This section analyzes the uploaded image and produces structured prompts for image and video generation.
- In Analyze Image, keep Resource set to
image, Operation toanalyze, and Image URLs set to=https://api.telegram.org/file/bot{{ $('Assign Bot Token').item.json['bot id'] }}/{{ $json.result.file_path }}. - Credential Required: Connect your
openAiApicredentials in Analyze Image. - In Notify Progress, set Text to
Got it! I'm now creating your video...and Chat ID to={{ $('Incoming Telegram').first().json.message.chat.id }}. - Credential Required: Connect your
telegramApicredentials in Notify Progress. - In Image Prompt Agent, keep the Text field as provided and ensure Has Output Parser is enabled.
- In Video Prompt Agent, keep the Text field as provided and ensure Has Output Parser is enabled.
- Confirm that Chat Model is connected as the language model to Image Prompt Agent and Video Prompt Agent, and that Reasoning Tool is connected as their tool.
openAiApi credentials in Chat Model. The AI sub-nodes Reasoning Tool, Image Output Parser, and Scene Output Parser inherit credentials from the parent agents, so add credentials on Chat Model rather than the sub-nodes.Step 4: Generate the Image and Poll for Readiness
These nodes generate the image from the prompt and wait until the image is ready.
- In Generate Image, set URL to
https://api.kie.ai/api/v1/gpt4o-image/generateand keep the JSON Body as defined withfilesUrl,prompt, andsizeexpressions. - Credential Required: Connect your
httpHeaderAuthcredentials in Generate Image. - In Delay Image Check, set Amount to
60seconds. - In Fetch Image Status, set URL to
=https://api.kie.ai/api/v1/gpt4o-image/record-infoand pass taskId as={{ $('Generate Image').first().json.data.taskId }}. - Credential Required: Connect your
httpHeaderAuthcredentials in Fetch Image Status. - In Clip Ready?, keep the condition checking
={{ $json.data.successFlag }}equals1to loop until ready.
Step 5: Generate Video Clips, Merge, and Retrieve Final Video
After the image is ready, the workflow generates clips per scene, aggregates them, and merges into a final video.
- In Separate Scenes, set Field to Split Out to
output.scenesto iterate through each generated scene. - In Generate Clip, set URL to
https://api.kie.ai/api/v1/veo/generateand keep the Body expressions that use{{ $('Separate Scenes').item.json.video_prompt }},{{ $('Separate Scenes').item.json.model }},{{ $('Separate Scenes').item.json.aspect_ratio_video }}, and the image URL from Fetch Image Status. - Credential Required: Connect your
httpHeaderAuthcredentials in Generate Clip. - In Delay Clip Check, set Amount to
120seconds, then configure Fetch Clip Status with URL=https://api.kie.ai/api/v1/veo/record-infoand taskId={{ $('Generate Clip').item.json.data.taskId }}. - Credential Required: Connect your
httpHeaderAuthcredentials in Fetch Clip Status and Merge Video Clips, Retrieve Final Video. - In Clip Status Check, keep the condition
={{ $json.data.successFlag }}equals1to continue or loop back to Delay Clip Check. - In Collect Clip URLs, keep the aggregation on
data.response.resultUrls[0], then send to Merge Video Clips with JSON Body set to={ "video_urls": [{{ $json.resultUrls[0].map(url => `"${url}"`) }}] }. - In Pause Before Fetch, set Amount to
100seconds, then use Retrieve Final Video with URL={{ $('Merge Video Clips').first().json.response_url }}. - In Video Available?, keep the condition
={{ $json.video.url }}is not empty to decide whether to deliver or loop.
httpHeaderAuth credentials across all HTTP generation nodes. This workflow uses 7+ HTTP nodes for image and video generation; ensure the same auth headers are configured in each.Step 6: Configure Output Delivery to Telegram
Once the final video is ready, it is delivered back to the user in Telegram.
- In Deliver Video, set Operation to
sendVideoand File to={{ $json.video.url }}. - Set Chat ID to
={{ $('Incoming Telegram').first().json.message.chat.id }}. - Credential Required: Connect your
telegramApicredentials in Deliver Video.
Step 7: Test and Activate Your Workflow
Validate the complete flow from Telegram input to video delivery.
- Click Execute Workflow and send a Telegram message with a photo and caption to your bot.
- Verify the run: Incoming Telegram triggers, Notify Progress sends the acknowledgement message, and the image/video generation loop nodes progress without errors.
- Confirm a successful run when Deliver Video sends a video file back to the same Telegram chat.
- When satisfied, toggle the workflow to Active to enable production use.
Common Gotchas
- Telegram bot credentials can be surprisingly fragile. If delivery fails, check the Bot Token in n8n first and confirm the bot still has permission to message your chat.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 30–60 minutes if your API keys are ready.
No. You’ll mostly connect accounts and paste API keys into n8n. The only “technical” part is adjusting prompts without overcomplicating them.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI usage plus your image/video generation provider costs (video clips are often around $0.40 each on fast models).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and it’s the main reason this workflow is useful. You can change the requested duration in your Telegram message, and the “Video Prompt Agent” will adjust how many clips get generated. If you want a different look, tweak the “Image Prompt Agent” so it bakes in your brand style rules (lighting, background, framing, creator vibe). Many teams also swap the clip model between “Fast” and “Quality” depending on whether they’re testing or scaling winners.
Usually it’s an invalid or rotated bot token, so n8n is triggering but can’t fetch files or send the final message. Re-check the bot token in your credential setup and confirm the chat ID is correct. Also watch for Telegram file retrieval issues: if the workflow can’t resolve the file path, everything downstream will look “broken” even though the AI steps are fine.
If you self-host n8n, there’s no fixed execution limit; it mostly depends on your server and the external rendering queues.
For UGC video generation, n8n is usually a better fit because you need branching (the If checks), waiting/polling for external jobs, and a bit of data shaping between calls. Zapier and Make can do parts of it, but frankly they get clunky once you’re generating multiple clips and merging them. n8n also gives you the option to self-host, which matters when you start running lots of creative variants. If you only want a simple “Telegram message to Google Drive upload,” those tools can be fine. For this specific workflow’s logic, n8n is the calmer choice. Talk to an automation expert if you want a quick recommendation.
The workflow handles the repetitive production loop so you can focus on angles, offers, and testing. Set it up once, then ship more variants without the constant chasing.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.