n8n-nodes-cloudflare-vectorize
v0.1.0
Published
n8n community node for Cloudflare Vectorize vector database integration, featuring vector operations (insert/upsert/query), index management, metadata filtering, namespace support, and full AI Agent compatibility for semantic search and RAG implementation
Maintainers
Readme
n8n-nodes-cloudflare-vectorize
A comprehensive n8n community node for Cloudflare Vectorize, enabling vector database operations for semantic search, embeddings management, and RAG (Retrieval-Augmented Generation) applications.
Features
- 🚀 Complete Vector Operations: Insert, upsert, query, delete vectors
- 🔍 Advanced Search: Semantic similarity search with configurable parameters
- 📊 Index Management: Create, configure, and manage vector indexes
- 🏷️ Metadata Support: Rich metadata filtering and indexing
- 🎯 AI Agent Ready: Optimized for use with n8n AI Agent and MCP Trigger
- 📝 Namespace Support: Organize vectors with namespace segmentation
- ⚡ Batch Operations: Efficient bulk vector processing
- 🛠️ Developer Friendly: Full TypeScript support with comprehensive types
Installation
From n8n Community Nodes (Recommended)
- Go to Settings > Community Nodes in your n8n instance
- Click Install a community node
- Enter:
n8n-nodes-cloudflare-vectorize - Click Install
Manual Installation
# In your n8n installation directory
npm install n8n-nodes-cloudflare-vectorize
# Restart n8nQuick Start
1. Set up Cloudflare Vectorize
- Create a Cloudflare account
- Create a vector index using Wrangler CLI:
npx wrangler vectorize create my-index --dimensions=1536 --metric=cosine - Get your Account ID from the Cloudflare dashboard
- Create an API token with Vectorize permissions
2. Configure Credentials in n8n
- Add new credentials: Cloudflare Vectorize API
- Enter your:
- Account ID: Found in your Cloudflare dashboard
- API Token: Created with Vectorize read/write permissions
- API Endpoint: Leave default unless using custom endpoint
3. Use in Workflows
Add the Cloudflare Vectorize node to your workflow and select from these resources:
- Index: Manage vector indexes
- Vector: Insert, query, and manage vectors
- Metadata: Configure metadata indexes for filtering
- Utility: List vectors and get index information
Usage Examples
Insert Vectors
{
"resource": "vector",
"operation": "insert",
"indexName": "my-embeddings",
"vectors": [
{
"id": "doc1",
"values": [0.1, 0.2, 0.3, ...],
"metadata": {
"title": "Document 1",
"category": "tech"
}
}
]
}Query Similar Vectors
{
"resource": "vector",
"operation": "query",
"indexName": "my-embeddings",
"queryVector": [0.1, 0.2, 0.3, ...],
"topK": 5,
"returnValues": true,
"returnMetadata": "all"
}Create Index
{
"resource": "index",
"operation": "create",
"indexName": "new-index",
"dimensions": 1536,
"metric": "cosine",
"description": "Embeddings for documents"
}AI Agent Integration
This node is optimized for use with n8n's AI Agent and MCP Trigger:
{
"tool": "cloudflare-vectorize",
"operation": "query-similar-vectors",
"parameters": {
"query": "Find documents about machine learning",
"index": "knowledge-base",
"limit": 3
}
}Operations Reference
Index Resource
| Operation | Description |
|-----------|-------------|
| create | Create a new vector index |
| list | List all available indexes |
| delete | Delete an index |
| get | Get index details |
| info | Get index statistics |
Vector Resource
| Operation | Description |
|-----------|-------------|
| insert | Insert new vectors (fails if ID exists) |
| upsert | Insert or update vectors |
| query | Search vectors by similarity |
| queryById | Query using existing vector |
| getByIds | Retrieve specific vectors |
| deleteByIds | Delete vectors by ID |
Metadata Resource
| Operation | Description |
|-----------|-------------|
| createIndex | Enable metadata filtering |
| deleteIndex | Remove metadata index |
| listIndexes | List metadata indexes |
Utility Resource
| Operation | Description |
|-----------|-------------|
| listVectors | List all vector IDs |
| describe | Get index configuration |
Configuration
Vector Formats
Vectors can be provided as:
- Array of numbers:
[1.0, 2.0, 3.0] - Float32Array or Float64Array
- n8n expressions:
{{ $json.embedding }}
Distance Metrics
- cosine: Cosine similarity (recommended for most use cases)
- euclidean: Euclidean distance
- dot-product: Dot product similarity
Metadata Filtering
Create metadata indexes to enable filtering:
{
"resource": "metadata",
"operation": "createIndex",
"indexName": "my-index",
"propertyName": "category",
"type": "string"
}Then use in queries:
{
"resource": "vector",
"operation": "query",
"filter": {
"category": "technology"
}
}Error Handling
The node provides detailed error messages for common issues:
- Authentication errors: Check API token permissions
- Index not found: Verify index name and existence
- Dimension mismatches: Ensure vector dimensions match index
- Rate limiting: Automatic retry with exponential backoff
- Network errors: Configurable retry logic
Limits
Cloudflare Vectorize has the following limits:
- Vectors per request: Up to 1,000 for inserts/upserts
- Query topK: Up to 100 (20 with returnValues/returnMetadata)
- Metadata indexes: Up to 10 per index
- Vector dimensions: Up to 1536
- Namespace length: Up to 64 characters
- Metadata size: Up to 10KB per vector
Development
Building from Source
git clone https://github.com/jezweb/n8n-nodes-cloudflare-vectorize.git
cd n8n-nodes-cloudflare-vectorize
npm install
npm run buildTesting Locally
# Link to local n8n
npm link
cd ~/.n8n/custom
npm link n8n-nodes-cloudflare-vectorize
# Restart n8nContributing
Contributions are welcome! Please read our contributing guidelines and submit issues and pull requests on GitHub.
License
MIT License - see LICENSE file for details.
Support
Related
- n8n-nodes-cloudflare-d1 - Cloudflare D1 database integration
- Cloudflare Vectorize - Official documentation
- n8n - Workflow automation platform
