8
n8n 中文网amn8n.com

Gemini工具与Qwen LLM代理的多媒体分析

高级

这是一个Document Extraction, AI Chatbot领域的自动化工作流,包含 21 个节点。主要使用 If, Set, Merge, SplitOut, Aggregate 等节点。 使用Gemini工具和Qwen LLM代理分析图像、视频、文档和音频

前置要求
  • 无特殊前置要求,导入即可使用
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "8396a2c42d7edc37401c19b3909f25edcb0e4a6dc3914c824fddd73a329a575c",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "904a709d-dc85-439f-8e72-f77cc8764f62",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -720,
        -352
      ],
      "parameters": {
        "options": {
          "systemMessage": "Eres un asistente útil y confiable. Tu objetivo principal es responder de forma clara, concreta y breve a las consultas del usuario.\n\nPuedes apoyarte en funciones o herramientas externas cuando estén disponibles para resolver las tareas de forma más eficaz. Usa estos recursos de forma autónoma y sin pedir permiso, siempre que ayuden a dar una mejor respuesta al usuario.\n\nSi no tienes suficiente información para responder, pide los datos necesarios de forma directa. Sé proactivo, toma la iniciativa cuando sea útil y enfócate siempre en entregar soluciones prácticas y comprensibles."
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "35664f34-c12c-4c39-b80d-b6a87e52ac8e",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1456,
        16
      ],
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "typeVersion": 3
    },
    {
      "id": "1d043672-c1af-4633-92aa-342117c92faf",
      "name": "分离文件",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -1648,
        16
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {
          "includeBinary": true,
          "destinationFieldName": "=files"
        },
        "fieldToSplitOut": "=files"
      },
      "executeOnce": false,
      "typeVersion": 1
    },
    {
      "id": "45ee1755-7d8b-4eb4-8ce2-cc1fc6bf8220",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1296,
        -128
      ],
      "parameters": {
        "options": {
          "includeBinaries": false
        },
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "file"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "13164f95-7fdf-437c-a3c0-d8f1b9f0a6b5",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1280,
        -352
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "828c6081-9420-42b6-9f78-0c6dbdbf5c33",
      "name": "IMG",
      "type": "@n8n/n8n-nodes-langchain.googleGeminiTool",
      "position": [
        -656,
        -112
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text_Input', ``, 'string') }}",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemma-3-27b-it",
          "cachedResultName": "models/gemma-3-27b-it"
        },
        "options": {},
        "resource": "image",
        "imageUrls": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL_s_', ``, 'string') }}",
        "operation": "analyze",
        "descriptionType": "manual",
        "toolDescription": "Analyze image in Google Gemini"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YRMp3GqYOBMNJvBe",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ec27fa16-9ee7-44db-84c2-58b864da4ef6",
      "name": "VIDEO",
      "type": "@n8n/n8n-nodes-langchain.googleGeminiTool",
      "position": [
        -560,
        -112
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text_Input', ``, 'string') }}",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.0-flash-lite",
          "cachedResultName": "models/gemini-2.0-flash-lite"
        },
        "options": {},
        "resource": "video",
        "operation": "analyze",
        "videoUrls": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL_s_', ``, 'string') }}",
        "descriptionType": "manual",
        "toolDescription": "Analyze video in Google Gemini"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YRMp3GqYOBMNJvBe",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c5bd84b4-aad1-4e25-819f-8a02bccfdc8e",
      "name": "AUDIO",
      "type": "@n8n/n8n-nodes-langchain.googleGeminiTool",
      "position": [
        -464,
        -112
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text_Input', ``, 'string') }}",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.0-flash-lite",
          "cachedResultName": "models/gemini-2.0-flash-lite"
        },
        "options": {},
        "resource": "audio",
        "audioUrls": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL_s_', ``, 'string') }}",
        "operation": "analyze",
        "descriptionType": "manual",
        "toolDescription": "Analyze audio in Google Gemini"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YRMp3GqYOBMNJvBe",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1e54b2fb-241e-44fb-8b69-e79bea324399",
      "name": "DOCUMENT",
      "type": "@n8n/n8n-nodes-langchain.googleGeminiTool",
      "position": [
        -352,
        -112
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text_Input', ``, 'string') }}",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.0-flash-lite",
          "cachedResultName": "models/gemini-2.0-flash-lite"
        },
        "options": {},
        "resource": "document",
        "documentUrls": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL_s_', ``, 'string') }}",
        "descriptionType": "manual",
        "toolDescription": "Analyze document in Google Gemini"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YRMp3GqYOBMNJvBe",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3947d5fa-5cd6-4f17-80de-8aa86fa29df8",
      "name": "输入",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1664,
        -352
      ],
      "webhookId": "2c774c20-3be1-429c-a9b6-86ca7cf2dcf9",
      "parameters": {
        "options": {
          "allowFileUploads": true
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "869e052e-ba3e-4795-8ad5-7787449af29b",
      "name": "如果不是文件",
      "type": "n8n-nodes-base.if",
      "position": [
        -1504,
        -352
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e3475200-6983-492f-b08d-ca1c40f9e4a5",
              "operator": {
                "type": "array",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.files }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cf62126c-3a4d-42ef-93c9-bc45d3e9a71d",
      "name": "上传文件",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        -1296,
        32
      ],
      "parameters": {
        "resource": "file",
        "inputType": "binary",
        "binaryPropertyName": "=data{{$runIndex}}"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YRMp3GqYOBMNJvBe",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "60c8e74d-ac06-49e1-a58f-27a2b12eb5d5",
      "name": "文件数据",
      "type": "n8n-nodes-base.set",
      "position": [
        -1152,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c51e91b2-0bc3-41f7-ad20-6553a1f16a4f",
              "name": "file.url",
              "type": "string",
              "value": "={{ $json.fileUri }}"
            },
            {
              "id": "898419e5-f238-464c-abec-9410e0709bc8",
              "name": "file.name",
              "type": "string",
              "value": "={{ $('Split Out Files').item.json.files.fileName }}"
            },
            {
              "id": "4c088e7c-ed7c-48df-a448-e6107ca58fd9",
              "name": "mimeType",
              "type": "string",
              "value": "={{ $json.mimeType }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "781c5dfc-fb88-4493-af59-c87edb0c2e8d",
      "name": "更新输入",
      "type": "n8n-nodes-base.set",
      "position": [
        -1152,
        -128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1fba2a0e-8f8f-422d-8b3d-2ce9aba9718a",
              "name": "files",
              "type": "array",
              "value": "={{ $json.file }}"
            },
            {
              "id": "264f9f25-ab51-481d-b1b0-68fc63297d79",
              "name": "",
              "type": "string",
              "value": ""
            },
            {
              "id": "54da9062-5aef-4f1e-baf0-f2ea57864aef",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $('Input').item.json.sessionId }}"
            },
            {
              "id": "dac98866-efeb-4fa3-af76-adf282ee6b29",
              "name": "action",
              "type": "string",
              "value": "={{ $('Input').item.json.action }}"
            },
            {
              "id": "34e03f34-f3d9-4eb3-8171-d47b0c276ef1",
              "name": "chatInput",
              "type": "string",
              "value": "={{ $('Input').item.json.chatInput }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "178a32a0-206f-4af5-803f-6114a23c0303",
      "name": "生成聊天输入",
      "type": "n8n-nodes-base.set",
      "position": [
        -1120,
        -352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88fdb9fb-e003-498e-98f8-9e8fcde8dd53",
              "name": "chatInput",
              "type": "string",
              "value": "={{ $json.chatInput }}\n{{ $json.files ? 'Media: ' + $json.files.toJsonString() : '' }}"
            },
            {
              "id": "8274ca7b-69b9-4b46-beb4-a8e11198c488",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $json.sessionId }}"
            },
            {
              "id": "048b0f23-3d57-4056-b813-7ee8c25522fd",
              "name": "action",
              "type": "string",
              "value": "={{ $json.action }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "13f5e189-ccf8-461f-9aa8-9d9b45b5352d",
      "name": "模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        -928,
        -112
      ],
      "parameters": {
        "model": "qwen/qwen3-32b",
        "options": {}
      },
      "credentials": {
        "groqApi": {
          "id": "G6oCe97EbDiUJGyC",
          "name": "Groq account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "54fcccd9-0158-4cb7-98db-1675dcf7c29c",
      "name": "记忆存储",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -784,
        -112
      ],
      "parameters": {
        "contextWindowLength": 15
      },
      "typeVersion": 1.3
    },
    {
      "id": "741b7bc6-d00e-45a5-9cbd-25c163f45e4a",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -528
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "height": 336,
        "content": "## 开始"
      },
      "typeVersion": 1
    },
    {
      "id": "8f0a19e7-85aa-4dc1-8e7b-e18a83cd5d55",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -192
      ],
      "parameters": {
        "width": 816,
        "height": 448,
        "content": "## 如果有文件"
      },
      "typeVersion": 1
    },
    {
      "id": "eb97a99c-4cb3-4a57-ace9-668d8dfed1fe",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        -528
      ],
      "parameters": {
        "color": 2,
        "width": 368,
        "height": 336,
        "content": "## 真实聊天输入"
      },
      "typeVersion": 1
    },
    {
      "id": "9fdb1af3-6e0c-4dfa-9705-e7b19fd91d84",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -528
      ],
      "parameters": {
        "color": 5,
        "width": 736,
        "height": 784,
        "content": "## 智能体"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "IMG": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AUDIO": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Input": {
      "main": [
        [
          {
            "node": "If Not Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Generate chat Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "VIDEO": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "DOCUMENT": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Update Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "File data": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Not Files": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Split Out Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Input": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Upload a file": {
      "main": [
        [
          {
            "node": "File data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload a file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Files": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate chat Input": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 文档提取, AI 聊天机器人

需要付费吗?

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

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

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

作者
Mauricio Perera

Mauricio Perera

@rckflr

Automation consultant with over 10 years of experience specializing in AI, no-code, and workflow optimization. I’ve delivered tailored AI and NLP solutions across real estate, healthcare, and more, enhancing efficiency and customer experiences. Proficient in tools like Make, Airtable, and Zapier, I also integrate GPT models to create scalable, innovative automations. Contact me to discuss custom n8n workflows or advanced automations to streamline your processes.

外部链接
在 n8n.io 查看

分享此工作流