8
n8n 中文网amn8n.com

08 - AI视频生成

中级

这是一个Content Creation, Miscellaneous, Multimodal AI领域的自动化工作流,包含 14 个节点。主要使用 If, Wait, Gmail, HttpRequest, ScheduleTrigger 等节点。 使用OpenAI、Veo 3和Gmail为任何主题创建短视频

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "PLACEHOLDER_WORKFLOW_ID",
  "meta": {
    "instanceId": "PLACEHOLDER_INSTANCE_ID",
    "templateCredsSetupCompleted": true
  },
  "name": "08 - AI 视频生成",
  "tags": [
    {
      "id": "PLACEHOLDER_TAG_ID",
      "name": "Sample Tag",
      "createdAt": "2025-09-08T06:03:03.283Z",
      "updatedAt": "2025-09-08T06:03:03.283Z"
    }
  ],
  "nodes": [
    {
      "id": "ae08743a-ff04-4daf-85fc-a8c91dcb8c34",
      "name": "状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        896,
        736
      ],
      "parameters": {
        "url": "=https://generativelanguage.googleapis.com/v1beta/{{ $json.name }}",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d25f07e3-e6bf-4973-94ba-d90fd3eff5ab",
      "name": "发送消息",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1712,
        720
      ],
      "webhookId": "WEBHOOK_ID_PLACEHOLDER",
      "parameters": {
        "sendTo": "YOUR_EMAIL_HERE",
        "message": "=Description:{{ $json.message.content }}",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {}
            ]
          }
        },
        "subject": "The video is ready to share on social media."
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "GMAIL_CREDENTIAL_ID",
          "name": "Gmail Account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "1bfc7578-fe4a-4028-b442-bce9be1f9d8c",
      "name": "社交媒体描述",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        160,
        432
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "={\n  \"prompt\": \"You are a social media content assistant. Take the following 8-second financial news script and create an engaging, SEO-friendly social media description suitable for LinkedIn, Instagram, and YouTube. The description should summarize the key points of the script, be concise, and written in a professional yet approachable tone. Include relevant hashtags for finance, stock market, and trading trends. Make it attention-grabbing to encourage viewers to watch the video. Keep the description between 50-150 words. Here is the script: {{ $json.message.content }}\"\n}\n"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "OPENAI_CREDENTIAL_ID",
          "name": "OpenAI Account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "e21f4324-6f82-453d-96db-12d7ea124cdf",
      "name": "生成新闻脚本",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -256,
        592
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "={\n  \"prompt\": \"You are a financial news assistant. Create an 8-second spoken-style script that delivers the latest globally trending stock market and trading news. Focus on the most impactful and recent global market movements such as major index shifts (S&P 500, Nasdaq, Dow Jones, FTSE, Nikkei), commodities (oil, gold), forex, or crypto. The script should be concise, engaging, and easy for a general audience to understand. Keep the tone urgent and informative, suitable for a quick news reel. Limit output to 3-4 short sentences, no bullet points.\"\n}\n"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "OPENAI_CREDENTIAL_ID",
          "name": "OpenAI Account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "21f202fd-c92f-4adb-944d-3a791af6edcc",
      "name": "生成 Veo3 提示词",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        160,
        736
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "={\n  \"prompt\": \"You are a video prompt generator for Veo 3. Convert the following financial news script into a clear, descriptive video generation prompt. The goal is to help Veo 3 create an engaging 8-second news-style video. Translate the spoken script into visuals: describe a professional news anchor, newsroom or studio setting, relevant background visuals (stock tickers, charts, global maps, trading floors), and overall mood (urgent, professional, engaging). Ensure the prompt is cinematic, easy for Veo 3 to understand, and matches the script's content and tone. Do not repeat the script text, only describe the visuals and style. Here is the script:{{ $json.message.content }} \"\n}\n"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "OPENAI_CREDENTIAL_ID",
          "name": "OpenAI Account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "e34f64e6-eb4d-4ac4-8897-65bce3e05800",
      "name": "创建视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        496,
        736
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/veo-3.0-fast-generate-preview:predictLongRunning",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"instances\": [\n    { \"prompt\":{{ $json.message.content }}  }\n  ],\n  \"parameters\": { \"aspectRatio\": \"16:9\" }\n}",
        "sendBody": true,
        "sendQuery": true,
        "specifyBody": "json",
        "queryParameters": {
          "parameters": [
            {
              "name": "key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "37ad9efc-e986-46c8-ae27-ea51c7135c1b",
      "name": "等待视频",
      "type": "n8n-nodes-base.wait",
      "position": [
        704,
        736
      ],
      "webhookId": "WEBHOOK_ID_PLACEHOLDER",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "efb7c8d0-2177-4864-acdf-bc7cbe69d193",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        1136,
        736
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a978781f-9dfc-4220-8b30-aafa1d6b9f6f",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.done }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cb6f8d34-5b14-4c30-9a75-47c4a78d97b6",
      "name": "下载视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1408,
        720
      ],
      "parameters": {
        "url": "={{ $json.response.generateVideoResponse.generatedSamples[0].video.uri }}",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e5bcc0b4-ae94-4c1b-bead-7e748dffcb3f",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        272
      ],
      "parameters": {
        "width": 320,
        "height": 720,
        "content": "## 步骤 1:触发工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "6130da6c-80d7-45a6-9d5b-1e1355bf2b54",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        272
      ],
      "parameters": {
        "color": 4,
        "width": 752,
        "height": 720,
        "content": "## 步骤 2:生成内容"
      },
      "typeVersion": 1
    },
    {
      "id": "d8aa7775-279f-40a8-9c47-f4eebd044bf4",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        272
      ],
      "parameters": {
        "color": 3,
        "width": 816,
        "height": 720,
        "content": "## 步骤 3:生成视频"
      },
      "typeVersion": 1
    },
    {
      "id": "403a21d2-0fe9-4d13-b187-bd321b5effea",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        272
      ],
      "parameters": {
        "color": 6,
        "width": 560,
        "height": 720,
        "content": "## 步骤 4:下载并分享视频"
      },
      "typeVersion": 1
    },
    {
      "id": "942eb771-663a-4109-bb45-fba71caf29fa",
      "name": "每日触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -480,
        592
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "PLACEHOLDER_VERSION_ID",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Download Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait for Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video": {
      "main": [
        [
          {
            "node": "Wait for Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Trigger": {
      "main": [
        [
          {
            "node": "Generate News Script",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Video": {
      "main": [
        [
          {
            "node": "Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate News Script": {
      "main": [
        [
          {
            "node": "Generate Veo3 Prompt",
            "type": "main",
            "index": 0
          },
          {
            "node": "Social Media Description",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Veo3 Prompt": {
      "main": [
        [
          {
            "node": "Create Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Social Media Description": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 内容创作, 杂项, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
中级
节点数量14
分类3
节点类型7
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Avkash Kakdiya

Avkash Kakdiya

@itechnotion

🚀 Founder of iTechNotion — we build custom AI-powered automation workflows for startups, agencies, and founders. 💡 Specializing in agentic AI systems, content automation, sales funnels, and digital workers. 🔧 14+ years in tech | Building scalable no-code/low-code solutions using n8n, OpenAI, and other API-first tools. 📬 Let’s automate what slows you down.

外部链接
在 n8n.io 查看

分享此工作流