n8n

How to Connect Google Drive to Q and A Search?

Turn your files into a simple chat experience. Team members can ask a question and get a clear answer with citations to the exact parts of the document. It is great for policies, product docs, or long PDFs that are hard to scan.

Here is how it works. You click run to pull a file from Google Drive. The flow adds basic metadata, splits the text into small chunks, creates vector embeddings with an AI model, and saves them in Pinecone for fast search. A chat input then turns each question into an embedding, finds the top matching chunks in Pinecone, and sends only a set number of chunks to the AI model. The model is guided to return a structured result with an answer and citation indices. The flow then maps those indices back to the source text and builds a clean response with citations.

To set it up, you need Google Drive access, an OpenAI API key, and a Pinecone index with 1536 dimensions. Expect faster answers and fewer back and forth messages since each reply cites the source. This is useful for onboarding, compliance, and support teams that need quick, trusted answers from large documents.

What are the key features?

  • Manual trigger indexes a selected Google Drive file on demand
  • File metadata is captured with a Code node for file name and extension
  • Binary content is loaded and split into small chunks for better search
  • Embeddings are generated with OpenAI for each chunk
  • Chunks are stored in Pinecone for vector search with 1536 dimensions
  • Chat Trigger accepts questions and limits results to a set number of chunks
  • Top matching chunks are fetched from Pinecone for each query
  • AI chat model answers using only the provided chunks and avoids guessing
  • Structured output parser enforces answers with citation indices
  • Final response composer maps indices to source and adds clear citations

What are the benefits?

  • Reduce manual document search from 20 minutes to under 2 minutes per question
  • Automate up to 80 percent of repetitive Q and A on internal documents
  • Increase trust with source citations for every answer
  • Handle thousands of pages by storing chunks in Pinecone
  • Connect Google Drive, OpenAI and Pinecone in one flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Drive, OpenAI and Pinecone. See the Tools Required section above for links to create accounts with these services.
  3. In n8n, open the Google Drive node and create a new Google Drive credential. Follow the on screen steps to connect your Google account and grant file read access.
  4. Open the OpenAI nodes and create a new OpenAI API Key credential. Generate an API key from your OpenAI account, paste it into n8n, and save.
  5. Open the Pinecone nodes and create a new Pinecone API credential. From your Pinecone dashboard, copy your API key and environment, paste them into n8n, and save.
  6. In your Pinecone dashboard, create an index with 1536 dimensions. Use the same index name in both Pinecone nodes inside n8n.
  7. In the Set node, paste the share link to your Google Drive file. Ensure the connected Google account has access to the file.
  8. Click Execute Workflow to index the document. Note that running the index step multiple times will insert duplicates, so index once per file version.
  9. Open the Chat Trigger panel in n8n and send a test question related to the document. Confirm the reply includes source citations.
  10. If the reply is empty, check that the Pinecone index name and dimensions match, the OpenAI key is valid, and the Drive link opens for the connected account.
  11. Adjust the Set max chunks node to tune speed versus context size. Fewer chunks are faster, more chunks may improve answer quality.
  12. Use the node execution logs to inspect embeddings, retrieved chunks, and the final composed response if you need to troubleshoot.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Pinecone

Sign up

Starter (Free): $0 / mo; includes 2 GB storage, 2M write units / mo, 1M read units / mo, up to 5 indexes; API access.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.