AutomationFlowsAI & RAG › Gemini File Search - List Documents (webhook) (http Request)

Gemini File Search - List Documents (webhook) (http Request)

Gemini File Search - List Documents (Webhook). Uses httpRequest. Webhook trigger; 4 nodes.

Webhook trigger★★★★☆ complexity4 nodesHTTP Request
AI & RAG Trigger: Webhook Nodes: 4 Complexity: ★★★★☆ Added:

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
{
  "name": "Gemini File Search - List Documents (Webhook)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "kb-list-documents",
        "responseMode": "lastNode",
        "options": {
          "responseData": "firstEntryJson"
        }
      },
      "id": "Webhook",
      "name": "Webhook /kb-list-documents",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        280,
        300
      ]
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const { apiKey, storeId } = $json;\nif (!apiKey) {\n  return [{ json: { status: 'ERROR', error: 'apiKey required' } }];\n}\nif (!storeId) {\n  return [{ json: { status: 'ERROR', error: 'storeId required' } }];\n}\nreturn [{ json: { apiKey, storeId } }];"
      },
      "id": "Validate",
      "name": "Validate Input",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        520,
        300
      ]
    },
    {
      "parameters": {
        "url": "=https://generativelanguage.googleapis.com/v1beta/{{$json.storeId}}/documents?key={{$json.apiKey}}",
        "responseFormat": "json",
        "options": {}
      },
      "id": "Http Request",
      "name": "Fetch Documents",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        760,
        300
      ],
      "notes": "Lists documents in the given File Search corpus."
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const res = $json;\nif (res.statusCode && res.statusCode !== 200) {\n  return [{ json: { status: 'ERROR', error: `Gemini returned ${res.statusCode}`, body: res.body || res } }];\n}\nconst body = res.body || res;\nreturn [{ json: { status: 'SUCCESS', documents: body.documents || body.files || [] } }];"
      },
      "id": "Return",
      "name": "Format Response",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1000,
        300
      ]
    }
  ],
  "connections": {
    "Webhook /kb-list-documents": {
      "main": [
        [
          {
            "node": "Validate Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Input": {
      "main": [
        [
          {
            "node": "Fetch Documents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Documents": {
      "main": [
        [
          {
            "node": "Format Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

Gemini File Search - List Documents (Webhook). Uses httpRequest. Webhook trigger; 4 nodes.

Source: https://github.com/8Dvibes/mindvalley-ai-mastery-students/blob/main/workflows/gemini-list-documents-v2-2025-11-28.json — 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 workflow automates end-to-end social media publishing powered by Late API. It generates text content with Google Gemini, creates branded visuals with Kie.ai, uploads media to Late, and publishes

HTTP Request
AI & RAG

This workflow is perfect for app developers, SaaS founders, and mobile growth teams who need constant UGC-style video ads without hiring creators or agencies. If you're spending $500+ per creator and

HTTP Request, Google Drive
AI & RAG

AI Background Generation with Nano Banana (Gemini Image). Uses httpRequest, googleDrive. Webhook trigger; 35 nodes.

HTTP Request, Google Drive
AI & RAG

This template is for developers, teams, and automation enthusiasts who want a private, PIN-protected Telegram chatbot that answers questions from their own documents — without relying on external AI A

Postgres, Telegram, HTTP Request +2
AI & RAG

Elevate your digital presence with high-fidelity cinematic video automation. This workflow orchestrates the complex, asynchronous rendering process of OpenAI Sora—transforming static product images or

HTTP Request, N8N Nodes Uploadtourl