Sep 3, 2025
8 min readTL;DR - We’ve shipped the official SurrealDB node for n8n. It’s a first-party, production-ready integration that lets you query, create, update, upsert, and delete data in SurrealDB from any n8n workflow - and it also runs as an AI tool inside n8n’s Agent nodes. This work builds on the amazing community implementation by David Whatley! 🚀
You can browse the code here: https://github.com/surrealdb/n8n-nodes-surrealdb.
The node supports complete CRUD, custom SurrealQL, table/field/index operations, relationship management, connection pooling, and diagnostics, all over HTTP(S). For AI agents, enable tool usage and plug the SurrealDB node straight into your agent’s toolbelt to give LLMs safe, structured access to your app data.
The fastest-growing teams are tightening the loop between data → decision → action. SurrealDB gives you one multi-model system - document, relational, graph, full-text, and vector - so the same database that powers your app can also power your automations and your AI.
n8n brings the visual orchestration: triggers, conditionals, retries, and a deep library of built-in AI nodes and AI Agent tools. The SurrealDB node closes the loop so your automations and agents can read and write to the source of truth, safely and repeatably.
Here’s what’s in the official SurrealDB n8n node:
WHERE
, ORDER BY
, GROUP BY
, etc.).RELATE
semantics).Below are practical AI-forward patterns you can ship in hours, not weeks.
Build advanced and dynamic workflows which combine AI and LLM calls to improve user experiences and make more accurate decisions. When you’re turning onboarding into a growth loop, AI generates attributes you can target later (activation nudges, upgrade prompts) and all of it lives beside your operational data.
Trigger: Webhook (signup event) or Scheduled poll (for new records).
Workflow:
INSERT
the user profile record into SurrealDB.UPDATE
the user record with AI-generated traits; RELATE
to organisations or plans.SurrealDB node ops: Create Record
, Execute Query
, Create Relationship
.
SurrealDB exposes vector functions (including vector::similarity::cosine) and supports vector search patterns; create vector indexes for performance and use the KNN operator where appropriate. With SurrealDB, you can use a single system for OLTP + vectors + graph lookups, for more accurate answers, and improved reasoning.
Trigger: new file in storage → chunk/embedding workflow.
Workflow:
Insert
records into SurrealDB with an embedding field.Execute Query
on the SurrealDB node to rank by similarity.SurrealDB lets you store graph + vectors in one place and query both in a single SurrealQL statement. That’s powerful for assistants that need structure + semantics.
Trigger: “Teach the agent” workflow or nightly build.
Workflow:
RELATE
edges (who-knows-who, depends-on, duplicates-with).Execute Query
that follows edges and ranks by vector similarity.Build intelligent monitoring systems that track key metrics, detect anomalies, and automatically respond to critical events. SurrealDB’s time-series capabilities combined with AI analysis help you stay ahead of issues before they impact users. This creates the feedback loop that growth teams love: measure → message → learn → ship, with everything stored relationally, as documents, and as connected graph edges.
Trigger: Cron or webhook from your app.
Workflow:
SELECT
error bursts, churn-risk users, or spikes in LLM refusals.Insert
incidents back into SurrealDB for post-mortems.RELATE
incidents to features, releases, and customers.n8n’s AI Agent node supports tools. When you enable community tools, you can add the SurrealDB node as a tool so the agent can read context or write results under guardrails. Set N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
, then attach the SurrealDB tool with pre-scoped credentials (e.g., namespace or database level authentication) and with whitelisted operations (e.g., Execute Query
with a parameterised template).
Workflow:
Why it works: you get agentic behaviors, with principle-of-least-privilege access
We’ll implement an end-to-end workflow that welcomes a new user, tags them with AI, and writes everything back to SurrealDB.
@surrealdb/n8n-nodes-surrealdb
and install.N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
.Add SurrealDB credentials:
http(s)://your-surrealdb-host:port
You can start schemaless and later add schema definitions as your data model stabilises. For relationships (e.g., user -> plan), use RELATE
edges. SurrealDB’s RELATE
creates first-class edges you can traverse in queries.
Trigger:
Steps:
If your signup includes free-text (“About me”), you can store an embedding on the user record and later build a segment of “most similar to X” users:
LET $e = /* embedding of "I'm a fintech founder" */ SELECT id, email, vector::similarity::cosine(about_embedding, $e) AS score FROM user ORDER BY score DESC LIMIT 25;
The same pattern powers AI triage, content recommendations, and semantic deduping.
N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
in your n8n environment.SELECT ... FROM $id
only).This gives agents just-enough powers to fetch facts or file updates without opening up your whole database.
System → Get Pool Statistics
. This is invaluable under bursty, agent-driven workloads.Create
/ Select
/ Update
/ Upsert
/ Delete
.Create Table
, Delete Table
; List Field
, Create Field
, Delete Field
.Create Index
, Delete Index
; Rebuild Index
as needed. (Vector and full-text indexes are supported by SurrealDB; use indexes to accelerate similarity search and text search.)Create Relationship
, Delete Relationship
, Query Relationship
using SurrealDB’s graph semantics.Execute Query
, Build SELECT
visually with filters and ordering.Health Check
, Version
, Get Pool Statistics
.If you’re building ambitious AI workflows - RAG, GraphRAG, or agentic back-office automations - we want this node to feel batteries-included for you. Open issues and PRs on the repo, or propose recipes you need (e.g., a pre-built “semantic dedupe” or “churn-risk scorer”). The more we learn from your usage, the faster we can sharpen the DX.
Automation should reduce glue code, not add more of it. With n8n handling orchestration and SurrealDB unifying your relational + document + graph + vector data, you’ve now got a native bridge between workflows, agents, and your operational truth. Install the node, ship an AI-assisted flow today, and let your product’s growth loops run on rails.