This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "RAG Pipeline",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "rag",
"responseMode": "onReceived",
"options": {}
},
"id": "webhook-rag",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"method": "POST",
"url": "https://api.openai.com/v1/embeddings",
"authentication": "genericCredentialType",
"genericCredentialType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer {{ $env.OPENAI_API_KEY }}"
}
]
},
"bodyParametersJson": "={\n \"model\": \"text-embedding-3-small\",\n \"input\": \"{{ $node[\\\"Webhook\\\"].json.text }}\"\n}",
"options": {}
},
"id": "openai-embedding",
"name": "Generate Embedding",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
450,
300
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $env.SUPABASE_DB_URL }}/rest/v1/embeddings",
"authentication": "genericCredentialType",
"genericCredentialType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer {{ $env.SUPABASE_SERVICE_ROLE_KEY }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"bodyParametersJson": "={\n \"document_id\": \"{{ $node[\\\"Webhook\\\"].json.document_id }}\",\n \"text_chunk\": \"{{ $node[\\\"Webhook\\\"].json.text }}\",\n \"embedding_vector\": {{ $node[\\\"Generate Embedding\\\"].json.data[0].embedding }},\n \"metadata\": { \"source\": \"{{ $node[\\\"Webhook\\\"].json.source }}\" }\n}",
"options": {}
},
"id": "supabase-embedding",
"name": "Save Embedding",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
650,
300
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Generate Embedding",
"type": "main",
"index": 0
}
]
]
},
"Generate Embedding": {
"main": [
[
{
"node": "Save Embedding",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
ollamaApiqdrantApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
RAG Pipeline. Uses formTrigger, vectorStoreQdrant, embeddingsOllama, documentDefaultDataLoader. Event-driven trigger; 13 nodes.
Source: https://github.com/Codimart/n8n-ai-agents-starter-kit/blob/main/workflows/ai-agent-rag.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow implements a complete Retrieval-Augmented Generation (RAG) knowledge assistant with built-in document ingestion, conversational AI, and automated analytics using n8n, OpenAI, and Pinecon
Indexation. Uses formTrigger, embeddingsOllama, textSplitterRecursiveCharacterTextSplitter, modelSelector. Event-driven trigger; 25 nodes.
Local RAG AI Agent. Uses memoryPostgresChat, lmChatOllama, lmOllama, toolVectorStore. Event-driven trigger; 24 nodes.
V1 ocal RAG AI Agent. Uses memoryPostgresChat, lmChatOllama, lmOllama, toolVectorStore. Event-driven trigger; 24 nodes.
V1 Local RAG AI Agent. Uses memoryPostgresChat, lmChatOllama, lmOllama, toolVectorStore. Event-driven trigger; 24 nodes.