n8n

How to Connect Google Drive Q and A with Citations?

Turn a document from Google Drive into a live Q and A chat with clear sources. Teams can ask questions and get short answers with citations to the exact parts of the file. This is useful for support, onboarding, and policy questions.

The flow loads a file from Google Drive, splits it into readable chunks, and stores the chunks in Pinecone for fast search. OpenAI creates vector embeddings so the system can find the most relevant parts. A chat trigger listens for questions, finds the top four matching chunks, and formats them. OpenAI then writes a clear answer and the workflow adds citations so people can trust the result.

You need a Google Drive link to the file, an OpenAI API key, and a Pinecone project with an index set to 1536 dimensions. Expect faster answers and fewer repeated questions. This setup helps support agents, HR teams, and operations teams handle long documents without digging through pages. Most questions go from 20 to 30 minutes of reading to under a minute of chat.

What are the key features?

  • Manual setup step loads a Google Drive file by URL and downloads it for processing
  • Recursive text splitter creates 3000 character chunks with 200 character overlap for better context
  • OpenAI embeddings convert each chunk into vectors for accurate search
  • Pinecone vector store saves and retrieves chunks using a 1536 dimension index
  • Chat trigger collects user questions and searches for the top 4 matching chunks
  • Code step formats the retrieved chunks before sending them to the language model
  • Answer and citation steps generate a clear reply and include source links and file names

What are the benefits?

  • Reduce document search time from 30 minutes to 1 minute per question
  • Automate up to 80 percent of common document questions with reliable sources
  • Improve answer consistency by using the same document every time
  • Handle hundreds of pages by splitting text into 3000 character chunks
  • Connect Google Drive, OpenAI, and Pinecone in one flow for end to end Q and A

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 Download file node. In the Credential to connect with field, click Create new credential and connect your Google Drive account. Approve access and save.
  4. Open an OpenAI node in the workflow. In the credential dropdown, click Create new credential, paste your OpenAI API key from your OpenAI account API page, and save.
  5. Open a Pinecone node. In the credential dropdown, click Create new credential, then paste your Pinecone API key and environment from the Pinecone console. Save.
  6. In your Pinecone console, create an index with 1536 dimensions. Copy the index name. In both Pinecone nodes in n8n, select this index so insert and search use the same place.
  7. In Google Drive, set your file sharing to Anyone with the link and copy the file link. In the Set file URL in Google Drive node, paste the link into the file_url field and save.
  8. Click Execute Workflow to run the manual setup. This fetches the file, splits it, creates embeddings, and inserts vectors into Pinecone. Check the Pinecone console to confirm vectors were added.
  9. Start the chat by clicking the Chat button or opening the chat endpoint. Ask a question and confirm the reply includes citations from your file.
  10. Adjust the Set max chunks to send to model node if you want more or fewer chunks retrieved. More chunks may improve recall but can increase model cost.
  11. If you see no results or errors, check index name and dimensions, confirm your file link is valid and shared, and verify your OpenAI and Pinecone credentials. If you change the file, update the file_url and run the manual setup again to reindex. Avoid running the insert step multiple times unless you mean to reinsert content.

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.