AutomationFlowsAI & RAG › Automate Document Ingestion & RAG System with Google Drive, Sheets & Openai

Automate Document Ingestion & RAG System with Google Drive, Sheets & Openai

ByMohamed Abdelwahab @mohelwah on n8n.io

The IngestionDocs workflow is a fully automated **document ingestion and knowledge management system built with n8n**. Its purpose is to continuously ingest organizational documents from Google Drive, transform them into vector embeddings using OpenAI, store them in Pinecone,…

Event trigger★★★★☆ complexityAI-powered28 nodesPinecone Vector StoreOpenAI EmbeddingsDocument Default Data LoaderText Splitter Recursive Character Text SplitterGoogle DriveCryptoGoogle SheetsGoogle Drive Trigger
AI & RAG Trigger: Event Nodes: 28 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #8312 — we link there as the canonical source.

This workflow follows the Agent → Documentdefaultdataloader 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
{
  "id": "E7mxB80W3c9Uweby",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "IngestionDocs",
  "tags": [],
  "nodes": [
    {
      "id": "659f0ec6-ad2a-40c5-a34d-2e0b6458983f",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -1296,
        -880
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "pineconeNamespace": "={{ $('Loop Over Items').item.json.name }}"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-nodes",
          "cachedResultName": "n8n-nodes"
        }
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "ee09bd49-c94e-49e4-8804-6e2bfb9c800e",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -1440,
        -288
      ],
      "parameters": {
        "model": "=text-embedding-3-large",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b9fe4362-9e36-49ac-ac65-229d87be4684",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -1248,
        -352
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "file_id",
                "value": "={{ $('Loop Over Items').item.json.id }}"
              },
              {
                "name": "file_name",
                "value": "={{ $('Loop Over Items').item.json.name }}"
              }
            ]
          },
          "splitPages": true
        },
        "dataType": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "5215d6e4-d0c3-4fb4-b990-27bffaed58ab",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        -1232,
        -176
      ],
      "parameters": {
        "options": {},
        "chunkOverlap": 10
      },
      "typeVersion": 1
    },
    {
      "id": "6f1fa97d-ae85-467e-a580-4a466a100dd1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -944
      ],
      "parameters": {
        "width": 596,
        "height": 256,
        "content": "## Generate the knowledge base\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c64062de-4e0f-4c4a-b4c8-655c58599e5c",
      "name": "Search files and folders",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -3184,
        -880
      ],
      "parameters": {
        "filter": {
          "folderId": {
            "__rl": true,
            "mode": "list",
            "value": "1vQo4Er5h-4KEZoYCmHX-J4S9TRK5zpj-",
            "cachedResultUrl": "https://drive.google.com/drive/folders/1vQo4Er5h-4KEZoYCmHX-J4S9TRK5zpj-",
            "cachedResultName": "manuals"
          }
        },
        "options": {
          "fields": [
            "mimeType",
            "id",
            "name"
          ]
        },
        "resource": "fileFolder",
        "returnAll": true
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "5efcafb7-c507-4a90-af5e-a6bc568704c6",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -2480,
        -848
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3,
      "alwaysOutputData": false
    },
    {
      "id": "aa951e91-0d95-4546-8050-f41bbb65ebbc",
      "name": "createHash",
      "type": "n8n-nodes-base.crypto",
      "position": [
        -2304,
        -864
      ],
      "parameters": {
        "type": "SHA256",
        "binaryData": true,
        "dataPropertyName": "hash"
      },
      "typeVersion": 1
    },
    {
      "id": "5de17e85-6fd2-4411-91d7-82e645dd637c",
      "name": "searchRecordManger",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2080,
        -880
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.id }}",
              "lookupColumn": "Id"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HxJuA-ph6qvFmLzccKpM1XJeJHzELmvQzqJeqiRaC0U/edit#gid=0",
          "cachedResultName": "dataBase"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HxJuA-ph6qvFmLzccKpM1XJeJHzELmvQzqJeqiRaC0U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HxJuA-ph6qvFmLzccKpM1XJeJHzELmvQzqJeqiRaC0U/edit?usp=drivesdk",
          "cachedResultName": "recordManger"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7,
      "alwaysOutputData": true
    },
    {
      "id": "b6a4b15e-b0ac-490b-af1a-06d68d5c9929",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1984,
        -656
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "New Document",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "ff4d1294-192a-4f71-9983-53f0036c7d1c",
                    "operator": {
                      "type": "object",
                      "operation": "empty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $('searchRecordManger').item.json }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Already processed",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "314d1d08-928b-42e3-839d-7948004d4229",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('searchRecordManger').item.json.hashId }}",
                    "rightValue": "={{ $('createHash').item.json.hash }}"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Updated Document",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "68f55445-fe7e-4fa6-94af-081f2cae339e",
                    "operator": {
                      "type": "string",
                      "operation": "notEquals"
                    },
                    "leftValue": "={{ $('searchRecordManger').item.json.hashId }}",
                    "rightValue": "={{ $('createHash').item.json.hash }}"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "2e4f30bb-fcc1-4510-90b3-ac35d619ee2f",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -2944,
        -896
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "d213ec9a-3b8d-4a84-b90e-eb9fa9310795",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3040,
        -960
      ],
      "parameters": {
        "width": 976,
        "height": 560,
        "content": "## Record Manger\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f82520c5-8a45-455d-a2ac-faddc4a285b0",
      "name": "Add to Record Manger",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1712,
        -896
      ],
      "parameters": {
        "columns": {
          "value": {
            "Id": "={{ $('Loop Over Items').item.json.id }}",
            "name": "={{ $('Loop Over Items').item.json.name }}",
            "hashId": "={{ $('createHash').item.json.hash }}"
          },
          "schema": [
            {
              "id": "Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "hashId",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "hashId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HxJuA-ph6qvFmLzccKpM1XJeJHzELmvQzqJeqiRaC0U/edit#gid=0",
          "cachedResultName": "dataBase"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HxJuA-ph6qvFmLzccKpM1XJeJHzELmvQzqJeqiRaC0U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HxJuA-ph6qvFmLzccKpM1XJeJHzELmvQzqJeqiRaC0U/edit?usp=drivesdk",
          "cachedResultName": "recordManger"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "bcbb5938-630a-4a4e-aac1-ca88e09c2cc4",
      "name": "Pinecone Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -1296,
        -560
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "clearNamespace": true,
          "pineconeNamespace": "={{ $('Loop Over Items').item.json.name }}"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-nodes",
          "cachedResultName": "n8n-nodes"
        }
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "f82f9e5b-14bd-47bd-ab53-af6ba278ec71",
      "name": "Update the RecordManger",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1696,
        -576
      ],
      "parameters": {
        "columns": {
          "value": {
            "Id": "{{ $('Loop Over Items').item.json.id }}",
            "hashId": "{{ $('createHash').item.json.hash }}"
          },
          "schema": [
            {
              "id": "Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "hashId",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "hashId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HxJuA-ph6qvFmLzccKpM1XJeJHzELmvQzqJeqiRaC0U/edit#gid=0",
          "cachedResultName": "dataBase"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1HxJuA-ph6qvFmLzccKpM1XJeJHzELmvQzqJeqiRaC0U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HxJuA-ph6qvFmLzccKpM1XJeJHzELmvQzqJeqiRaC0U/edit?usp=drivesdk",
          "cachedResultName": "recordManger"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "a2d06bb3-fca2-474a-ae87-f86d0b81a140",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -640
      ],
      "parameters": {
        "width": 596,
        "height": 256,
        "content": "## Update the knowledge base\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d75115f8-e851-497e-8c74-99bbdd5c67cc",
      "name": "Download file1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1504,
        -880
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Loop Over Items').item.json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "97fe85f4-cc36-4282-8482-b6c2c8d21377",
      "name": "Download file2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1488,
        -560
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Loop Over Items').item.json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "4c136bf8-ce5e-426e-803e-822dcd48ad0d",
      "name": "create",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -3504,
        -1024
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1vQo4Er5h-4KEZoYCmHX-J4S9TRK5zpj-",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1vQo4Er5h-4KEZoYCmHX-J4S9TRK5zpj-",
          "cachedResultName": "manuals"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "afdb2eeb-1bbc-4e4e-b88c-b6b6edce4e3b",
      "name": "update",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -3488,
        -752
      ],
      "parameters": {
        "event": "fileUpdated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1vQo4Er5h-4KEZoYCmHX-J4S9TRK5zpj-",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1vQo4Er5h-4KEZoYCmHX-J4S9TRK5zpj-",
          "cachedResultName": "manuals"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "53021a9d-b61e-4682-94d5-863b67a9c8cb",
      "name": "nonDownloadableFile",
      "type": "n8n-nodes-base.if",
      "position": [
        -2736,
        -832
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "49a912d3-7bc7-434a-93d0-52e66c9e1024",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.mimeType }}",
              "rightValue": "application/vnd.google-apps.folder"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "86d2c9f9-315b-47c7-a30e-1b48b331e446",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2528,
        80
      ],
      "parameters": {
        "text": "=question:{{ $json.Question }}",
        "options": {
          "systemMessage": "=You are a helpful Manual assistant designed to answer employee questions based on Knowledge base.\n\nRetrieve relevant information from the provided internal documents and provide a concise, accurate, and informative answer to the employee's question.\n\nUse the tool called \"Knowledge base\" to retrieve any information from the manuals documents.\n\nIf the answer cannot be found in the provided documents, respond with \"I cannot find the answer in the available resources.\"\n\nyou must a extract the correct page number.\n\noutput should be in HTML format with simple formatting."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "f2a633af-f626-442a-b074-fd81a5ae5355",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2720,
        384
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5322950e-63d1-43cd-868b-5fee9c5eb324",
      "name": "Form",
      "type": "n8n-nodes-base.form",
      "position": [
        -2032,
        80
      ],
      "parameters": {
        "options": {
          "customCss": ".container {\n  max-width: 800px; /* wider for readability */\n  margin: 20px auto;\n  padding: 0 16px;\n  font-family: var(--font-family);\n}\n\n.card {\n  background: var(--color-card-bg);\n  border: 1px solid var(--color-card-border);\n  border-radius: var(--card-border-radius);\n  padding: var(--card-padding);\n  margin-bottom: var(--card-margin-bottom);\n  box-shadow: var(--box-shadow-card);\n  text-align: left;\n  line-height: 1.6;\n}\n\n.card .header h1 {\n  font-size: var(--font-size-header);\n  font-weight: var(--font-weight-bold);\n  margin-bottom: 12px;\n  color: var(--color-header);\n  border-bottom: 2px solid var(--color-focus-border);\n  padding-bottom: 6px;\n}\n\n.card .header h2 {\n  font-size: var(--font-size-html-h2);\n  margin: 1em 0 0.5em;\n  color: var(--color-header);\n  font-weight: var(--font-weight-bold);\n}\n\n.card .header p {\n  margin: 0.5em 0 1em;\n  font-size: var(--font-size-paragraph);\n  color: var(--color-html-text);\n}\n\n.card .header ul {\n  margin: 0.5em 0 1em 20px;\n  padding-left: 16px;\n}\n\n.card .header ul li {\n  margin-bottom: 6px;\n  line-height: 1.5;\n  color: var(--color-html-text);\n}\n\n.card .header b {\n  color: var(--color-header);\n}\n\n.card .header a {\n  color: var(--color-html-link);\n  text-decoration: none;\n  transition: color 0.2s ease;\n}\n.card .header a:hover {\n  color: #ff3a2a;\n  text-decoration: underline;\n}\n\n/* Responsive improvements */\n@media (max-width: 600px) {\n  .container {\n    max-width: 100%;\n    padding: 0 12px;\n  }\n  .card {\n    padding: 16px;\n  }\n  .card .header h1 {\n    font-size: 18px;\n  }\n  .card .header h2 {\n    font-size: 16px;\n  }\n}\n"
        },
        "operation": "completion",
        "completionTitle": "Result",
        "completionMessage": "={{ $json.output }}"
      },
      "typeVersion": 1
    },
    {
      "id": "bf604a8c-ebbf-4941-9617-45e97f72a1a5",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -3040,
        96
      ],
      "parameters": {
        "options": {
          "customCss": ":root {\n\t--font-family: 'Open Sans', sans-serif;\n\t--font-weight-normal: 400;\n\t--font-weight-bold: 600;\n\t--font-size-body: 12px;\n\t--font-size-label: 14px;\n\t--font-size-test-notice: 12px;\n\t--font-size-input: 14px;\n\t--font-size-header: 20px;\n\t--font-size-paragraph: 14px;\n\t--font-size-link: 12px;\n\t--font-size-error: 12px;\n\t--font-size-html-h1: 28px;\n\t--font-size-html-h2: 20px;\n\t--font-size-html-h3: 16px;\n\t--font-size-html-h4: 14px;\n\t--font-size-html-h5: 12px;\n\t--font-size-html-h6: 10px;\n\t--font-size-subheader: 14px;\n\n\t/* Colors */\n\t--color-background: #fbfcfe;\n\t--color-test-notice-text: #e6a23d;\n\t--color-test-notice-bg: #fefaf6;\n\t--color-test-notice-border: #f6dcb7;\n\t--color-card-bg: #ffffff;\n\t--color-card-border: #dbdfe7;\n\t--color-card-shadow: rgba(99, 77, 255, 0.06);\n\t--color-link: #7e8186;\n\t--color-header: #525356;\n\t--color-label: #555555;\n\t--color-input-border: #dbdfe7;\n\t--color-input-text: #71747A;\n\t--color-focus-border: rgb(90, 76, 194);\n\t--color-submit-btn-bg: #ff6d5a;\n\t--color-submit-btn-text: #ffffff;\n\t--color-error: #ea1f30;\n\t--color-required: #ff6d5a;\n\t--color-clear-button-bg: #7e8186;\n\t--color-html-text: #555;\n\t--color-html-link: #ff6d5a;\n\t--color-header-subtext: #7e8186;\n\n\t/* Border Radii */\n\t--border-radius-card: 8px;\n\t--border-radius-input: 6px;\n\t--border-radius-clear-btn: 50%;\n\t--card-border-radius: 8px;\n\n\t/* Spacing */\n\t--padding-container-top: 24px;\n\t--padding-card: 24px;\n\t--padding-test-notice-vertical: 12px;\n\t--padding-test-notice-horizontal: 24px;\n\t--margin-bottom-card: 16px;\n\t--padding-form-input: 12px;\n\t--card-padding: 24px;\n\t--card-margin-bottom: 16px;\n\n\t/* Dimensions */\n\t--container-width: 448px;\n\t--submit-btn-height: 48px;\n\t--checkbox-size: 18px;\n\n\t/* Others */\n\t--box-shadow-card: 0px 4px 16px 0px var(--color-card-shadow);\n\t--opacity-placeholder: 0.5;\n}",
          "appendAttribution": false
        },
        "formTitle": "Ask Knowledge base",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Question",
              "requiredField": true
            }
          ]
        },
        "responseMode": "lastNode"
      },
      "typeVersion": 2.2
    },
    {
      "id": "22fee510-de3c-4e27-8f2e-29a2ca83beb3",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -2448,
        576
      ],
      "parameters": {
        "model": "text-embedding-3-large",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1e2d81fc-f70d-4f4a-879e-12e5cab1b54d",
      "name": "Pinecone Vector Store2",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -2384,
        368
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {
          "pineconeNamespace": "pinecorn-namespce"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-nodes",
          "cachedResultName": "n8n-nodes"
        },
        "toolDescription": "call this to get the information from knowledgeable "
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "6c49249f-d5db-451c-bdf2-8b2f813c674c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3184,
        -64
      ],
      "parameters": {
        "width": 1488,
        "height": 800,
        "content": "## Ask Knowledge base"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "be0d8396-d94a-4e53-8c33-a2afca50bb99",
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Add to Record Manger",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update the RecordManger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create": {
      "main": [
        [
          {
            "node": "Search files and folders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update": {
      "main": [
        [
          {
            "node": "Search files and folders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "createHash": {
      "main": [
        [
          {
            "node": "searchRecordManger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "createHash",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Download file1": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file2": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "nonDownloadableFile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store2",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "searchRecordManger": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          },
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "nonDownloadableFile": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Record Manger": {
      "main": [
        [
          {
            "node": "Download file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "main": [
        []
      ]
    },
    "Pinecone Vector Store2": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update the RecordManger": {
      "main": [
        [
          {
            "node": "Download file2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search files and folders": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "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.

Pro

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

About this workflow

The IngestionDocs workflow is a fully automated **document ingestion and knowledge management system built with n8n**. Its purpose is to continuously ingest organizational documents from Google Drive, transform them into vector embeddings using OpenAI, store them in Pinecone,…

Source: https://n8n.io/workflows/8312/ — 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

Your AI workforce is ready. Are you?

Google Sheets Tool, Mcp Trigger, Google Drive +29
AI & RAG

This advanced n8n workflow automates the full lead enrichment, qualification, and personalized outreach process tailored specifically for the B2B real estate sector. Integrating top platforms like Api

N8N Nodes Fillout, OpenAI Chat, Pinecone Vector Store +11
AI & RAG

This n8n template automatically classifies incoming emails (Sales, Support, Internal, Finance, Promotions) and routes them to a dedicated OpenAI LLM Agent for processing. Depending on the category, th

OpenAI, Gmail, Text Classifier +16
AI & RAG

Automate Outreach Prospect automates finding, enriching, and messaging potential partners (like restaurants, malls, and bars) using Apify Google Maps scraping, Perplexity enrichment, OpenAI LLMs, Goog

@Devlikeapro/N8N Nodes Waha, Google Drive Trigger, @Apify/N8N Nodes Apify +14
AI & RAG

This simple philosophy changes the way we think about automated sales agents. Context changes everything. In this 4-part workflow, we start by creating a knowledge base that will act as context across

Pinecone Vector Store, Document Default Data Loader, Text Splitter Recursive Character Text Splitter +12