This workflow creates an AI chatbot for answering employee queries using company documents stored in Google Drive, leveraging Retrieval-Augmented Generation (RAG). Key nodes include Google Drive File Created/Updated Triggers (monitor folder changes), Validate File Event (checks file type), Sanitize File Data (cleans metadata), Download File From Google Drive (retrieves files), Store in Pinecone Vector Database (stores embeddings), Chat Message Trigger (receives queries), Company Documents Assistant (processes queries with Google Gemini), and Format Final Response (delivers answers). Error handlers (File Validation Error, File Size Error, Vector Store Configuration Error, Agent Response Error) ensure robust processing.\n\nSetup Requirements and Configuration: Install n8n from n8n.io for self-hosting or sign up at cloud.n8n.io. Obtain Google Drive OAuth2 credentials from console.developers.google.com, a Google Gemini API key from makersuite.google.com, and a Pinecone API key from pinecone.io. Import the JSON workflow in n8n. Configure Google Drive File Created/Updated Triggers, Google Gemini Chat Model, Google Gemini Embeddings, and Pinecone Vector Retrieval with credentials under ‘Credentials.’ Set environment variables GOOGLE_DRIVE_FOLDER_ID, PINECONE_API_KEY, GOOGLE_GEMINI_API_KEY, ENABLE_VECTOR_STORAGE, PINECONE_INDEX_NAME, and ENABLE_RAG_CHAT. Ensure internet access for API calls. Set up Chat Message Trigger with a public webhook URL in n8n settings.\n\nTesting and Deployment Steps: Activate the workflow to generate the chat webhook URL. Upload a test PDF or DOCX (under 50MB) to the specified Google Drive folder. Verify Vector Storage Success output for successful document processing. Send a test query (e.g., “What’s the company vacation policy?”) via Chat Message Trigger. Check Format Final Response for accurate, document-based answers. Monitor n8n logs for errors like ‘Invalid Google Drive credentials,’ ‘Pinecone API key missing,’ or ‘Unsupported file type.’ File Validation Error triggers for non-PDF/DOCX files, File Size Error for files over 50MB. Test invalid queries (e.g., over 1000 characters) to trigger Chat Validation Error. Debug using logs for credential or API issues. Confirm Pinecone storage and chatbot responses align with document content.
$6.99
Workflow steps: 35
Integrated apps: googleDriveTrigger, if, set