Use this comprehensive n8n workflow to deploy a high-fidelity RAG chatbot. It connects Google Drive files directly to the OpenAI Assistants API, serving responses via an interactive n8n trigger.
Download this n8n workflow template and start using it instantly.
Developing conversational AI that provides accurate, context-specific answers requires Retrieval-Augmented Generation (RAG). This powerful n8n workflow streamlines the entire process, allowing you to turn unstructured documents (like a Google Doc on a Music Festival) into an intelligent, queryable knowledge base using the OpenAI Assistants API.
This specific n8n workflow handles document retrieval, secure upload to OpenAI, setup of the Assistant with strict instructions (ensuring adherence to the source document), and deployment through a chat-based n8n trigger. This structure ensures that your chatbot provides highly relevant and accurate information, making it one of the most effective n8n templates for knowledge retrieval use cases. The included sticky notes offer guidance on expanding this core logic to platforms like WhatsApp or Telegram.
This n8n workflow operates in two phases: Setup and Execution.
gpt-4-turbo-preview model, enables Knowledge Retrieval, and applies a comprehensive system prompt ('instructions'). These instructions rigorously enforce that the Assistant uses only the attached document for answers, ensuring high retrieval fidelity.To deploy this powerful n8n workflow, follow these steps:
File ID parameter to point to the document you wish the Assistant to learn from. When clicking "Test workflow" (Manual Trigger): Used solely for manual testing of the initial setup phase (file upload and assistant creation). Although disabled, this standard n8n trigger is useful for first-time runs.
Get File (Google Drive n8n node): Downloads the source document. Key configuration includes using a specific File ID and enabling conversion to PDF format via the Google File Conversion option.
Upload File to OpenAI (OpenAI n8n node): Manages the file transfer to OpenAI's server storage, setting the file purpose to assistants for RAG capabilities.
Create new Assistant (OpenAI n8n node): The core configuration step. It sets the Assistant name, uses gpt-4-turbo-preview, enables knowledgeRetrieval, and inputs strict instructions to limit the Assistant's responses only to the uploaded document data.
Chat Trigger (@n8n/n8n-nodes-langchain.chatTrigger): This critical n8n trigger serves as the interactive entry point for the workflow, listening for external chat inputs via a webhook.
OpenAI Assistant (OpenAI n8n node): Executes the chat conversation using the established Assistant ID. It takes the input from the 'Chat Trigger' and routes it through the pre-configured RAG model, delivering a document-based answer. This is the final step in the live n8n workflow execution.
Create a powerful n8n workflow for autonomous AI research using OpenRouter, SerpAPI, and Jina AI. Generate comprehensive, structured reports from any user query.

Use this comprehensive n8n workflow template to automate the capture and organization of all media and text sent via Telegram, syncing it instantly to Notion, Google Drive, and Google Sheets for archival and project management.

Automate a scheduled, one-way synchronization of new contacts from Pipedrive directly into HubSpot using this robust n8n workflow template, preventing duplicate records.

Automate company profile enrichment. This n8n workflow scrapes website content, uses the OpenAI n8n node for data classification (B2B, industry, value prop), and updates Google Sheets automatically. Find more n8n templates.

Automate OpenAI DALL-E image editing using a custom n8n workflow. Trigger edits with a prompt and source image, then convert the Base64 output back to a file using an n8n node.








































