AutomationFlowsAI & RAG › Gemini File Search - Delete Document (webhook) (http Request)

Gemini File Search - Delete Document (webhook) (http Request)

Gemini File Search - Delete Document (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 - Delete Document (Webhook)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "kb-delete-document",
        "responseMode": "lastNode",
        "options": {
          "responseData": "firstEntryJson"
        }
      },
      "id": "Webhook",
      "name": "Webhook /kb-delete-document",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        280,
        300
      ]
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const { apiKey, documentId } = $json;\nif (!apiKey) return [{ json: { status: 'ERROR', error: 'apiKey required' } }];\nif (!documentId) return [{ json: { status: 'ERROR', error: 'documentId required' } }];\nreturn [{ json: { apiKey, documentId } }];"
      },
      "id": "Validate",
      "name": "Validate Input",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        520,
        300
      ]
    },
    {
      "parameters": {
        "method": "DELETE",
        "url": "=https://generativelanguage.googleapis.com/v1beta/{{$json.documentId}}?key={{$json.apiKey}}",
        "responseFormat": "json"
      },
      "id": "Http Request",
      "name": "Delete in Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        760,
        300
      ],
      "notes": "Deletes the document by name."
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const res = $json;\nif (res.statusCode && res.statusCode !== 200 && res.statusCode !== 204) {\n  return [{ json: { status: 'ERROR', error: `Gemini returned ${res.statusCode}`, body: res.body || res } }];\n}\nreturn [{ json: { status: 'SUCCESS', deleted: true } }];"
      },
      "id": "Return",
      "name": "Format Response",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1000,
        300
      ]
    }
  ],
  "connections": {
    "Webhook /kb-delete-document": {
      "main": [
        [
          {
            "node": "Validate Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Input": {
      "main": [
        [
          {
            "node": "Delete in Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete in Gemini": {
      "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 - Delete Document (Webhook). Uses httpRequest. Webhook trigger; 4 nodes.

Source: https://github.com/8Dvibes/mindvalley-ai-mastery-students/blob/main/workflows/gemini-delete-document-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