This workflow follows the HTTP Request → Postgres 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": "Chatbot-Query-Qdrant",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "chatbot-rag",
"options": {}
},
"id": "webhook-trigger",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
200,
300
]
},
{
"parameters": {
"method": "POST",
"url": "=http://ollama:11434/api/embeddings",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "model",
"value": "nomic-embed-text"
},
{
"name": "prompt",
"value": "={{ $json.body.pregunta || $json.body.question }}"
}
]
},
"options": {}
},
"id": "query-embedding",
"name": "Query Embedding",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
450,
300
]
},
{
"parameters": {
"method": "POST",
"url": "http://qdrant:6333/collections/reglamento_taekwondo/points/search",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"vector\": {{ JSON.stringify($json.embedding) }},\n \"limit\": 3,\n \"with_payload\": true\n}",
"options": {}
},
"id": "qdrant-search",
"name": "Qdrant Search",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
700,
300
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "context-val",
"name": "context",
"value": "={{ $json.result.map(r => r.payload.text).join('\\n---\\n') }}",
"type": "string"
},
{
"id": "question-val",
"name": "question",
"value": "={{ $('Webhook').item.json.body.pregunta || $('Webhook').item.json.body.question }}",
"type": "string"
}
]
},
"options": {}
},
"id": "format-context",
"name": "Format Context",
"type": "n8n-nodes-base.set",
"typeVersion": 3.2,
"position": [
950,
300
]
},
{
"parameters": {
"method": "POST",
"url": "http://ollama:11434/api/generate",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "model",
"value": "smollm2:1.7b"
},
{
"name": "prompt",
"value": "=Eres un asistente experto en el reglamento de Taekwondo. Responde a la pregunta bas\u00e1ndote \u00fanicamente en el contexto proporcionado.\n\nContexto:\n{{ $json.context }}\n\nPregunta: {{ $json.question }}\n\nRespuesta corta y precisa:"
},
{
"name": "stream",
"value": "false"
}
]
},
"options": {}
},
"id": "ollama-generate",
"name": "Ollama Generate",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
1200,
300
]
},
{
"parameters": {
"operation": "executeQuery",
"query": "=INSERT INTO consultas_rag (pregunta, respuesta, documentos_usados) VALUES ('{{ $('Webhook').item.json.body.pregunta || $('Webhook').item.json.body.question }}', '{{ $json.response }}', ARRAY['reglamento_taekwondo']);",
"options": {}
},
"id": "postgres-save",
"name": "PostgreSQL Save",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.2,
"position": [
1450,
300
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"id": "respond-to-webhook",
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1700,
300
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Query Embedding",
"type": "main",
"index": 0
}
]
]
},
"Query Embedding": {
"main": [
[
{
"node": "Qdrant Search",
"type": "main",
"index": 0
}
]
]
},
"Qdrant Search": {
"main": [
[
{
"node": "Format Context",
"type": "main",
"index": 0
}
]
]
},
"Format Context": {
"main": [
[
{
"node": "Ollama Generate",
"type": "main",
"index": 0
}
]
]
},
"Ollama Generate": {
"main": [
[
{
"node": "PostgreSQL Save",
"type": "main",
"index": 0
}
]
]
},
"PostgreSQL Save": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
}
}
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.
postgres
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Chatbot-Query-Qdrant. Uses httpRequest, postgres. Webhook trigger; 7 nodes.
Source: https://github.com/Diana27106/tfg-taekwondo/blob/68e897cda1e408b67ddc4261ce4854b6e9229820/n8n-workflows/query-workflow.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.
Kreativ: RAG Ingestion Pipeline. Uses httpRequest, postgres. Webhook trigger; 5 nodes.
Camila IA. Uses postgres, crypto, redis, agent. Webhook trigger; 92 nodes.
HeyDinastia. Uses executeCommand, httpRequest, youTube, postgres. Webhook trigger; 66 nodes.
Corvus 3.2 Beta. Uses httpRequest, agent, lmChatOpenAi, vectorStoreSupabase. Webhook trigger; 48 nodes.
This workflow automates business intelligence reporting by aggregating data from multiple sources, processing it through AI models, and delivering formatted dashboards via email. Designed for business