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

RAG on living data

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
AI & modelsEmbeddings OpenAIEmbeddings Open AiTransformToken SplitterText Splitter Token Spli…RoutingLoop Over ItemsLoop Over ItemsAI & modelsQuestion and AnswerChainChain Retrieval QaAI & modelsVector Store RetrieverRetriever Vector StoreAI & modelsOpenAI Chat ModelOpenAI Chat ModelTriggerWhen chat messagereceivedChat TriggerTriggerSchedule TriggerSchedule TriggerTransformLimitLimitTransformLimit1LimitData storeDelete old embeddingsif existSupabaseIntegrationGet page blocksNotionFiles / mediaDefault Data LoaderDocument Default Data Lo…RoutingInput ReferenceNo OpTriggerNotion TriggerNotion TriggerIntegrationGet updated pagesNotionData storeSupabase Vector Store1Vector Store SupabaseData storeSupabase Vector StoreVector Store SupabaseTransformConcatenate to singlestringSummarize

Node categories in this workflow

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

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
Embeddings OpenAIAI & modelsEmbeddings Open AiSee node parameters
Token SplitterTransformText Splitter Token SplitterSee node parameters
Loop Over ItemsRoutingLoop Over ItemsSee node parameters
Question and Answer ChainAI & modelsChain Retrieval QaSee node parameters
Vector Store RetrieverAI & modelsRetriever Vector StoreSee node parameters
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
When chat message receivedTriggerChat TriggerSee node parameters
Schedule TriggerTriggerSchedule TriggerSee node parameters
LimitTransformLimitSee node parameters
Limit1TransformLimitSee node parameters
Delete old embeddings if existData storeSupabasedelete
Get page blocksIntegrationNotionblock / getAll
Default Data LoaderFiles / mediaDocument Default Data LoaderSee node parameters
Input ReferenceRoutingNo OpSee node parameters
Notion TriggerTriggerNotion TriggerSee node parameters
Get updated pagesIntegrationNotiondatabasePage / getAll
Supabase Vector Store1Data storeVector Store SupabaseSee node parameters
Supabase Vector StoreData storeVector Store SupabaseSee node parameters
Concatenate to single stringTransformSummarizeSee 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

  • notionApi
  • openAiApi
  • supabaseApi

Workflow notes

Switch trigger (optional)

Switch trigger (optional)

If you are on the cloud plan, consider switching to the Notion Trigger Node instead, to save on executions.

Adjust chunk size and overlap

Adjust chunk size and overlap

For more accurate search results, increase the overlap. For the text-embedding-ada-002 model the chunk size plus overlap must not exceed 8191

Sticky Note23

This placeholder serves as a reference point so it is easier to swap the data source with a different service

Sticky Note24

All chunks of a previous version of the document are being deleted by filtering the meta data by the given ID

Sticky Note25

Reduce the active streams/items to just 1 to prevent the following nodes from double-processing

Sticky Note26

Retrieve all page contents/blocks

Sticky Note28

Embed item and store in Vector Store. Depending on the length the content is being split up into multiple chunks/embeds

Sticky Note30

Simple chat bot to ask specific questions while having access to the context of the Notion Knowledge Base which was stored in the Vector Store

Sticky Note31

Model used for both creating and reading embeddings

Sticky Note32

Process each page/document separately.

Sticky Note29

Store additional meta data with each embed, especially the Notion ID, which can be later used to find all belonging entries of one page, even if they got split into multiple embeds.

Sticky Note33

Using a manual approach for polling data from Notion for more accuracy.

Select Database

Select Database

Choose the database which represents your Knowledge Base

Sticky Note35

Combine all contents to a single text formatted into one line which can be easily stored as an embed

RAG on living data

RAG on living data

Purpose and structure

This folder contains the RAG on living data workflow. Its executable nodes use chainRetrievalQa, chatTrigger, documentDefaultDataLoader, embeddingsOpenAi, limit, lmChatOpenAi, noOp, notion, notionTrigger, retrieverVectorStore, scheduleTrigger, splitInBatches, summarize, supabase, textSplitterTokenSplitter, 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, Schedule Trigger, Notion Trigger

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/Limit/1527_Limit_Schedule_Automation_Scheduled.json MIT; preserve source notices.

More in AI & research