AutomationFlowsData & Sheets › Vector Search with MongoDB

Vector Search with MongoDB

Original n8n title: Seoul Hackathon

Seoul hackathon. Uses httpRequest, mongoDb. Webhook trigger; 5 nodes.

Webhook trigger★★★★☆ complexity5 nodesHTTP RequestMongoDB
Data & Sheets Trigger: Webhook Nodes: 5 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": "Seoul hackathon",
  "nodes": [
    {
      "parameters": {
        "authentication": "headerAuth",
        "requestMethod": "POST",
        "url": "https://api.openai.com/v1/embeddings",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\n  \"model\":\"text-embedding-3-large\",\n\"input\": \"{{ $json.body.text }}\"\n}\n "
      },
      "name": "Convert Text to Vector",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        7940,
        420
      ],
      "id": "a9b22d84-83c4-44df-8165-65c8e4340b29",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "functionCode": "return items.map(item => {\n    const { URL, Description, Title, Images, ...rest } = item.json;\n  const imageArray = Images.split(','); // Split the Images string by comma\n    return { json: { url: URL, description: Description, title: Title, image: imageArray[0] } };\n});"
      },
      "name": "Format Response",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        8300,
        420
      ],
      "id": "038d01f8-19a1-4070-812b-b0782d750490"
    },
    {
      "parameters": {
        "operation": "aggregate",
        "collection": "product_v2",
        "query": "=[{\n    \"$vectorSearch\": {\n\"index\": \"vector_index\",\n\"path\": \"embedding\",\n\"numCandidates\": 5,\n\"limit\": 5,\n\"queryVector\": [{{$json.data[0].embedding}}]\n      }\n    }\n]"
      },
      "name": "MongoDB Vector Search",
      "type": "n8n-nodes-base.mongoDb",
      "typeVersion": 1,
      "position": [
        8100,
        420
      ],
      "id": "a82f75b0-41fb-402c-8bb4-d046ceef5aa1",
      "credentials": {
        "mongoDb": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "allIncomingItems",
        "options": {}
      },
      "id": "3c375641-50a5-4cdd-b431-73a5a6fe8cb6",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        8500,
        420
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "text-to-vector",
        "responseMode": "responseNode",
        "options": {
          "rawBody": false
        }
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        7780,
        420
      ],
      "id": "44e95081-b816-43dc-88ee-8f4441dbae8e"
    }
  ],
  "connections": {
    "Convert Text to Vector": {
      "main": [
        [
          {
            "node": "MongoDB Vector Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MongoDB Vector Search": {
      "main": [
        [
          {
            "node": "Format Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Response": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Convert Text to Vector",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0b7cdfc3-ab03-40f4-b50b-453d8afa69b4",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "e8okWm6Hm4nloUOe",
  "tags": []
}

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

Seoul hackathon. Uses httpRequest, mongoDb. Webhook trigger; 5 nodes.

Source: https://github.com/x2day/qoupee/blob/fe58d4df9fca977e13a966a9759674149dd8b211/workflows/n8n.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

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

Data & Sheets

CyberShield Universal Workflow v4. Uses mongoDb, ssh, httpRequest. Webhook trigger; 7 nodes.

MongoDB, Ssh, HTTP Request
Data & Sheets

UFRO PP3 Orchestrator Workflow. Uses httpRequest, mongoDb. Webhook trigger; 7 nodes.

HTTP Request, MongoDB
Data & Sheets

CyberShield — Attack Executor. Uses mongoDb, ssh, httpRequest. Webhook trigger; 6 nodes.

MongoDB, Ssh, HTTP Request
Data & Sheets

CyberShield — Attack Executor. Uses mongoDb, ssh, httpRequest. Webhook trigger; 6 nodes.

MongoDB, Ssh, HTTP Request
Data & Sheets

DAta lake 1. Uses openAi, httpRequest, googleSheets, mongoDb. Webhook trigger; 23 nodes.

OpenAI, HTTP Request, Google Sheets +1