AutomationFlowsAI & RAG › Pentest RAG Vector Query

Pentest RAG Vector Query

Pentest RAG Vector Query. 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": "Pentest RAG Vector Query",
  "description": null,
  "active": true,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "path": "rag-vector",
        "httpMethod": "POST",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "node-webhook-rag-vector",
      "name": "Vector query webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://generativelanguage.googleapis.com/v1beta/models/gemini-embedding-001:embedContent?key={{ $env.GEMINI_API_KEY }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"model\": \"models/gemini-embedding-001\", \"content\": {\"parts\": [{\"text\": {{ JSON.stringify($json.body.query) }}}]}}",
        "options": {}
      },
      "id": "node-gemini-embed-query",
      "name": "Gemini embed query",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://neo4j:7474/db/neo4j/tx/commit",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"statements\": [{\"statement\": \"CALL db.index.vector.queryNodes('rapport_chunks', 5, $embedding) YIELD node, score OPTIONAL MATCH (node)-[:BESKRIVER]->(f:Fund) OPTIONAL MATCH (f)-[:FUNDET_MED]->(t:Teknik) RETURN node.chunk_id AS id, node.tekst AS tekst, node.kilde AS kilde, score, f.titel AS fund, f.cvss AS cvss, t.kommando AS teknik ORDER BY score DESC\", \"parameters\": {\"embedding\": {{ JSON.stringify($json.embedding.values) }}}}]}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth"
      },
      "id": "node-neo4j-vector-search",
      "name": "Neo4j vector search",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        680,
        300
      ],
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "\nconst input = $input.first().json;\nconst rows = input.results?.[0]?.data || [];\n\nif (rows.length === 0) {\n  return [{ json: { svar: \"Ingen relevante fund i videnbasen.\", antal: 0 }}];\n}\n\nconst resultater = rows.map(r => ({\n  id: r.row[0], tekst: r.row[1], kilde: r.row[2],\n  score: Math.round(r.row[3] * 100) / 100,\n  fund: r.row[4], cvss: r.row[5], teknik: r.row[6]\n}));\n\nconst svar = resultater.map((r, i) =>\n  `${i+1}. [${r.score}] ${r.kilde}: ${r.tekst.substring(0, 200)}` +\n  (r.teknik ? `\\n   \u2192 Teknik: ${r.teknik}` : '')\n).join('\\n\\n');\n\nreturn [{ json: { svar, antal: resultater.length, resultater }}];\n"
      },
      "id": "node-formater-vector-resultat",
      "name": "Formater vector resultat",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        900,
        300
      ]
    }
  ],
  "connections": {
    "Vector query webhook": {
      "main": [
        [
          {
            "node": "Gemini embed query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini embed query": {
      "main": [
        [
          {
            "node": "Neo4j vector search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Neo4j vector search": {
      "main": [
        [
          {
            "node": "Formater vector resultat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "activeVersionId": "ec182336-5837-4045-87b8-f6812982975a",
  "versionCounter": 6,
  "triggerCount": 1,
  "tags": [],
  "shared": [
    {
      "updatedAt": "2026-05-23T10:18:36.803Z",
      "createdAt": "2026-05-23T10:18:36.803Z",
      "role": "workflow:owner",
      "workflowId": "srgbYxP4QHx67Fd6",
      "projectId": "mBwAmYhJNV3JFVeG",
      "project": {
        "updatedAt": "2026-05-23T10:16:37.814Z",
        "createdAt": "2026-05-23T10:14:57.720Z",
        "id": "mBwAmYhJNV3JFVeG",
        "name": "hannibal u-w <hannibal@ussing.com>",
        "type": "personal",
        "icon": null,
        "description": null,
        "creatorId": "ddbee286-2878-4f4d-873f-e6c8d1e1c77f"
      }
    }
  ],
  "versionMetadata": {
    "name": null,
    "description": null
  }
}

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

Pentest RAG Vector Query. Uses httpRequest. Webhook trigger; 4 nodes.

Source: https://github.com/Huw02/pentesting-bot/blob/bacf3595503962a20c03104d80ce1b5256601bb8/n8n-workflows/rag-vector-query.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