AutomationFlowsAI & RAG › Kreativ: RAG Ingestion Pipeline

Kreativ: RAG Ingestion Pipeline

Kreativ: RAG Ingestion Pipeline. Uses httpRequest, postgres. Webhook trigger; 5 nodes.

Webhook trigger★★★★☆ complexity5 nodesHTTP RequestPostgres
AI & RAG Trigger: Webhook Nodes: 5 Complexity: ★★★★☆ Added:

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 →

Download .json
{
  "name": "Kreativ: RAG Ingestion Pipeline",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "rag-ingest",
        "responseMode": "responseNode",
        "options": {}
      },
      "name": "Webhook: Ingest\u00e3o RAG",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const body = $json.body || $json;\nconst content = body.content || '';\nconst fileName = body.fileName || 'upload.pdf';\nconst courseId = parseInt(body.course_int_id || 19, 10);\n\n// Chunking simples (~800 chars)\nconst CHUNK_SIZE = 800;\nconst chunks = [];\nfor (let i = 0; i < content.length; i += CHUNK_SIZE) {\n  chunks.push({\n    json: {\n      content: content.substring(i, i + CHUNK_SIZE),\n      fileName,\n      courseId,\n      index: Math.floor(i / CHUNK_SIZE)\n    }\n  });\n}\nreturn chunks;"
      },
      "name": "Chunking",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.deepseek.com/v1/embeddings",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <redacted-credential>"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ { model: 'deepseek-embedding', input: $json.content } }}",
        "options": {}
      },
      "name": "Gerar Embedding",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        0
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "INSERT INTO document_chunks (source_file, chunk_index, content, embedding, metadata)\nVALUES (\n  '{{ $('Chunking').item.json.fileName }}',\n  {{ $('Chunking').item.json.index }},\n  '{{ $('Chunking').item.json.content.replace(/'/g, \"''\") }}',\n  '[{{ $json.data[0].embedding.join(',') }}]',\n  '{\"course_id\": {{ $('Chunking').item.json.courseId }}}'::jsonb\n);",
        "options": {}
      },
      "name": "Salvar no Postgres",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        660,
        0
      ],
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={ \"success\": true, \"message\": \"Processamento RAG conclu\u00eddo\" }"
      },
      "name": "Responder",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        880,
        0
      ]
    }
  ],
  "connections": {
    "Webhook: Ingest\u00e3o RAG": {
      "main": [
        [
          {
            "node": "Chunking",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chunking": {
      "main": [
        [
          {
            "node": "Gerar Embedding",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gerar Embedding": {
      "main": [
        [
          {
            "node": "Salvar no Postgres",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Salvar no Postgres": {
      "main": [
        [
          {
            "node": "Responder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Kreativ: RAG Ingestion Pipeline. Uses httpRequest, postgres. Webhook trigger; 5 nodes.

Source: https://github.com/RAFAELUFT22/kreativ_bot_v2/blob/2e44f13e3eab55e41e825bf59bca063e04a97b1a/n8n-workflows/22-rag-ingestion.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Customer Embedding RAG Chat (Webhook-based). Uses httpRequest, postgres. Webhook trigger; 8 nodes.

HTTP Request, Postgres
AI & RAG

Chatbot-Query-Qdrant. Uses httpRequest, postgres. Webhook trigger; 7 nodes.

HTTP Request, Postgres
AI & RAG

Camila IA. Uses postgres, crypto, redis, agent. Webhook trigger; 92 nodes.

Postgres, Crypto, Redis +13
AI & RAG

HeyDinastia. Uses executeCommand, httpRequest, youTube, postgres. Webhook trigger; 66 nodes.

Execute Command, HTTP Request, YouTube +15
AI & RAG

Corvus 3.2 Beta. Uses httpRequest, agent, lmChatOpenAi, vectorStoreSupabase. Webhook trigger; 48 nodes.

HTTP Request, Agent, OpenAI Chat +5