{
  "id": "OceYxCmiuf5W2X4y",
  "meta": {
    "instanceId": "16d5a69b6a4f4733c8f669903729902650204c895b060993271b9227d7b0b3e8",
    "templateCredsSetupCompleted": true
  },
  "name": "Bundle RAG Upload",
  "tags": [],
  "nodes": [
    {
      "id": "e72ec6be-08f3-4195-b429-34c0870ee1bc",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        180,
        0
      ],
      "parameters": {
        "filter": {
          "folderId": {
            "__rl": true,
            "mode": "list",
            "value": "17cefWWyf-yKZVpCLHFVOlpfuqQpLl8QW",
            "cachedResultUrl": "https://drive.google.com/drive/folders/17cefWWyf-yKZVpCLHFVOlpfuqQpLl8QW",
            "cachedResultName": "Folder for n8n"
          }
        },
        "options": {},
        "resource": "fileFolder",
        "returnAll": true
      },
      "credentials": {
        "googleDriveOAuth2Api": {}
      },
      "typeVersion": 3
    },
    {
      "id": "82a0bcb2-35e0-4897-b2a5-2e8d22fdec43",
      "name": "Get Docs",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        440,
        0
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {}
      },
      "typeVersion": 3
    },
    {
      "id": "61fc1b10-4a5e-4f12-82c1-c1c7d64c7901",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        660,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "95a8e03c-bd70-4742-b4ad-6bf3a9b484a2",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        900,
        20
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "pineconeNamespace": "Redacted"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "Redacted",
          "cachedResultName": "Redacted"
        }
      },
      "credentials": {
        "pineconeApi": {}
      },
      "typeVersion": 1
    },
    {
      "id": "8d762bd6-d64f-4e01-bf9d-8183b7cd7555",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        920,
        160
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "80c20301-9fdd-455a-85eb-f0f5b12091be",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1060,
        240
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "Type",
                "value": "Redacted"
              }
            ]
          }
        },
        "dataType": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "9b849c85-fa99-4f2d-bdd5-02fababbc361",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1140,
        380
      ],
      "parameters": {
        "options": {},
        "chunkSize": 600,
        "chunkOverlap": 60
      },
      "typeVersion": 1
    },
    {
      "id": "a18e5576-6e16-487f-9347-2de39ecd7708",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -60,
        0
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": ""
      },
      "credentials": {
        "googleDriveOAuth2Api": {}
      },
      "typeVersion": 1
    },
    {
      "id": "b82cc00a-56f9-41e9-9257-9a054c971db7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -120
      ],
      "parameters": {
        "color": 4,
        "width": 260,
        "height": 400,
        "content": "Google Folder Upload Trigger"
      },
      "typeVersion": 1
    },
    {
      "id": "aca97112-2f76-44ab-b5ae-aa232bd1242c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        -120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 400,
        "content": "Google Search File from Folder"
      },
      "typeVersion": 1
    },
    {
      "id": "7cf71e7a-db76-43b5-a8fd-c377ac4187aa",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -120
      ],
      "parameters": {
        "color": 2,
        "width": 220,
        "height": 400,
        "content": "Get File"
      },
      "typeVersion": 1
    },
    {
      "id": "ee27b02f-4d74-49f7-a3fd-5d0e928ac556",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        -120
      ],
      "parameters": {
        "color": 3,
        "width": 500,
        "height": 680,
        "content": "Upload to Pinecone Vector"
      },
      "typeVersion": 1
    },
    {
      "id": "ec38ac32-c4a8-47fb-9312-c8804590a891",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -120
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 400,
        "content": "Loop for multiple files"
      },
      "typeVersion": 1
    },
    {
      "id": "4db0ce4b-77d2-4875-963c-10f61438128e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -120
      ],
      "parameters": {
        "color": 3,
        "width": 580,
        "height": 1300,
        "content": "🧠 Google Drive Upload Trigger → Pinecone Vector Upsert for Document Indexing\n\n📄 What This Workflow Does\nThis workflow watches a specific Google Drive folder and automatically uploads any newly added document to a Pinecone vector database — complete with OpenAI-generated embeddings.\n\nPerfect for setting up retrieval-augmented generation (RAG) pipelines, semantic search, or document Q&A systems. Once configured, your knowledge base stays up-to-date with zero manual effort.\n\nWatch Full Video Step-by-step guide here:\nhttps://www.youtube.com/@Automatewithmarc\n\n🔧 How It Works\n📁 Google Drive Trigger\nWatches a specific folder and triggers when new documents are uploaded.\n\n🔍 Google Drive File Search & Download\nFinds and fetches all files in the folder.\n\n🔄 Loop Over Each File\nHandles batch processing for multiple files.\n\n📃 Document Loader\nParses each file as binary and applies custom metadata like document type.\n\n✂️ Text Splitter\nBreaks content into manageable chunks for embedding (e.g., 600 characters, 60 overlap).\n\n🧠 OpenAI Embeddings\nGenerates vector embeddings using OpenAI.\n\n📦 Pinecone Vector Store\nInserts/upserts documents into a specific Pinecone namespace for search-ready indexing.\n\n🧠 Why This is Useful\nThis is a production-grade setup for:\n\nBuilding vector search tools over internal docs\n\nFeeding up-to-date data into RAG agents or chatbots\n\nAuto-tagging and chunking files for scalable AI workflows\n\nWhether you’re indexing document outlines, SOPs, or technical docs — this automation keeps your vector store fresh and organized.\n\n🪜 Setup Instructions\nConnect your Google Drive, OpenAI, and Pinecone accounts.\n\nSpecify the Google Drive folder to monitor.\n\nCustomize metadata, chunk size, or vector namespace as needed.\n\nActivate the workflow and drop a file into the folder — magic happens behind the scenes.\n\n📌 Notes\nWorks best with PDFs or text-based documents.\n\nYou can swap out OpenAI with other embedding models if needed.\n\nConsider adding notifications or logging (e.g., via Slack or email) for better observability."
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {
    "Default Data Loader": [
      {
        "json": {
          "isArtificialRecoveredEventItem": true
        }
      }
    ],
    "Recursive Character Text Splitter": [
      {
        "json": {
          "isArtificialRecoveredEventItem": true
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f3a17075-083e-42bc-acfb-c4480b2fe716",
  "connections": {
    "Get Docs": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Get Docs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}