← All N8N workflows
AI & researchChain Retrieval QaChat TriggerDocument Default Data LoaderEmbeddings Open AiGoogle Drive

PREPARATION (in Supabase)

Configured with Chain Retrieval Qa, Chat Trigger, Document Default Data Loader, Embeddings Open Ai, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
Files / mediaGoogle DriveGoogle DriveFiles / mediaDefault Data LoaderDocument Default Data Lo…AI & modelsQuestion and AnswerChainChain Retrieval QaAI & modelsOpenAI Chat ModelOpenAI Chat ModelAI & modelsVector Store RetrieverRetriever Vector StoreTransformRecursive CharacterText Splitter1Text Splitter Recursive …TransformCustomize ResponseEdit FieldsTriggerWhen chat messagereceivedChat TriggerData storeRetrieve by QueryVector Store SupabaseAI & modelsEmbeddings OpenAIRetrievalEmbeddings Open AiAI & modelsEmbeddings OpenAIInsertionEmbeddings Open AiTransformPlaceholder(File/Content to…Edit FieldsAI & modelsEmbeddings OpenAIUpsertingEmbeddings Open AiData storeInsert DocumentsVector Store SupabaseData storeRetrieve Rows fromTableSupabaseData storeUpdate DocumentsVector Store Supabase

Node categories in this workflow

  • Files / media
  • AI & models
  • Transform
  • Trigger
  • Data store

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Google DriveFiles / mediaGoogle Drivedownload
Default Data LoaderFiles / mediaDocument Default Data LoaderSee node parameters
Question and Answer ChainAI & modelsChain Retrieval QaSee node parameters
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
Vector Store RetrieverAI & modelsRetriever Vector StoreSee node parameters
Recursive Character Text Splitter1TransformText Splitter Recursive Character Text SplitterSee node parameters
Customize ResponseTransformEdit FieldsSee node parameters
When chat message receivedTriggerChat TriggerSee node parameters
Retrieve by QueryData storeVector Store SupabaseSee node parameters
Embeddings OpenAI RetrievalAI & modelsEmbeddings Open AiSee node parameters
Embeddings OpenAI InsertionAI & modelsEmbeddings Open AiSee node parameters
Placeholder (File/Content to Upsert)TransformEdit FieldsSee node parameters
Embeddings OpenAI UpsertingAI & modelsEmbeddings Open AiSee node parameters
Insert DocumentsData storeVector Store SupabaseSee node parameters
Retrieve Rows from TableData storeSupabasegetAll
Update DocumentsData storeVector Store SupabaseSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

None declared. HTTP requests and Code nodes may still need configuration.

Workflow notes

INSERTING

INSERTING

  • it's important to use the same embedding model when for any interaction with your vector database (inserting, upserting and retrieval)
PREPARATION (in Supabase)

PREPARATION (in Supabase)

  • your database needs the extension 'pgvector' enabled -> select Database > Extension > Search for 'vector'
  • make sure you have a table that has the following columns (if not, use the query below in the Supabase SQL Editor)
ALTER TABLE "YOUR TABLE NAME"
ADD COLUMN embedding VECTOR(1536), // check which number of dimensions you need (depends on the embed model)
ADD COLUMN metadata JSONB,
ADD COLUMN content TEXT;
  • make sure you have the right policies set -> select Authentication > Policies
  • make sure you have the custom function match_documents set up in Supabase -> This is needed for the Vector Store Node (as query name) (if not, use the query below in the Supabase SQL Editor to create that function)
  • make sure you check the size of the AI model as it should be the same vector size for the table (e.g. OpenAI's Text-Embedding-3-Small uses 1536)
CREATE OR REPLACE FUNCTION public.match_documents(
  filter JSONB,
  match_count INT,
  query_embedding VECTOR(1536) // should match same dimensions as from insertion
)
RETURNS TABLE (
  id BIGINT,
  content TEXT,
  metadata JSONB,
  embedding VECTOR(1536), // should match same dimensions as from insertion
  similarity FLOAT
)
LANGUAGE plpgsql AS $$
BEGIN
  RETURN QUERY
  SELECT
    v.id,
    v.content,
    v.metadata,
    v.embedding,
    1 - (v.embedding <=> match_documents.query_embedding) AS similarity
  FROM "YOUR TABLE NAME" v
  WHERE v.metadata @> filter
  ORDER BY v.embedding <=> match_documents.query_embedding
  LIMIT match_count;
END;
$$
;
Customize Response

output || text

DELETION

DELETION

At the moment n8n does not have a built-in Supabase Node to delete records in a Vector Database. For this you would typically use the HTTP Request node to make an authorized API call to Supabase.

HTTP Request Node

Use this node to send a DELETE request to your Supabase instance.

  • Supabase API Endpoint: Use the appropriate URL for your Supabase project. The endpoint will typically look like this: https://.supabase.co/rest/v1/. Replace <your-supabase-ref> and <your-vector-table> with your details.

HEADERS:

  • apikey: Your Supabase API key.
  • Authorization: Bearer token with your Supabase JWT.
  • Query Parameters: Use query parameters to specify which record(s) to delete. For example, ?id=eq.<your-record-id> where <your-record-id> is the specific record ID you want to delete (You can also reference back to the Retrieve Rows From Table Node to get the ID dynamically)

Ensure you have the necessary permissions set up in Supabase to delete records through the API.

Please refer to the official n8n documentation for more detailed information on using the HTTP Request Node.

Note: Deleting records is a sensitive operation, so make sure that your permissions are correctly configured and that you are targeting the correct records to avoid unwanted data loss.

PREPARATION (in Supabase)

PREPARATION (in Supabase)

Purpose and structure

This folder contains the PREPARATION (in Supabase) workflow. Its executable nodes use chainRetrievalQa, chatTrigger, documentDefaultDataLoader, embeddingsOpenAi, googleDrive, lmChatOpenAi, retrieverVectorStore, set, supabase, textSplitterRecursiveCharacterTextSplitter, vectorStoreSupabase. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

When chat message received

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Supabase/0564_Supabase_Stickynote_Create_Triggered.json MIT; preserve source notices.

Canvas section labels

These name areas of the original canvas; they do not include explanatory instructions.

  • UPSERTING
  • RETRIEVAL

More in AI & research