I’m trying to ingest policy docs into Supabase using @n8n/n8n-nodes-langchain.vectorStoreSupabase (Insert Documents mode), but inserts fail on my custom kb_chunks table.
My table schema expects top-level columns like:
-
source_id text not null -
source_type text not null -
chunk_index integer not null -
content text not null -
metadata jsonb -
embedding vector(3072)
I’m using Default Data Loader + Recursive Character Text Splitter + Embeddings Google Gemini feeding into Insert Into Supabase Vector Store.
I can see source_id in upstream data and in loader metadata, but Supabase still throws null constraint error on source_id.
I want to know the correct n8n pattern for this table shape:
-
Should
source_id/source_type/chunk_indexbe top-level DB columns with this node? -
Or does the vector store node only reliably write
content/embedding/metadataand I should derive extra columns via trigger/view? -
Best practice for n8n v2.17.7?
What is the error message (if any)?
Error inserting: null value in column "source_id" of relation "kb_chunks" violates not-null constraint 400 Bad Request
workflow
Minimal graph:
-
Manual Trigger -
Prepare Knowledge Documents(Code node, returns array of docs withsource_id,source_type,title,content) -
Recursive Character Text Splitter -
Default Data Loader-
jsonData = {{ $json.content }} -
metadata values:
-
source_id = {{ $json.source_id }} -
source_type = {{ $json.source_type }} -
title = {{ $json.title }}
-
-
-
Embeddings Google Gemini(models/gemini-embedding-2) -
Insert Into Supabase Vector Store-
mode:
insert -
table:
kb_chunks -
queryName:
match_documents
-
Connection intent:
-
Splitter → Data Loader (
ai_textSplitter) -
Data Loader → Vector Store (
ai_document) -
Embeddings → Vector Store (
ai_embedding)
I previously had a direct main connection from Prepare Knowledge Documents to Insert Into Supabase Vector Store; removing/changing wiring still gives the same source_id null issue.
output returned by the last node
Last node (Insert Into Supabase Vector Store) output is error only:
null value in column "source_id" of relation "kb_chunks" violates not-null constraint
No successful inserted rows.
Information on n8n setup
-
n8n version:
2.17.7 -
Database: (please set this to your actual n8n DB, mine is self-hosted; Supabase is used as vector store target)
-
n8n EXECUTIONS_PROCESS: (not sure)
-
Running n8n via: self-hosted local instance (exposed with ngrok when needed)
-
Operating system: macOS

