RAG-Powered Chatbot Using Google Drive, OpenAI, and Pinecone Assistant - n8n Workflow

Build a comprehensive RAG pipeline using an n8n workflow. Sync Google Drive documents to Pinecone Assistant and enable real-time, context-aware chatting with OpenAI integration. Explore powerful n8n templates for AI.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • AI/ML Engineers: Seeking robust, ready-made RAG implementation using Pinecone and n8n.

  • Technical Content Managers: Needing an automated way to query proprietary documents stored in Google Drive.

  • n8n Users: Looking for advanced n8n workflow examples leveraging LangChain agents, HTTP requests, and multiple n8n trigger types.

  • Automation Specialists: Who want to deploy powerful n8n templates integrating cloud storage and vector databases.

Overview

Leveraging the power of vector databases and large language models, this n8n workflow provides a seamless system for ingesting documents from Google Drive and making them instantly searchable and chat-able. The complexity of managing document updates and deletions is automated entirely by the n8n template logic.

This specific n8n workflow solves the problem of keeping your knowledge base synchronized. When a file is added or updated in a monitored Google Drive folder, the n8n trigger ensures the document is automatically uploaded to Pinecone Assistant, and any old versions are correctly deleted. A separate chat interface, initiated by an n8n trigger, uses an AI agent, powered by the OpenAI Chat Model and the Pinecone Assistant retrieval tool, to deliver highly accurate, context-aware responses based on your proprietary documentation. This is a foundational n8n template for any organization utilizing RAG.

How it Works

The n8n workflow operates in two distinct logical paths:

Path 1: Document Synchronization (Google Drive to Pinecone)


  1. Triggering Ingestion: The process starts with two n8n trigger nodes: 'File added' and 'File updated'. These Google Drive n8n node components monitor a specific folder (e.g., n8n-pinecone-demo) for new or modified documents.

  2. Handling Updates (Deletion and Re-ingestion): If a file is updated, the n8n workflow first executes an HTTP Request n8n node ('Get file to delete') to find the corresponding vector record in Pinecone using the external file ID. It then uses the 'Delete file from assistant' n8n node to remove the old vector data before proceeding to re-ingest the new version.

  3. Download and Upload: The 'Download file' n8n node fetches the binary data from Google Drive. The 'Upload file to assistant' HTTP Request n8n node then sends this binary data as a multipart-form-data payload to the Pinecone Assistant API endpoint.

  4. Status Check Loop: The workflow uses a loop structure ('Check file status', 'End if status Available', 'Wait' n8n node) to constantly poll Pinecone until the document processing status changes from 'Processing' to 'Available', ensuring the RAG data is fully ready before the ingestion branch concludes.

Path 2: RAG Chat Interface


  1. Chat Trigger: The 'Chat input' LangChain Chat n8n trigger node activates the conversation using a webhook.

  2. Agent Orchestration: The 'AI Agent' n8n node uses LangChain to orchestrate the RAG query. It connects the conversation inputs to the Large Language Model and the retrieval tool.

  3. LLM and Memory: The agent uses the 'OpenAI Chat Model' n8n node for generating responses and the 'Conversation Memory' n8n node to maintain context throughout the chat session.

  4. Retrieval Tool: The core RAG component is the 'Pinecone Assistant' n8n node (using the MCP Client Tool). This n8n node queries the dedicated Pinecone Assistant endpoint, retrieving relevant context from the synced Google Drive documents, which is then passed to the OpenAI model for generating the final, accurate answer.

Installation Guide

To deploy this powerful n8n workflow, follow these setup steps:


  1. Import: Import the provided n8n workflow JSON into your n8n instance.

  2. Pinecone Setup: Create a Pinecone Assistant named n8n-assistant in the Pinecone Console. Configure the credentials for the Pinecone API Key (used for HTTP Requests) and the Bearer token (used for the Pinecone Assistant LangChain n8n node).

  3. Google Drive Credentials: Set up the Google Drive OAuth2 API credential in n8n. Ensure this credential is named Google Drive account and is properly configured with your client ID and secret, allowing the Google Drive n8n trigger nodes to function.

  4. OpenAI Setup: Create an OpenAI API Key credential and link it to the 'OpenAI Chat Model' n8n node.

  5. Folder Configuration: Ensure your Google Drive trigger nodes are configured to monitor the correct folder where your documents reside (default is n8n-pinecone-demo).

  6. Activation: Activate the n8n workflow. The ingestion path will automatically start syncing files, and the chat path will be ready to receive requests via its webhook.

Node Details

File added / File updated (Google Drive Trigger n8n node): These are the starting n8n trigger points for document ingestion. They monitor a specified folder for creation or modification events, initiating the RAG update process.
Download file (Google Drive n8n node): Fetches the binary content of the file detected by the n8n trigger, essential for uploading to Pinecone.
Upload file to assistant (HTTP Request n8n node): Manages the primary data ingestion. It sends the file binary data and relevant metadata (Google Drive ID/Name) to the Pinecone Assistant API.
Delete file from assistant (HTTP Request n8n node): Executed during file updates. This n8n node ensures that old vector embeddings corresponding to the updated document are removed from Pinecone, maintaining data freshness.
Chat input (LangChain Chat Trigger n8n node): The dedicated n8n trigger for the RAG query. It exposes a webhook URL to receive chat messages.
AI Agent (LangChain Agent n8n node): The core orchestration unit. It determines whether to use the 'Pinecone Assistant' tool or simply generate a response using the 'OpenAI Chat Model', depending on the user's query.


  • Pinecone Assistant (LangChain MCP Client Tool n8n node): Configured as the retrieval tool for the AI Agent, this n8n node connects directly to Pinecone's managed RAG service to pull relevant document chunks.

Related n8n Workflows

Free

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by

Helping you build knowledgeable AI.

Featured*