AutomationFlowsAI & RAG › Analyze Images, Videos, Documents & Audio with Gemini Tools and Qwen LLM Agent

Analyze Images, Videos, Documents & Audio with Gemini Tools and Qwen LLM Agent

ByMauricio Perera @rckflr on n8n.io

This workflow enables multimodal file analysis using Google Gemini tools connected to a text-only LLM agent. Users can upload images, videos, audio files, or documents via a chat interface. The workflow will: Upload each file to Google Gemini and obtain an accessible URL.…

Chat trigger trigger★★★★☆ complexityAI-powered21 nodesAgentGoogle Gemini ToolChat TriggerGoogle GeminiGroq ChatMemory Buffer Window
AI & RAG Trigger: Chat trigger Nodes: 21 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #7026 — we link there as the canonical source.

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "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 \u00fatil 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\u00e9n disponibles para resolver las tareas de forma m\u00e1s eficaz. Usa estos recursos de forma aut\u00f3noma y sin pedir permiso, siempre que ayuden a dar una mejor respuesta al usuario.\n\nSi no tienes suficiente informaci\u00f3n para responder, pide los datos necesarios de forma directa. S\u00e9 proactivo, toma la iniciativa cuando sea \u00fatil y enf\u00f3cate siempre en entregar soluciones pr\u00e1cticas y comprensibles."
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "35664f34-c12c-4c39-b80d-b6a87e52ac8e",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1456,
        16
      ],
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "typeVersion": 3
    },
    {
      "id": "1d043672-c1af-4633-92aa-342117c92faf",
      "name": "Split Out Files",
      "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": "Aggregate",
      "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": "Merge",
      "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": {
          "name": "<your credential>"
        }
      },
      "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": {
          "name": "<your credential>"
        }
      },
      "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": {
          "name": "<your credential>"
        }
      },
      "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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3947d5fa-5cd6-4f17-80de-8aa86fa29df8",
      "name": "Input",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1664,
        -352
      ],
      "parameters": {
        "options": {
          "allowFileUploads": true
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "869e052e-ba3e-4795-8ad5-7787449af29b",
      "name": "If Not Files",
      "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": "Upload a file",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        -1296,
        32
      ],
      "parameters": {
        "resource": "file",
        "inputType": "binary",
        "binaryPropertyName": "=data{{$runIndex}}"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "60c8e74d-ac06-49e1-a58f-27a2b12eb5d5",
      "name": "File data",
      "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": "Update Input",
      "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": "Generate chat Input",
      "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": "Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        -928,
        -112
      ],
      "parameters": {
        "model": "qwen/qwen3-32b",
        "options": {}
      },
      "credentials": {
        "groqApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "54fcccd9-0158-4cb7-98db-1675dcf7c29c",
      "name": "Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -784,
        -112
      ],
      "parameters": {
        "contextWindowLength": 15
      },
      "typeVersion": 1.3
    },
    {
      "id": "741b7bc6-d00e-45a5-9cbd-25c163f45e4a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -528
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "height": 336,
        "content": "## Start \n"
      },
      "typeVersion": 1
    },
    {
      "id": "8f0a19e7-85aa-4dc1-8e7b-e18a83cd5d55",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -192
      ],
      "parameters": {
        "width": 816,
        "height": 448,
        "content": "## If files \n**Upload all files to Google**"
      },
      "typeVersion": 1
    },
    {
      "id": "eb97a99c-4cb3-4a57-ace9-668d8dfed1fe",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        -528
      ],
      "parameters": {
        "color": 2,
        "width": 368,
        "height": 336,
        "content": "## The real chat input "
      },
      "typeVersion": 1
    },
    {
      "id": "9fdb1af3-6e0c-4dfa-9705-e7b19fd91d84",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -528
      ],
      "parameters": {
        "color": 5,
        "width": 736,
        "height": 784,
        "content": "## The Agent \n"
      },
      "typeVersion": 1
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow enables multimodal file analysis using Google Gemini tools connected to a text-only LLM agent. Users can upload images, videos, audio files, or documents via a chat interface. The workflow will: Upload each file to Google Gemini and obtain an accessible URL.…

Source: https://n8n.io/workflows/7026/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This n8n template demonstrates how to build an AI-powered Market Research Assistant using a multi-agent workflow. It helps you get a 360-degree view of a product idea or research topic by analysing: C

Chat Trigger, Memory Buffer Window, Agent +5
AI & RAG

teste. Uses chatTrigger, agent, lmChatGroq, memoryBufferWindow. Chat trigger; 24 nodes.

Chat Trigger, Agent, Groq Chat +7
AI & RAG

pix-zap. Uses chatTrigger, agent, toolCalculator, toolWikipedia. Chat trigger; 21 nodes.

Chat Trigger, Agent, Tool Calculator +7
AI & RAG

📌 Overview This workflow automates end-to-end appointment scheduling for your business using an AI-powered chatbot. Clients can book, reschedule, or cancel meetings through a simple chat interface — n

Chat Trigger, Agent, Groq Chat +6
AI & RAG

Case 1. Uses chatTrigger, googleSheets, agent, lmChatGroq. Chat trigger; 9 nodes.

Chat Trigger, Google Sheets, Agent +4