8
n8n 中文网amn8n.com

UGC 广告创作器 ✅

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 33 个节点。主要使用 If, Set, Wait, SplitOut, Telegram 等节点。 使用 Telegram 和 GPT-4 创建 AI 生成的 UGC 营销视频

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "lsL18YoSBVPlYkNT",
  "meta": {
    "instanceId": "968a3c2b30cb09cf0a66d24d68a6bc678e7409c798216c0e83a441f6a1d3b91b",
    "templateCredsSetupCompleted": true
  },
  "name": "UGC 广告创作器 ✅",
  "tags": [],
  "nodes": [
    {
      "id": "18cf5ec0-c75b-4617-8b62-533ffdbaee0d",
      "name": "思考",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        1104,
        928
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "20bef682-886a-45ba-b066-f690ddb3b198",
      "name": "GPT",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        960,
        1168
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "kc8YMi5B68zGPUZQ",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6d167694-bfaf-4485-ad7d-93b64d20dce8",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1328,
        784
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "output.scenes"
      },
      "typeVersion": 1
    },
    {
      "id": "36c70a52-fa51-43b8-9632-fc37c4b24af8",
      "name": "创建视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1152,
        272
      ],
      "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": {
          "id": "JVHkxczNxnf3q6PE",
          "name": "Kie.ai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "05f32533-36c5-4a9d-9ddf-389eef64d03b",
      "name": "获取视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1152,
        528
      ],
      "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": {
          "id": "JVHkxczNxnf3q6PE",
          "name": "Kie.ai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "407c4985-cc86-42d5-b210-1c6f1d5faea1",
      "name": "等待 2",
      "type": "n8n-nodes-base.wait",
      "position": [
        1152,
        400
      ],
      "webhookId": "98a829fa-aa5d-451d-8ca7-7d48456636ec",
      "parameters": {
        "amount": 150
      },
      "typeVersion": 1.1
    },
    {
      "id": "66f70fcf-4d8f-47db-bc8a-8f9899ad998f",
      "name": "等待 3",
      "type": "n8n-nodes-base.wait",
      "position": [
        752,
        400
      ],
      "webhookId": "dd1ae21c-d2bc-47de-91d3-f2bb9d6648f8",
      "parameters": {
        "amount": 60
      },
      "typeVersion": 1.1
    },
    {
      "id": "fe71123a-15f5-48f8-bb0d-7021e37d33d6",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        752,
        656
      ],
      "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": "437fffa6-b829-481e-8fdf-3a81b58baaea",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1552,
        784
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "data.response.resultUrls[0]"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d1dfc560-df03-4595-80cc-f7661e0c714f",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        1552,
        400
      ],
      "webhookId": "982727e9-9948-4d33-b682-9907e053efb0",
      "parameters": {
        "amount": 100
      },
      "typeVersion": 1.1
    },
    {
      "id": "a820fe7b-2150-411e-a7cd-4262904f6e30",
      "name": "发送视频",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1808,
        784
      ],
      "webhookId": "04b7649e-ea3b-477e-868c-a6fafb406f08",
      "parameters": {
        "file": "={{ $json.video.url }}",
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "operation": "sendVideo",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "0brelqYiFL5WP9u5",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "88f15dd9-afb5-48ae-adb5-7e3a8e714395",
      "name": "Telegram 触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        32,
        784
      ],
      "webhookId": "2f42a8a1-d27c-48ba-a1ed-f00aa5497228",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "0brelqYiFL5WP9u5",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9f1cd818-1a52-4870-958b-42e9117924a7",
      "name": "机器人 ID",
      "type": "n8n-nodes-base.set",
      "position": [
        160,
        784
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "493c3932-bd76-4de4-baee-87ad3590751d",
              "name": "bot id",
              "type": "string",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "b5e1d5eb-ec40-49e0-9bfb-271f7f66f7c2",
      "name": "UGCRobo - 视频 AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1040,
        784
      ],
      "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** — 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 – 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 – 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 – 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 – 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` → stringified YAML with: dialogue, emotion, voice_type, action, character, setting, camera\n      - `aspect_ratio_video` → \"9:16\" or \"16:9\" (default vertical → 9:16)\n      - `model` → \"veo3\" or \"veo3_fast\"\n\n  T – 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": "29eb3040-687b-4977-88c7-1e1a2344fa6f",
      "name": "UGCRobo - 图像 AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        736,
        784
      ],
      "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** — 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 – Ask:\n    Generate **image generation instructions only** for AI models based on the user’s 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 – 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 – Examples:\n    🟢 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    🔴 bad_examples:\n      - Altering or fabricating product packaging text\n\n  ---\n\n  N – Notation:\n    - Final output is an object containing only:\n      - `image_prompt` → stringified YAMLy\n      - `aspect_ratio_image` → \"3:2\" or \"2:3\" (default vertical → 2:3)\n\n  ---\n\n  T – 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
    },
    {
      "id": "cb0999cf-be76-4f79-9a24-dd49baa985cd",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        640
      ],
      "parameters": {
        "color": 7,
        "width": 624,
        "height": 224,
        "content": "# 输入:"
      },
      "typeVersion": 1
    },
    {
      "id": "8bf490d9-9267-42bd-ba31-8c152fbd57f8",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 224,
        "content": "# 步骤 1:"
      },
      "typeVersion": 1
    },
    {
      "id": "47c80d84-6680-4b5e-a6e2-7293a4a72d80",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 224,
        "content": "# 步骤 2:"
      },
      "typeVersion": 1
    },
    {
      "id": "a4a4987a-1348-4b12-9c05-7010f4b1afb9",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 224,
        "content": "# 步骤 3:"
      },
      "typeVersion": 1
    },
    {
      "id": "eaa73e3c-c53c-422d-a4a3-2ec6d32f8c55",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1760,
        640
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 224,
        "content": "# 输出:"
      },
      "typeVersion": 1
    },
    {
      "id": "6b14c400-e1f2-406a-b353-cbd3e77d3cc8",
      "name": "获取图片路径",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        272,
        784
      ],
      "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": "cf96d9f4-b626-408e-9a7d-ebb4095d67f4",
      "name": "描述图片",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        384,
        784
      ],
      "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": {
          "id": "kc8YMi5B68zGPUZQ",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "94cd0b0c-23aa-473e-bcd3-7d3bb1dcb7d5",
      "name": "进行中",
      "type": "n8n-nodes-base.telegram",
      "position": [
        496,
        784
      ],
      "webhookId": "19fe1268-57bd-4581-ac8c-c862e6263316",
      "parameters": {
        "text": "Got it! I'm now creating your video...",
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "0brelqYiFL5WP9u5",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6fe29e1e-09c6-46c3-bcc6-5c0742b64c3f",
      "name": "结构化输出 1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1216,
        928
      ],
      "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": "c326efbc-cd63-4916-9154-fdb9a3920fb4",
      "name": "结构化输出 2",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        688,
        928
      ],
      "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": "ac614b60-623d-4d99-81ba-aeb53a6f4896",
      "name": "创建图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        752,
        272
      ],
      "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": {
          "id": "JVHkxczNxnf3q6PE",
          "name": "Kie.ai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1fe43481-ce50-4672-8b27-99a7b58f323b",
      "name": "获取图像",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        752,
        528
      ],
      "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": {
          "id": "JVHkxczNxnf3q6PE",
          "name": "Kie.ai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "fa3ab6e4-ad6b-4518-8a70-9f7a54227a50",
      "name": "合并片段",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1552,
        272
      ],
      "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": {
          "id": "YNGfdvlUgXAdpYmm",
          "name": "fal.ai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2341643e-778b-4361-bbc2-ca1ba2226a71",
      "name": "获取最终视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1552,
        528
      ],
      "parameters": {
        "url": "={{ $('Combine Clips').first().json.response_url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "YNGfdvlUgXAdpYmm",
          "name": "fal.ai"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "265c62c2-98e3-4aac-9b69-e3986aac08d5",
      "name": "条件判断 2",
      "type": "n8n-nodes-base.if",
      "position": [
        1552,
        656
      ],
      "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": "7e9731c2-480e-449d-ad75-c28489b44957",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "color": 4,
        "width": 2000,
        "height": 192,
        "content": "# 无限 UGC 创作器 - 任意长度,任意角色"
      },
      "typeVersion": 1
    },
    {
      "id": "8a84ab5a-1aaf-4b7a-934a-2d6e45d5e5c9",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        224
      ],
      "parameters": {
        "height": 672,
        "content": "用于更好创作的提示词,您可以扩展到任意数量的场景"
      },
      "typeVersion": 1
    },
    {
      "id": "b66f59fe-a510-458d-adad-eff0f509f6d8",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2032,
        16
      ],
      "parameters": {
        "width": 688,
        "height": 1328,
        "content": "📌 如何设置 AI UGC 视频自动化系统"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "dc319d14-152c-4a75-8802-f4ed8757c9a5",
  "connections": {
    "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
          }
        ]
      ]
    },
    "If ": {
      "main": [
        [
          {
            "node": "UGCRobo - 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": "UGCRobo - Video AI Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "UGCRobo - 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": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Create Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "In Progress": {
      "main": [
        [
          {
            "node": "UGCRobo - 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
          }
        ]
      ]
    },
    "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
          }
        ]
      ]
    },
    "UGCRobo - Image AI Agent": {
      "main": [
        [
          {
            "node": "Create Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UGCRobo - Video AI Agent": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 内容创作, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量33
分类2
节点类型14
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者

I am an AI adviser and builder specializing in creating intelligent workflows with n8n. With a focus on integrating AI into everyday business processes, I help companies streamline operations, automate complex tasks, and unlock new growth opportunities through smart automation.

外部链接
在 n8n.io 查看

分享此工作流