Answer document questions with OpenAI, Pinecone, Cohere, Gemini and Google Drive
Ready for 3.0What this workflow does
This AI workflow has 24 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI Chat Model, Google Gemini Chat Model, Pinecone Vector Store and Embeddings OpenAI and 3 more.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Capture Request (Edit Fields (Set)): sets 4 fields: question, sessionId, cacheKey…
- Valid Question? (If): checks a condition and branches into true / false
- Look Up Cached Answer (Data table): get
- Respond Bad Request (Respond to Webhook): sends the response back to the webhook caller
- Fresh Cache Hit? (If): checks a condition and branches into true / false
- Respond From Cache (Respond to Webhook): sends the response back to the webhook caller
- Document Q&A Agent (AI Agent): runs an AI agent, with model: Answer Model, Fallback Answer Model; 1 tool (Document Knowledge Base); memory: Conversation Memory; output parser: Answer Format
- Grounded Answer? (If): checks a condition and branches into true / false
- Collect Unique Sources (Code): runs custom JavaScript code
- Respond Not Found (Respond to Webhook): sends the response back to the webhook caller
…plus 6 more steps. See the full node list below.
Services it uses
Other OpenAI + Google Sheets templates (2,011) · Other Google Gemini + Google Sheets templates (819) · Other Google Drive + Google Sheets templates (720)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (17)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook - Data table
n8n-nodes-base.dataTable - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Reranker Cohere
@n8n/n8n-nodes-langchain.rerankerCohere - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Code
n8n-nodes-base.code - Google Drive
n8n-nodes-base.googleDrive - Aggregate
n8n-nodes-base.aggregate - Google Sheets
n8n-nodes-base.googleSheets
From the author
Quick overview This workflow exposes a webhook-powered document Q&A chatbot that searches a Pinecone vector database with OpenAI embeddings, reranks results with Cohere, optionally falls back to Google Gemini, and returns an answer with quoted sources plus…