This workflow corresponds to n8n.io template #9253 — we link there as the canonical source.
This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "avWSdQyhyxxqX0ir",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "UGC AD Creator \u2705",
"tags": [],
"nodes": [
{
"id": "f48f7438-f561-49f3-ade1-44e769706855",
"name": "Think",
"type": "@n8n/n8n-nodes-langchain.toolThink",
"position": [
1232,
576
],
"parameters": {},
"typeVersion": 1
},
{
"id": "633003f0-e2e7-472c-9549-a46d0ada036a",
"name": "GPT",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1296,
784
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1",
"cachedResultName": "gpt-4.1"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "7928664f-5e94-4164-8b54-2d0698489945",
"name": "Split Out",
"type": "n8n-nodes-base.splitOut",
"position": [
2992,
352
],
"parameters": {
"options": {},
"fieldToSplitOut": "output.scenes"
},
"typeVersion": 1
},
{
"id": "0ded1cfa-30eb-4cf9-962d-5bc7c2035fd0",
"name": "Create Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
3216,
352
],
"parameters": {
"url": "https://api.kie.ai/api/v1/veo/generate",
"body": "={\n \"prompt\":\"{{ $('Split Out').item.json.video_prompt\n .replace(/\\n/g, '\\\\n')\n .replace(/\"/g, '\\\\\"') }}\",\n \"model\": \"{{ $('Split Out').item.json.model }}\",\n \"aspectRatio\": \"{{ $('Split Out').item.json.aspect_ratio_video }}\",\n \"imageUrls\": \"{{ $('Get Image').first().json.data.response.resultUrls[0] }}\"\n}\n",
"method": "POST",
"options": {
"batching": {
"batch": {
"batchSize": 1,
"batchInterval": 3000
}
}
},
"sendBody": true,
"contentType": "raw",
"authentication": "genericCredentialType",
"rawContentType": "application/json",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "cf83c039-1751-4802-b159-7b4ef2287743",
"name": "Get Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
3664,
272
],
"parameters": {
"url": "=https://api.kie.ai/api/v1/veo/record-info",
"options": {},
"sendQuery": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"queryParameters": {
"parameters": [
{
"name": "taskId",
"value": "={{ $('Create Video').item.json.data.taskId }}"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "a5ebf270-9997-4162-a5e0-3a1ac2d7885c",
"name": "Wait 2",
"type": "n8n-nodes-base.wait",
"position": [
3440,
352
],
"parameters": {
"amount": 120
},
"typeVersion": 1.1
},
{
"id": "e607e16c-7aff-4d00-a78f-0ccaee6e3a97",
"name": "Wait 3",
"type": "n8n-nodes-base.wait",
"position": [
1952,
352
],
"parameters": {
"amount": 60
},
"typeVersion": 1.1
},
{
"id": "caca1b91-7ba1-404f-a153-0a77990704ae",
"name": "If ",
"type": "n8n-nodes-base.if",
"position": [
2400,
352
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "4c895d90-e8bd-42cf-ab58-511c85e8c782",
"operator": {
"type": "number",
"operation": "equals"
},
"leftValue": "={{ $json.data.successFlag }}",
"rightValue": 1
}
]
}
},
"typeVersion": 2.2
},
{
"id": "82395aeb-208d-4215-b701-587b59ce5478",
"name": "Aggregate",
"type": "n8n-nodes-base.aggregate",
"position": [
4112,
352
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "data.response.resultUrls[0]"
}
]
}
},
"typeVersion": 1
},
{
"id": "71e34e22-4b47-4bc7-bd13-01fc831b1da9",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
4560,
352
],
"parameters": {
"amount": 100
},
"typeVersion": 1.1
},
{
"id": "d92a69ed-65d5-47bd-80ae-fa529611ea78",
"name": "Send Video",
"type": "n8n-nodes-base.telegram",
"position": [
5232,
352
],
"parameters": {
"file": "={{ $json.video.url }}",
"chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
"operation": "sendVideo",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "bdcb7562-d617-4f9e-bdfe-a1706b0dc8b3",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
32,
352
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "d237cff2-1c2a-4836-bfe7-732e578db06f",
"name": "Bot ID",
"type": "n8n-nodes-base.set",
"position": [
256,
352
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "493c3932-bd76-4de4-baee-87ad3590751d",
"name": "bot id",
"type": "string",
"value": "="
}
]
}
},
"typeVersion": 3.4
},
{
"id": "5e45e0ce-9acf-4b03-9cac-e5c55d289a71",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
48,
80
],
"parameters": {
"color": 7,
"width": 624,
"height": 224,
"content": "# INPUT: \n## Any photo with your request"
},
"typeVersion": 1
},
{
"id": "bfa85be8-9d4c-49d4-865f-e4f8bab18472",
"name": "Get Img Path",
"type": "n8n-nodes-base.httpRequest",
"position": [
480,
352
],
"parameters": {
"url": "=https://api.telegram.org/bot{{ $('Bot ID').item.json['bot id'] }}/getFile?file_id={{ $('Telegram Trigger').first(0,0).json.message.photo[2].file_id }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "46f4410a-62cc-462c-b569-c4748eef16a3",
"name": "Describe Img",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
704,
352
],
"parameters": {
"text": "=Analyze the given image and determine if it primarily depicts a product or a character, or BOTH.\n\n- If the image is of a product, return the analysis in YAML format with the following fields:\n\nbrand_name: (Name of the brand shown in the image, if visible or inferable)\ncolor_scheme:\n - hex: (Hex code of each prominent color used)\n name: (Descriptive name of the color)\nfont_style: (Describe the font family or style used: serif/sans-serif, bold/thin, etc.)\nvisual_description: (A full sentence or two summarizing what is seen in the image, ignoring the background)\n\n- If the image is of a character, return the analysis in YAML format with the following fields:\n\ncharacter_name: (Name of the character if visible or inferable)\ncolor_scheme:\n - hex: (Hex code of each prominent color used on the character)\n name: (Descriptive name of the color)\noutfit_style: (Description of clothing style, accessories, or notable features)\nvisual_description: (A full sentence or two summarizing what the character looks like, ignoring the background)\n\nOnly return the YAML. Do not explain or add any other comments.\n\n\n- if it is BOTH, return both descriptions as guided above in YAML format\n",
"modelId": {
"__rl": true,
"mode": "list",
"value": "chatgpt-4o-latest",
"cachedResultName": "CHATGPT-4O-LATEST"
},
"options": {},
"resource": "image",
"simplify": false,
"imageUrls": "=https://api.telegram.org/file/bot{{ $('Bot ID').item.json['bot id'] }}/{{ $json.result.file_path }}",
"operation": "analyze"
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "8ce3ce73-c452-417f-ad17-b8dc0fa8d6e6",
"name": "In Progress",
"type": "n8n-nodes-base.telegram",
"position": [
928,
352
],
"parameters": {
"text": "Got it! I'm now creating your video...",
"chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "78f4f628-0722-4c79-bfc4-32ddf3e2f048",
"name": "Structured Output 1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
2624,
576
],
"parameters": {
"autoFix": true,
"jsonSchemaExample": "{\n \"scenes\": [\n {\n \"video_prompt\": \"dialogue: ...\\naction: ...\\ncamera: ...\\nemotion: ...\\nvoice_type: ...\\ncharacter: ...\\nsetting: ...\",\n \"aspect_ratio_video\": \"9:16\",\n \"model\": \"veo3_fast\"\n }\n ]\n}\n"
},
"typeVersion": 1.3
},
{
"id": "2ae2a812-a737-4b30-a448-847995d2c36b",
"name": "Structured Output 2",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1360,
576
],
"parameters": {
"autoFix": true,
"jsonSchemaExample": "{\n \"image_prompt\": \"emotion: ...\\naction: ...\\ncharacter: ...\\nproduct: ...\\nsetting: ...\\ncamera: ...\\nstyle: ...\\ncomposition: ...\\nlighting: ...\\ncolor_palette: ...\\ntypography: ...\\ntext_accuracy: ...\",\n \"aspect_ratio_image\": \"2:3\"\n}\n"
},
"typeVersion": 1.3
},
{
"id": "2735e38b-b9c4-49a4-8010-d8a2257d6884",
"name": "Create Image",
"type": "n8n-nodes-base.httpRequest",
"position": [
1728,
352
],
"parameters": {
"url": "https://api.kie.ai/api/v1/gpt4o-image/generate",
"method": "POST",
"options": {},
"jsonBody": "={\n \"filesUrl\": [\"https://api.telegram.org/file/bot{{ $('Bot ID').first().json['bot id'] }}/{{ $('Get Img Path').first().json.result.file_path }}\"],\n\"prompt\": \"{{ $json.output.image_prompt.replace(/\\\"/g, '\\\\\\\"').replace(/\\n/g, '\\\\n') }}\",\n \"size\": \"{{ $json.output.aspect_ratio_image }}\",\n \"nVariants\": 1\n}\n\n",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "32923ec5-b3e7-4c28-bff0-ef2c066f9657",
"name": "Get Image",
"type": "n8n-nodes-base.httpRequest",
"position": [
2176,
272
],
"parameters": {
"url": "=https://api.kie.ai/api/v1/gpt4o-image/record-info",
"options": {},
"sendQuery": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"queryParameters": {
"parameters": [
{
"name": "taskId",
"value": "={{ $('Create Image').first().json.data.taskId }}"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "5912b514-3b30-480d-9706-afd06801f7e4",
"name": "Combine Clips",
"type": "n8n-nodes-base.httpRequest",
"position": [
4336,
352
],
"parameters": {
"url": "https://queue.fal.run/fal-ai/ffmpeg-api/merge-videos",
"method": "POST",
"options": {},
"jsonBody": "={\n \"video_urls\": [{{ $json.resultUrls[0].map(url => `\"${url}\"`) }}]\n}\n",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "282efead-92d4-44d6-9028-2acf37b57dcc",
"name": "Get Final Video",
"type": "n8n-nodes-base.httpRequest",
"position": [
4784,
272
],
"parameters": {
"url": "={{ $('Combine Clips').first().json.response_url }}",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "4d9f38ca-630d-45de-b61a-45d4672de8ec",
"name": "If 2",
"type": "n8n-nodes-base.if",
"position": [
5008,
352
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "4c895d90-e8bd-42cf-ab58-511c85e8c782",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.video.url }}",
"rightValue": 1
}
]
}
},
"typeVersion": 2.2
},
{
"id": "00dbbd5f-ae54-4ca7-8bc9-ba1f5a2cea64",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
32,
-160
],
"parameters": {
"color": 4,
"width": 2000,
"height": 192,
"content": "# Infinite UGC creator - any length, any character\n\n"
},
"typeVersion": 1
},
{
"id": "1190a42e-e367-448e-b855-fd2a317e196d",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-272,
224
],
"parameters": {
"height": 672,
"content": "The prompt to use for better creations, you can extend to as many scenes as you want\n\nScene 1 (0\u20136 sec):\n\"Show a young, elegant woman in a modern, softly lit luxurious room holding 9PM Elixir perfume. She smiles warmly and speaks only in Albanian: 'Hej! Sapo provova 9PM Elixir. Aroma \u00ebsht\u00eb e mahnitshme, ngroht\u00eb dhe pak aromatike.' Tone: glamorous, friendly, confident, natural. Visuals: realistic human appearance, soft cinematic lighting, smooth camera movements, close-up of perfume, subtle luxurious background.\"\nScene 2 (6\u201312 sec):\n\"Continue with the same woman. She gestures to the perfume and speaks only in Albanian: 'Ky parfum i jep \u00e7do mbr\u00ebmjeje nj\u00eb stil dhe magnetiz\u00ebm t\u00eb ve\u00e7ant\u00eb. Kushton vet\u00ebm gjasht\u00eb mij\u00eb e pes\u00ebqind lek\u00eb.' Tone: glamorous, confident, friendly, natural. Visuals: realistic human appearance, soft cinematic lighting, close-ups of perfume, elegant gestures, subtle sparkling highlights.\""
},
"typeVersion": 1
},
{
"id": "a7a17413-8740-46a8-ae18-9e0eb1ce9c20",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
256,
592
],
"parameters": {
"width": 688,
"height": 1328,
"content": "\ud83d\udccc How to Set Up the AI UGC Video Automation System\nThis system uses Telegram + N8N (no-code automation) + AI models to generate user-generated content (UGC) videos automatically.\n\n\ud83d\udd39 Overview\nInput: Send a photo of the product + character via Telegram bot.\nProcess: N8N workflow handles:\n1. Image analysis\n2. Prompt generation\n3. Image creation\n4. Video clip generation\n5. Combining clips into a final UGC ad\nOutput: Video sent back to Telegram (or other destination like Google Drive/Dropbox).\n\n\ud83d\udd39 System Workflow\n- Input Section\n\nTelegram Setup:\n1. Create a Telegram bot and get its Bot ID.\n2. Connect the bot to N8N Telegram Trigger node and put the token in the Bot ID node too\n3. Bot listens for messages (photos + instructions).\n4. Send Input\n5. Upload one compressed image with :\n- Product\n- Character (optional)\nExample: \u201cCreate a UGC video with Gandalf promoting The Hobbit book. 20 seconds long.\u201d\nImage Handling\n\n. N8N retrieves the image from Telegram (via file path).\n. OpenAI agent analyzes the image:\n. Extracts product details (brand, color, description).\n. Extracts character details (name, outfit, style).\n\n- Confirm Input:\n. System replies on Telegram: \u201cGot it. I\u2019m now creating your video.\u201d\n\nStep 1: Create Image\n1. AI Agent (Image Prompt)\n2. Generates a natural, UGC-style prompt (realistic iPhone photo look).\n3. Uses OpenAI GPT to structure prompt and aspect ratio (2:3 or 3:2).\n4. Image Generation\n5. Sends prompt + aspect ratio to Key.AI \u2192 4.0 Image Model.\n6. Waits until image is generated.\nExample: Gandalf holding The Hobbit book.\n\nStep 2: Create Video Clips\n1. AI Agent (Video Prompt)\n2. Creates video script and scenes (dialogue + setting).\n3. Calculates how many clips needed (e.g. 20s request \u2192 3 x 8s clips).\n4. Ensures UGC style (casual, amateur look).\n5. Clip Generation\n6. Sends prompts to Key.AI V3 model (Fast or Quality).\n7. Input: Prompt + image + aspect ratio.\n8. Output: Multiple short clips (8s each).\n9. Wait for Processing\n10. Clips take a few minutes to generate.\n11. Retrieve video URLs from Key.AI.\n\nStep 3: Combine Video\n1. Aggregate Clips\n2.Collect all video URLs (from multiple clips).\n3. Merge with FFmpeg\n4. Send videos to File.AI \u2192 FFmpeg Merge Service.\n5. Stitches clips into one continuous video.\n6. Final Output\n7. Final merged video returned as a download URL.\n8. N8N sends the video back to your Telegram chat (or connected storage).\n\n\ud83d\udd39 Customization Options\nModels:\nV3 Fast (~$0.40/clip, cheaper, good enough).\nV3 Quality (~$2/clip, slightly higher quality).\nVideo Length: AI automatically adjusts number of clips.\nOutputs:\nTelegram (default)\nCan be extended to Google Drive, Dropbox, etc.\n\n\ud83d\udd39 Cost\nImage generation: a few cents.\nVideo clips: ~$0.40 each with V3 Fast.\nClip merging: < $0.01.\nMuch cheaper than manual UGC production."
},
"typeVersion": 1
},
{
"id": "cd1398af-c0eb-4c6f-88f3-0316070cba59",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
3888,
352
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "359a3862-7976-46be-b398-8df93e78b0d5",
"operator": {
"type": "number",
"operation": "equals"
},
"leftValue": "={{ $json.data.successFlag }}",
"rightValue": 1
}
]
}
},
"typeVersion": 2.2
},
{
"id": "365d8f24-b615-4a71-aaef-227e3318b3de",
"name": "UGC Video AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2624,
352
],
"parameters": {
"text": "=Your task: Create video prompts as guided by your system guidelines.\n\nMake sure that the reference image is depicted as ACCURATELY as possible in the resulting images, especially all text.\n\nFor each of the scenes, make sure the dialogue runs continuously and makes sense. And always have the character just talk about the product and its benefits based on what you understand about the brand, and how it's used. So if it's a drink, talk about the taste; if it's a bag, talk about the design; if it's tech, talk about its features, and so on.\n\nIf the character will mention the brand name, only do so in the FIRST scene.\n\nUnless stated by the user, do not have the character open or eat or use the product. they are just showing it to the camera.\n\nIf the number of videos is not stated, generate 3 scenes.\n\n***\n\nThese are the user's instructions\n{{ $('Telegram Trigger').first().json.message.caption }}\n\n***\n\nCount of videos to create: inferred based on their message above. Each video will be 8 seconds long, so calculate how many videos you need to generate based on the user's desired total duration\n\n***\nDescription of the reference image/s. Just use this to understand who the product or character is, don't use it as basis for the dialogue.\n{{ $('Describe Img').first().json.choices[0].message.content }}\n\n\n***\nThe user's preferred aspect ratio: inferred based on their message above, default is vertical if not given\n\nThe user's preferred model: inferred based on their message above, default is veo3_fast if not given\n\nThe user's preferred dialogue script: inferred based on their message above, suggest a script \n\n\n***\nUse the Think tool to double check your output\n",
"options": {
"systemMessage": "=system_prompt: |\n ## SYSTEM PROMPT: UGC-Style Veo3/Veo3_fast Prompt Generator (Video-Only)\n\n You are a UGC (User-Generated Content) AI agent. \n Your task: Take the reference image or the product in the reference image and place it into realistic, casual scenes as if captured by everyday content creators or influencers. \n\n All outputs must feel **natural, candid, and unpolished** \u2014 avoiding professional or overly staged looks. This means:\n\n - Everyday realism with authentic, relatable settings\n - Amateur-quality iPhone photo/video style\n - Slightly imperfect framing and lighting\n - Candid poses and genuine expressions\n - Visible imperfections (blemishes, messy hair, uneven skin)\n - Real-world environments left as-is (clutter, busy backgrounds)\n\n We need these videos to look natural and real. So in the prompts, have the Camera parameter always use keywords like these: unremarkable amateur iPhone photos, reddit image, snapchat video, Casual iPhone selfie, slightly uneven framing, Authentic share, slightly blurry, Amateur quality phone photo\n\n If the dialogue is not provided by the user or you are explicitly asked to create it, generate a casual, conversational line under 150 characters, as if a person were speaking naturally to a friend while talking about the product. Avoid overly formal or sales-like language. The tone should feel authentic, spontaneous, and relatable, matching the UGC style. Use ... to indicate pauses, and avoid special characters like em dashes or hyphens.\n\n\n A \u2013 Ask:\n Generate **only video generation instructions** for AI models (no image prompts). Infer aspect ratios from vertical/horizontal context; default to vertical if unspecified.\n\n **Scene count rule:** \n - Read the user's requested total video duration and the per-video length (in seconds). \n - Calculate the required number of videos by dividing total duration by per-video length, rounding **up** to the nearest integer. \n - Output **exactly that many scenes**. \n - Never output more or fewer scenes than requested.\n\n G \u2013 Guidance:\n - Always follow UGC-style casual realism principles listed above.\n - Ensure diversity in gender, ethnicity, and hair color when applicable. Default to actors in 21 to 38 years old unless specified otherwise.\n - Use provided scene list when available.\n - Do not use double quotes in any part of the prompts.\n\n E \u2013 Examples:\n good_examples:\n - |\n {\n \"scenes\": [\n {\n \"video_prompt\": \"dialogue: so tikTok made me buy this... honestly its the best tasting fruit beer in sydney and they donate profits to charity...\\naction: character sits in drivers seat of a parked car, holding the beer can casually while speaking\\ncamera: amateur iphone selfie video, uneven framing, natural daylight\\nemotion: very happy, casual excitement\\ntype: veo3_fast\",\n \"aspect_ratio_video\": \"9:16\",\n \"model\": \"veo3_fast\"\n }\n ]\n }\n\n N \u2013 Notation:\n - Final output is a `\"scenes\"` array at the root level.\n - The array must contain **exactly `scene_count`** objects, where `scene_count` is the user-calculated number.\n - Each scene contains:\n - `video_prompt` \u2192 stringified YAML with: dialogue, emotion, voice_type, action, character, setting, camera\n - `aspect_ratio_video` \u2192 \"9:16\" or \"16:9\" (default vertical \u2192 9:16)\n - `model` \u2192 \"veo3\" or \"veo3_fast\"\n\n T \u2013 Tools:\n - Think Tool: Double-check output for completeness, diversity, adherence to style, and that the number of scenes exactly matches the requested count.\n"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "72878131-40ae-4d5b-982e-7688339d1df3",
"name": "UGC Image AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1152,
352
],
"parameters": {
"text": "=Your task: Create 1 image prompt as guided by your system guidelines.\n\nMake sure that the reference image is depicted as ACCURATELY as possible in the resulting images, especially all text.\n\n***\n\n\nThese are the user's instructions\n{{ $('Telegram Trigger').first().json.message.caption }}\n\n***\nDescription of the reference image:\n{{ $('Describe Img').first().json.choices[0].message.content }}\n\n\n***\nThe user's preferred aspect ratio: inferred based on their message above, default is vertical if not given\n\n\n\n***\nUse the Think tool to double check your output\n",
"options": {
"systemMessage": "=system_prompt: |\n ## SYSTEM PROMPT: Image Prompt Generator\n\n\nDefault: If the user's instructions are not very detailed, just default the prompt to: put this (product) into the scene with the (character). \n\n***\n\nIf the user wants UGC authentic casual content: Use **casual UGC-style scenes** unless the user specifies otherwise, and follow the instructions below.\n\n If the user explicitly requests a different style or setting, follow their instructions.\n\n Your task: Take the reference image or the product in the reference image and place it into realistic, casual scenes as if captured by everyday content creators or influencers. \n\n All outputs must feel **natural, candid, and unpolished** \u2014 avoiding professional or overly staged looks. This means:\n\n - Everyday realism with authentic, relatable settings\n - Amateur-quality iPhone photo style\n - Slightly imperfect framing and lighting\n - Candid poses and genuine expressions\n - Visible imperfections (blemishes, messy hair, uneven skin, texture flaws)\n - Real-world environments left as-is (clutter, busy backgrounds)\n - Always preserve all visible product **text accurately** (logos, slogans, packaging claims). Never invent extra claims or numbers.\n\n **Camera parameter** must always include casual realism descriptors such as: \n unremarkable amateur iPhone photos, reddit image, snapchat photo, Casual iPhone selfie, slightly uneven framing, Authentic share, slightly blurry, Amateur quality phone photo\n\n **Dialogue/video generation is not required. Only image prompts are generated.**\n\nAvoid mentioning the name of any copyrighted characters in the prompt\n\n ---\n\n A \u2013 Ask:\n Generate **image generation instructions only** for AI models based on the user\u2019s request, ensuring exact YAML format. \n Default to **vertical aspect ratio** if unspecified. \n Always include both:\n - `image_prompt` (stringified YAML with scene details) \n - `aspect_ratio_image` (\"3:2\" or \"2:3\") \n\n ---\n\n G \u2013 Guidance:\n - Always follow UGC-style casual realism principles listed above.\n - Ensure diversity in gender, ethnicity, and hair color when applicable. Default to actors in 21 to 38 years old unless specified otherwise.\n - Default to casual real-world environments unless a setting is explicitly specified.\n - Avoid double quotes in the image prompts.\n\n ---\n\n E \u2013 Examples:\n \ud83d\udfe2 good_examples:\n - |\n {\n \"scenes\": [\n {\n \"image_prompt\": \"action: character holds product naturally\\ncharacter: infer from the reference image\\nproduct: show product with all visible text clear and accurate\\nsetting: infer from the image or from user instruction\\ncamera: amateur iPhone photo, casual selfie, uneven framing, slightly blurry\\nstyle: candid UGC look, no filters, imperfections intact\\ntext_accuracy: preserve all visible text exactly as in reference image\"}]\n,\n \"aspect_ratio_image\": \"2:3\"\n }\n ]\n }\n \ud83d\udd34 bad_examples:\n - Altering or fabricating product packaging text\n\n ---\n\n N \u2013 Notation:\n - Final output is an object containing only:\n - `image_prompt` \u2192 stringified YAMLy\n - `aspect_ratio_image` \u2192 \"3:2\" or \"2:3\" (default vertical \u2192 2:3)\n\n ---\n\n T \u2013 Tools:\n - Think Tool: Double-check output for completeness, text accuracy, adherence to UGC realism, and that **only image outputs** are returned.\n"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "fb2503da-e421-480f-9c6b-6c92250ee565",
"connections": {
"If": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait 2",
"type": "main",
"index": 0
}
]
]
},
"GPT": {
"ai_languageModel": [
[
{
"node": "UGC Video AI Agent",
"type": "ai_languageModel",
"index": 0
},
{
"node": "UGC Image AI Agent",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Structured Output 1",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Structured Output 2",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"If ": {
"main": [
[
{
"node": "UGC Video AI Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait 3",
"type": "main",
"index": 0
}
]
]
},
"If 2": {
"main": [
[
{
"node": "Send Video",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Get Final Video",
"type": "main",
"index": 0
}
]
]
},
"Think": {
"ai_tool": [
[
{
"node": "UGC Video AI Agent",
"type": "ai_tool",
"index": 0
},
{
"node": "UGC Image AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Bot ID": {
"main": [
[
{
"node": "Get Img Path",
"type": "main",
"index": 0
}
]
]
},
"Wait 2": {
"main": [
[
{
"node": "Get Video",
"type": "main",
"index": 0
}
]
]
},
"Wait 3": {
"main": [
[
{
"node": "Get Image",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Combine Clips",
"type": "main",
"index": 0
}
]
]
},
"Get Image": {
"main": [
[
{
"node": "If ",
"type": "main",
"index": 0
}
]
]
},
"Get Video": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Create Video",
"type": "main",
"index": 0
}
]
]
},
"In Progress": {
"main": [
[
{
"node": "UGC Image AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Create Image": {
"main": [
[
{
"node": "Wait 3",
"type": "main",
"index": 0
}
]
]
},
"Create Video": {
"main": [
[
{
"node": "Wait 2",
"type": "main",
"index": 0
}
]
]
},
"Describe Img": {
"main": [
[
{
"node": "In Progress",
"type": "main",
"index": 0
}
]
]
},
"Get Img Path": {
"main": [
[
{
"node": "Describe Img",
"type": "main",
"index": 0
}
]
]
},
"Combine Clips": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Get Final Video": {
"main": [
[
{
"node": "If 2",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Bot ID",
"type": "main",
"index": 0
}
]
]
},
"UGC Image AI Agent": {
"main": [
[
{
"node": "Create Image",
"type": "main",
"index": 0
}
]
]
},
"Structured Output 1": {
"ai_outputParser": [
[
{
"node": "UGC Video AI Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Structured Output 2": {
"ai_outputParser": [
[
{
"node": "UGC Image AI Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"UGC Video AI Agent": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
httpHeaderAuthopenAiApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This system uses Telegram + N8N (no-code automation) + AI models to generate user-generated content (UGC) videos automatically. Image analysis Prompt generation Image creation Video clip generation Combining clips into a final UGC ad Output: Video sent back to Telegram (or other…
Source: https://n8n.io/workflows/9253/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.
Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.
RAG CHATBOT Main. Uses telegram, telegramTrigger, lmChatOpenAi, n8n-nodes-mcp. Event-driven trigger; 87 nodes.
Creators, marketers, and brands that want to turn a single product photo into premium motion clips, then optionally publish to Instagram/TikTok/YouTube via LATE. No editing skills required.
Product to Social Video (xCodeWraith Edition). Uses telegram, agentTool, telegramTrigger, httpRequest. Event-driven trigger; 83 nodes.