AutomationFlowsAI & RAG › Ugc Automation

Ugc Automation

UGC Automation. Uses toolThink, lmChatOpenAi, httpRequest, telegram. Event-driven trigger; 31 nodes.

Event trigger★★★★★ complexityAI-powered31 nodesTool ThinkOpenAI ChatHTTP RequestTelegramTelegram TriggerAgentOpenAIOutput Parser Structured
AI & RAG Trigger: Event Nodes: 31 Complexity: ★★★★★ AI nodes: yes Added:

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 →

Download .json
{
  "name": "UGC Automation",
  "nodes": [
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "typeVersion": 1,
      "position": [
        1072,
        928
      ],
      "id": "93994d6d-cd82-468a-8959-e5730205e251",
      "name": "Think"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1",
          "mode": "list",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        928,
        928
      ],
      "id": "d0c8713b-135e-4c09-bdc7-d6a1d46079ec",
      "name": "GPT",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "output.scenes",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1296,
        784
      ],
      "id": "debb8fef-19cf-423c-9e8d-2a7a4e2af8a7",
      "name": "Split Out"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.kie.ai/api/v1/veo/generate",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "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.images[0].url }}\"\n}\n",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 1,
              "batchInterval": 3000
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        272
      ],
      "id": "d25da134-4c6f-4902-8279-e6130644f6fb",
      "name": "Create Video",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "amount": 450
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1120,
        400
      ],
      "id": "d18c362b-fe7c-4d89-ba74-520c5bb781bb",
      "name": "Wait 2"
    },
    {
      "parameters": {
        "amount": 30
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        720,
        400
      ],
      "id": "5fb368db-e5e5-4717-a5b3-f0fa6b69174c",
      "name": "Wait 3"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "4c895d90-e8bd-42cf-ab58-511c85e8c782",
              "leftValue": "={{ $json.images[0].url }}",
              "rightValue": 1,
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        720,
        656
      ],
      "id": "b3353385-b0da-41ec-a2cc-710536bfa6c5",
      "name": "If "
    },
    {
      "parameters": {
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "data.response.resultUrls[0]"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        1520,
        784
      ],
      "id": "2414da12-fce6-4ca0-985f-afccba8abe4f",
      "name": "Aggregate"
    },
    {
      "parameters": {
        "amount": 60
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1520,
        400
      ],
      "id": "6d5e12fe-69b8-4ef2-b5f0-8cf4df8b92a3",
      "name": "Wait"
    },
    {
      "parameters": {
        "operation": "sendVideo",
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "file": "={{ $json.video.url }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1776,
        784
      ],
      "id": "adb3e4c1-4552-4040-9d2d-89635bef748f",
      "name": "Send Video",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        784
      ],
      "id": "5ae2bff6-88ba-4bfb-9c1b-47d02e1b5570",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "493c3932-bd76-4de4-baee-87ad3590751d",
              "name": "bot id",
              "value": "8489802526:AAEw685yRUJLmMfUmf6_Tm0t9IYnsnoUAWc",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        128,
        784
      ],
      "id": "48c38e45-6eb5-4886-9021-b0dd952a15b1",
      "name": "Bot ID"
    },
    {
      "parameters": {
        "promptType": "define",
        "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",
        "hasOutputParser": true,
        "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"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        1008,
        784
      ],
      "id": "efd768e8-8090-4799-9514-f9aa02325694",
      "name": "UGCRobo - Video AI Agent"
    },
    {
      "parameters": {
        "promptType": "define",
        "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",
        "hasOutputParser": true,
        "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"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        688,
        784
      ],
      "id": "1756885b-2da6-4aea-beec-0a89a6766b8d",
      "name": "UGCRobo - Image AI Agent"
    },
    {
      "parameters": {
        "content": "# INPUT: \n## Any photo with your request",
        "height": 224,
        "width": 624,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -32,
        640
      ],
      "id": "97610657-1d63-4625-9721-1e19165cfd97",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "# Step 1:\n## Single Image",
        "height": 224,
        "width": 224,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        656,
        112
      ],
      "id": "2f87fc0e-f5a7-4e1f-8142-36e6f7ce1873",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "# Step 2:\n## Multiple Clips",
        "height": 224,
        "width": 224,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1056,
        112
      ],
      "id": "4b6eb355-2be5-4875-b8ab-616740fba16a",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "# Step 3:\n## Combine Video",
        "height": 224,
        "width": 224,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1456,
        112
      ],
      "id": "3443189a-09cf-461a-921c-770c6f78648d",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "content": "# OUTPUT:\n## UGC Video",
        "height": 224,
        "width": 208,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1728,
        640
      ],
      "id": "ea4e3225-97a7-47bd-ad84-c472fa4533a2",
      "name": "Sticky Note8"
    },
    {
      "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": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        240,
        784
      ],
      "id": "3beaf4b4-cafa-4f33-8d71-d4d5065c1c66",
      "name": "Get Img Path"
    },
    {
      "parameters": {
        "resource": "image",
        "operation": "analyze",
        "modelId": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "GPT-4O"
        },
        "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",
        "imageUrls": "=https://api.telegram.org/file/bot{{ $('Bot ID').item.json['bot id'] }}/{{ $json.result.file_path }}",
        "simplify": false,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        352,
        784
      ],
      "id": "0500805c-d25e-4d03-aaa1-5a4bd448cb3e",
      "name": "Describe Img",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "text": "Got it! I'm now creating your video...",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        464,
        784
      ],
      "id": "a20f2c6c-94f4-4ea3-88f1-f5a0ceafeb5a",
      "name": "In Progress",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "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",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1184,
        928
      ],
      "id": "9b227855-dfb4-4739-bf3e-6a8c5114a172",
      "name": "Structured Output 1"
    },
    {
      "parameters": {
        "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",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        656,
        928
      ],
      "id": "a055d8f5-b8c0-482d-a5e5-67275ccf48a9",
      "name": "Structured Output 2"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://queue.fal.run/fal-ai/nano-banana/edit",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n     \"prompt\": \"{{ $json.output.image_prompt.replace(/\\\"/g, '\\\\\\\"').replace(/\\n/g, '\\\\n') }}\",\n     \"image_urls\": [\n       \"https://api.telegram.org/file/bot{{ $('Bot ID').first().json['bot id'] }}/{{ $('Get Img Path').first().json.result.file_path }}\"\n     ]\n   }",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        720,
        272
      ],
      "id": "3c94b046-7c3d-48ec-855a-9671b2e32e47",
      "name": "Create Image",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        },
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "={{ $('Create Image').item.json.response_url }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        720,
        528
      ],
      "id": "73a1330c-1798-435a-83e1-c0247e48ec0d",
      "name": "Get Image",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://queue.fal.run/fal-ai/ffmpeg-api/merge-videos",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"video_urls\": [{{ $json.resultUrls[0].map(url => `\"${url}\"`) }}]\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1520,
        272
      ],
      "id": "0955d15c-3701-47c3-aa67-3903afed01f4",
      "name": "Combine Clips",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "={{ $('Combine Clips').first().json.response_url }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1520,
        528
      ],
      "id": "4c16e422-3550-4fcf-b172-b513ebd970e0",
      "name": "Get Final Video",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "4c895d90-e8bd-42cf-ab58-511c85e8c782",
              "leftValue": "={{ $json.video.url }}",
              "rightValue": 1,
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1520,
        656
      ],
      "id": "43fd567e-8cb8-4c59-ad90-27219e8cfdda",
      "name": "If 2"
    },
    {
      "parameters": {
        "url": "=https://api.kie.ai/api/v1/veo/record-info",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "taskId",
              "value": "={{ $('Create Video').item.json.data.taskId }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        528
      ],
      "id": "214a5bc8-6166-4b49-aa32-ee64d9c2c3c1",
      "name": "Get Video",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "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",
        "hasOutputParser": true,
        "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"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        1104,
        1360
      ],
      "id": "f2f075dd-dca1-4505-a17a-f65207678ed9",
      "name": "UGCRobo - Video AI Agent1"
    }
  ],
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "UGCRobo - Video AI Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "UGCRobo - Image AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "GPT": {
      "ai_languageModel": [
        [
          {
            "node": "UGCRobo - Video AI Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "UGCRobo - 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
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Create Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video": {
      "main": [
        [
          {
            "node": "Wait 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 2": {
      "main": [
        [
          {
            "node": "Get Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 3": {
      "main": [
        [
          {
            "node": "Get Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If ": {
      "main": [
        [
          {
            "node": "UGCRobo - Video AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Combine Clips",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Final Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Bot ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bot ID": {
      "main": [
        [
          {
            "node": "Get Img Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UGCRobo - Video AI Agent": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UGCRobo - Image AI Agent": {
      "main": [
        [
          {
            "node": "Create Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Img Path": {
      "main": [
        [
          {
            "node": "Describe Img",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Describe Img": {
      "main": [
        [
          {
            "node": "In Progress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "In Progress": {
      "main": [
        [
          {
            "node": "UGCRobo - Image AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output 1": {
      "ai_outputParser": [
        [
          {
            "node": "UGCRobo - Video AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output 2": {
      "ai_outputParser": [
        [
          {
            "node": "UGCRobo - Image AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Create Image": {
      "main": [
        [
          {
            "node": "Wait 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image": {
      "main": [
        [
          {
            "node": "If ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Clips": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Final Video": {
      "main": [
        [
          {
            "node": "If 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If 2": {
      "main": [
        [
          {
            "node": "Send Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "56fabda1-7b44-4d47-983d-999c45557c07",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodeGroups": [],
  "id": "cw42TZYqRPl5dhpi",
  "tags": []
}

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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

UGC Automation. Uses toolThink, lmChatOpenAi, httpRequest, telegram. Event-driven trigger; 31 nodes.

Source: https://github.com/austinkyle/ugc-ad-automation/blob/main/workflow/reference/ugc-automation-v1.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.

OpenAI, HTTP Request, Form Trigger +7
AI & RAG

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.

@Blotato/N8N Nodes Blotato, Google Sheets, OpenAI Chat +9
AI & RAG

RAG CHATBOT Main. Uses telegram, telegramTrigger, lmChatOpenAi, n8n-nodes-mcp. Event-driven trigger; 87 nodes.

Telegram, Telegram Trigger, OpenAI Chat +8
AI & RAG

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.

Telegram, Agent Tool, Telegram Trigger +5
AI & RAG

Product to Social Video (xCodeWraith Edition). Uses telegram, agentTool, telegramTrigger, httpRequest. Event-driven trigger; 83 nodes.

Telegram, Agent Tool, Telegram Trigger +5