使用Google Gemini AI分析视频 - 表单上传和YouTube链接
中级
这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 Set, Wait, FormTrigger, HttpRequest, ManualTrigger 等节点。 使用Google Gemini AI分析视频 - 表单上传和YouTube链接
前置要求
- •可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "9f2d25c77f55013c8efee3de456573aadd7369e6f0aaea70d0311a32c92bead1"
},
"nodes": [
{
"id": "608b8d6d-3abc-4a53-aa81-5b6b13d9a874",
"name": "获取分析",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
736,
304
],
"parameters": {
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent",
"method": "POST",
"options": {},
"jsonBody": "={\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"fileData\": {\n \"fileUri\": \"{{ $json.file.uri }}\",\n \"mimeType\": \"{{ $json.file.mimeType }}\"\n }\n },\n {\n \"text\": \"Describe what's going on in the video in great detail. Describe the entire video.\"\n }\n ]\n }\n ]\n}\n",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "cfeadae7-65d6-4b79-823e-8db5024fac25",
"name": "上传文件",
"type": "n8n-nodes-base.httpRequest",
"position": [
960,
64
],
"parameters": {
"url": "https://generativelanguage.googleapis.com/upload/v1beta/files",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "binaryData",
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"headerParameters": {
"parameters": [
{
"name": "X-Goog-Upload-Command",
"value": "start, upload, finalize"
},
{
"name": "X-Goog-Upload-Header-Content-Length",
"value": "={{ $binary.Video.fileSize }}"
},
{
"name": "X-Goog-Upload-Header-Content-Type",
"value": "={{ $binary.Video.fileType }}/{{ $binary.Video.fileExtension }}"
},
{
"name": "Content-Type",
"value": "={{ $binary.Video.fileType }}/{{ $binary.Video.fileExtension }}"
}
]
},
"inputDataFieldName": "Video"
},
"typeVersion": 4.2
},
{
"id": "89df5f59-2806-42dd-aa6e-7d5e1d6a0f07",
"name": "5 秒",
"type": "n8n-nodes-base.wait",
"position": [
976,
304
],
"webhookId": "2ae152a3-3b31-497a-b285-8a19a7933c07",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "5150add7-edf5-49ca-92f9-385efcf8184b",
"name": "表单提交时",
"type": "n8n-nodes-base.formTrigger",
"position": [
720,
64
],
"webhookId": "d5b07e65-1bc8-4d57-9c91-e3f7531dbd08",
"parameters": {
"options": {},
"formTitle": "Insert Video",
"formFields": {
"values": [
{
"fieldType": "file",
"fieldLabel": "Video",
"multipleFiles": false,
"requiredField": true
}
]
},
"formDescription": "Drop in a video for analysis."
},
"typeVersion": 2.2
},
{
"id": "2e6a1e17-a406-485f-b5d6-2f1bbee090af",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
672,
0
],
"parameters": {
"color": 7,
"width": 220,
"height": 220,
"content": "## 表单触发器"
},
"typeVersion": 1
},
{
"id": "b8fc011e-f9da-4729-a88e-b1dcd4745a0b",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
912,
0
],
"parameters": {
"color": 4,
"width": 220,
"height": 220,
"content": "## 上传文件"
},
"typeVersion": 1
},
{
"id": "ccba1069-f0fd-48e5-ab15-467142b72d02",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
688,
240
],
"parameters": {
"color": 5,
"width": 220,
"height": 220,
"content": "## 获取分析"
},
"typeVersion": 1
},
{
"id": "526c98ac-9783-4abd-aa31-ee9a14fe32a4",
"name": "等待",
"type": "n8n-nodes-base.wait",
"position": [
1200,
64
],
"webhookId": "bf2e644e-b6de-463f-938b-71c42da94efe",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "4996040a-b998-4eef-8a5a-3c4c316ed546",
"name": "视频分析",
"type": "n8n-nodes-base.set",
"position": [
1200,
304
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "268682ab-62a0-4e6f-aea0-652b30325f70",
"name": "Video Analysis",
"type": "string",
"value": "={{ $json.candidates[0].content.parts[0].text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "8d6f60d5-6063-41e3-b0b8-b5cc0076b313",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1136,
240
],
"parameters": {
"color": 5,
"width": 220,
"height": 220,
"content": "## 结果"
},
"typeVersion": 1
},
{
"id": "15f412e3-5958-4d8d-abab-7c7da62382fd",
"name": "当点击\"测试工作流\"时",
"type": "n8n-nodes-base.manualTrigger",
"disabled": true,
"position": [
736,
608
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0cb0b756-1657-4c32-b9e0-63580319fe0a",
"name": "YouTube 视频",
"type": "n8n-nodes-base.httpRequest",
"position": [
960,
608
],
"parameters": {
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent",
"method": "POST",
"options": {},
"jsonBody": "{\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"Please summarize the video in 3 sentences.\"\n },\n {\n \"file_data\": {\n \"file_uri\": \"https://youtu.be/gwCQF--cARA?si=uCbaUnoRlEjHO50a\"\n }\n }\n ]\n }\n ]\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth"
},
"typeVersion": 4.2
},
{
"id": "ffa376e6-4c1b-400e-8ead-98e7e5a6f8d2",
"name": "获取结果",
"type": "n8n-nodes-base.set",
"position": [
1168,
608
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "2103b25e-fbee-4d71-9224-280f1c2383da",
"name": "text",
"type": "string",
"value": "={{ $json.candidates[0].content.parts[0].text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b838e099-4651-4561-92e1-36b856a50f06",
"name": "## 试试看!",
"type": "n8n-nodes-base.stickyNote",
"position": [
672,
528
],
"parameters": {
"color": 2,
"width": 688,
"height": 260,
"content": "# YouTube 视觉"
},
"typeVersion": 1
},
{
"id": "7ae7e8a0-69ee-48a1-81a4-ef53af8805cb",
"name": "GET 模型",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
0
],
"parameters": {
"width": 640,
"height": 800,
"content": "# 🛠️ 设置指南"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Wait": {
"main": [
[
{
"node": "Get Analysis",
"type": "main",
"index": 0
}
]
]
},
"5 seconds": {
"main": [
[
{
"node": "Get Analysis",
"type": "main",
"index": 0
}
]
]
},
"Get Analysis": {
"main": [
[
{
"node": "Video Analysis",
"type": "main",
"index": 0
}
],
[
{
"node": "5 seconds",
"type": "main",
"index": 0
}
]
]
},
"Upload File ": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"YouTube Video": {
"main": [
[
{
"node": "Get Results",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Upload File ",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "YouTube Video",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 内容创作, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用OpenAI、RunwayML和ElevenLabs自动化无脸短视频
使用OpenAI、RunwayML和ElevenLabs自动化无脸短视频:从脚本到社交媒体
Set
Code
Wait
+18
56 节点LeeWei
内容创作
使用AI、Hedra和ElevenLabs生成病毒式婴儿名人播客
使用AI、Hedra和ElevenLabs生成病毒式婴儿名人播客
Code
Wait
Merge
+11
35 节点LeeWei
内容创作
使用 OpenAI、ElevenLabs 和 Fal.ai 自动化病毒式内容创作,适用于视频、播客和 ASMR
使用 OpenAI、ElevenLabs 和 Fal.ai 自动化病毒式内容创作,适用于视频、播客和 ASMR
Set
Code
Wait
+16
97 节点Adam Crafts
内容创作
使用 OpenAI、QuickChart 和 Google Drive 将电子表格数据转换为智能图表
使用 OpenAI、QuickChart 和 Google Drive 将电子表格数据转换为智能图表
If
Set
Code
+18
82 节点LeeWei
内容创作
Recap AI - Veo 3.1 电商产品动画生成器
基于Veo 3.1的电商产品目录AI视频生成器
If
Set
Wait
+10
18 节点Lucas Walter
内容创作
AI驱动的产品视频生成器 (Foreplay + Gemini + Sora 2)
基于Foreplay、Gemini和Sora 2的AI驱动产品视频生成器
Set
Wait
Switch
+8
18 节点Fahmi Fahreza
内容创作