8
n8n 中文网amn8n.com

广告视频生成器

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 20 个节点。主要使用 If, Set, Wait, Telegram, HttpRequest 等节点。 利用Telegram和Gemini,通过Kie.ai的Veo3.1 API实现无缝集成

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "MBRhvliMi5xlWUlx",
  "meta": {
    "instanceId": "7f9905f3b9fa1f8e9067942d39545bd5ebc4f8d5708704da67789fbda9e791d7",
    "templateCredsSetupCompleted": true
  },
  "name": "广告视频生成器",
  "tags": [],
  "nodes": [
    {
      "id": "f89797fa-685e-412e-b186-b117c353d15e",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        208,
        -416
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "dcLzqJ0anvB782nu",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0fbdf6cb-a5a9-42fd-ada3-537d57e1c53b",
      "name": "接收消息",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -384,
        -544
      ],
      "webhookId": "81a497f1-32b6-4db0-aa84-850c32551e95",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "30g8OVx09FW7rRSM",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "684d32b1-f04f-42fb-a11c-5a67ca378ae3",
      "name": "提取图片和标题",
      "type": "n8n-nodes-base.set",
      "position": [
        -160,
        -544
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3911fb54-cca0-43bb-9482-c6da7641dc92",
              "name": "message.caption",
              "type": "string",
              "value": "={{ $json.message.caption }}"
            },
            {
              "id": "4edb62f8-7aa3-4a96-b0a2-2dfc702e0d45",
              "name": "message.photo[3].file_id",
              "type": "string",
              "value": "={{ $json.message.photo[2].file_id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bacc3d5a-7b28-46a9-bdd7-57b6089ad91b",
      "name": "下载 Telegram 图片",
      "type": "n8n-nodes-base.telegram",
      "position": [
        64,
        -544
      ],
      "webhookId": "310b5f86-fa8f-46e9-8a3d-573fe949266e",
      "parameters": {
        "fileId": "={{ $json.message.photo[3].file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "30g8OVx09FW7rRSM",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fb4a2389-db12-4cf3-9134-90e7d8a54165",
      "name": "生成脚本",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        224,
        -544
      ],
      "parameters": {
        "text": "=Follow System Message",
        "options": {
          "systemMessage": "=You are a professional UGC ad scriptwriter. \nGenerate a 30-second UGC-style video script for Instagram Reels or TikTok \nthat sounds authentic, friendly, and relatable. \nIt should describe the product in a natural human tone, like a real person \nsharing their experience.\n\nProduct details:\n{{ $('Extract Image & Caption').item.json.message.caption }}\n{{ $json.result.file_path }}\n\nIf possible, mention benefits, sensory details, and an emotional payoff. \nEnd with a short, clear call to action like \"link in bio\" or \"try it yourself\".\n"
        },
        "promptType": "define"
      },
      "typeVersion": 3
    },
    {
      "id": "2c512f38-67d3-4c3f-a8b6-6a5fe8f6ecfe",
      "name": "创建视频生成任务",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        800,
        -544
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/veo/generate",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $('Generate Script').item.json.output }}"
            },
            {
              "name": "imageUrls",
              "value": "={{ $json.data.downloadUrl }}"
            },
            {
              "name": "model",
              "value": "veo3_fast"
            },
            {
              "name": "aspectRatio",
              "value": "9:16"
            },
            {
              "name": "seeds",
              "value": "12345"
            },
            {
              "name": "enableFallback",
              "value": "false"
            },
            {
              "name": "enableTranslation",
              "value": "true"
            },
            {
              "name": "generationType",
              "value": "TEXT_2_VIDEO"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <TOKEN>"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "745edc27-4b5e-4ce2-a629-636448cea7da",
      "name": "视频是否就绪?",
      "type": "n8n-nodes-base.if",
      "position": [
        1232,
        -688
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "48af49b6-272a-41d6-bc92-af8aaa2d4dd5",
              "operator": {
                "type": "number",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.completeTime }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "47a51398-cf01-4e8a-8489-60931fbc2fb9",
      "name": "等待30秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        1440,
        -704
      ],
      "webhookId": "1958d2df-5d70-4c70-b4dc-a34bee3bc94e",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "cbb402a4-bf3c-4312-892d-c833972f44dc",
      "name": "获取高清视频 URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1488,
        -352
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/veo/get-1080p-video",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": " taskId",
              "value": "={{ $json.data.taskId }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <TOKEN>"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "dc079bec-5a2e-4b0c-a009-73799d99d3fc",
      "name": "下载生成的视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1664,
        -352
      ],
      "parameters": {
        "url": "={{ $('Check Video Status').item.json.data.response.resultUrls[0] }}",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "f27ca815-8a24-4d06-9d43-49444c8edc19",
      "name": "发送视频给用户",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1840,
        -352
      ],
      "webhookId": "1b38fa9e-79f5-4b18-98ce-92865e0c0c06",
      "parameters": {
        "chatId": "={{ $('Receive Message').item.json.message.chat.id }}",
        "operation": "sendVideo",
        "binaryData": true,
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "30g8OVx09FW7rRSM",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "18a58bee-1516-49a2-8e42-eea638feca20",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -688
      ],
      "parameters": {
        "color": 3,
        "width": 272,
        "height": 416,
        "content": "## 📝 生成脚本"
      },
      "typeVersion": 1
    },
    {
      "id": "431166b0-9f45-4ee8-879e-b41b95b8830c",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -720
      ],
      "parameters": {
        "color": 4,
        "width": 192,
        "height": 368,
        "content": "## ☁️ 上传到 Kie 存储"
      },
      "typeVersion": 1
    },
    {
      "id": "e40711bb-7d2f-42c9-a24c-4777ba2c6d67",
      "name": "上传图片到 Kie 存储",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        -544
      ],
      "parameters": {
        "url": "https://kieai.redpandaai.co/api/file-url-upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "fileUrl",
              "value": "=https://api.telegram.org/file/bot7759143820:AAHyXBFghzJd5OksfEmOfPYxz6THes5-c6o/{{ $('Download Telegram Image').item.json.result.file_path }}"
            },
            {
              "name": "uploadPath",
              "value": "images/downloaded"
            },
            {
              "name": "fileName",
              "value": "my-downloaded-image.jpg"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <TOKEN>"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "1f446bb2-0f14-4bd8-a372-cbb947487f9e",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -736
      ],
      "parameters": {
        "color": 7,
        "width": 192,
        "height": 384,
        "content": "## 🎥 创建视频任务"
      },
      "typeVersion": 1
    },
    {
      "id": "0cb432ee-2e9d-4338-b262-44f6219cbe8e",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        -848
      ],
      "parameters": {
        "color": 4,
        "width": 192,
        "height": 336,
        "content": "## 🛰️ 检查视频状态"
      },
      "typeVersion": 1
    },
    {
      "id": "57ca7b44-1e55-4f01-a43f-f9fd1adced3d",
      "name": "检查视频状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        -672
      ],
      "parameters": {
        "url": "https://api.kie.ai/api/v1/veo/record-info",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "taskId",
              "value": "={{ $json.data.taskId }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <TOKEN>"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "c8417ecb-fa5a-4d9e-beb1-66b0a1f09ae0",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        -816
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 272,
        "content": "## 🔄 视频状态循环"
      },
      "typeVersion": 1
    },
    {
      "id": "12f57a10-da0f-436d-8999-2b602045ff76",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        -496
      ],
      "parameters": {
        "color": 4,
        "width": 608,
        "height": 304,
        "content": "## 🎬 检索并发送视频"
      },
      "typeVersion": 1
    },
    {
      "id": "8d4cfb49-5bf7-43a0-bae2-1c7398f015c7",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -736
      ],
      "parameters": {
        "height": 352,
        "content": "## 🖼️ 提取图片和标题"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "76908e76-902b-414a-870a-60c854d05106",
  "connections": {
    "Generate Script": {
      "main": [
        [
          {
            "node": "Upload image to Kie Storage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Video Ready?": {
      "main": [
        [
          {
            "node": "Wait 30 Seconds",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get HD Video URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Message": {
      "main": [
        [
          {
            "node": "Extract Image & Caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 30 Seconds": {
      "main": [
        [
          {
            "node": "Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get HD Video URL": {
      "main": [
        [
          {
            "node": "Download Generated Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Video Status": {
      "main": [
        [
          {
            "node": "Is Video Ready?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Telegram Image": {
      "main": [
        [
          {
            "node": "Generate Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Image & Caption": {
      "main": [
        [
          {
            "node": "Download Telegram Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Generated Video": {
      "main": [
        [
          {
            "node": "Send Video to User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Script",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Upload image to Kie Storage": {
      "main": [
        [
          {
            "node": "Create Video Generation Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video Generation Task": {
      "main": [
        [
          {
            "node": "Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Parth Pansuriya

Parth Pansuriya

@parthpansuriya

I build smart and scalable automation workflows using n8n to simplify tasks, connect apps, and boost productivity. From WhatsApp bots to AI-powered systems, I create seamless automations tailored for business and creators.

外部链接
在 n8n.io 查看

分享此工作流