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.
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.
| Node | Category | Type | Operation |
|---|---|---|---|
| Google Drive | Files / media | Google Drive | download |
| Default Data Loader | Files / media | Document Default Data Loader | See node parameters |
| Question and Answer Chain | AI & models | Chain Retrieval Qa | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Vector Store Retriever | AI & models | Retriever Vector Store | See node parameters |
| Recursive Character Text Splitter1 | Transform | Text Splitter Recursive Character Text Splitter | See node parameters |
| Customize Response | Transform | Edit Fields | See node parameters |
| When chat message received | Trigger | Chat Trigger | See node parameters |
| Retrieve by Query | Data store | Vector Store Supabase | See node parameters |
| Embeddings OpenAI Retrieval | AI & models | Embeddings Open Ai | See node parameters |
| Embeddings OpenAI Insertion | AI & models | Embeddings Open Ai | See node parameters |
| Placeholder (File/Content to Upsert) | Transform | Edit Fields | See node parameters |
| Embeddings OpenAI Upserting | AI & models | Embeddings Open Ai | See node parameters |
| Insert Documents | Data store | Vector Store Supabase | See node parameters |
| Retrieve Rows from Table | Data store | Supabase | getAll |
| Update Documents | Data store | Vector Store Supabase | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- 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_documentsset 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