Deploy a powerful n8n workflow using BigQuery and OpenAI for RAG. Answer user questions instantly based on your documentation using this advanced n8n template.
Download this n8n workflow template and start using it instantly.
Tech documentation teams seeking to create an automated Q&A assistant.
Automation specialists looking for advanced n8n templates integrating BigQuery and OpenAI.
Users who need to leverage existing BigQuery data infrastructure for Retrieval-Augmented Generation (RAG).
Developers aiming to deploy scalable RAG solutions within the n8n environment.
This comprehensive n8n workflow addresses the challenge of building a robust RAG system when your enterprise data (documentation) resides in Google BigQuery, and you prefer using OpenAI’s powerful Language Models (LLMs) and embeddings. While BigQuery does not natively integrate with OpenAI Cloud models for RAG, this n8n template bridges that gap.
The primary n8n trigger is a chat interface, making it ideal for immediate user queries. The system operates by intelligently routing the user question to a separate retrieval sub-routine. This sub-routine handles creating the vector embedding using an n8n node, querying BigQuery, and returning the most relevant documents. The main n8n workflow then uses these retrieved documents to formulate an accurate and detailed answer via the AI Agent, formatted specifically for clarity and technical accuracy (Markdown, code blocks, etc.). This powerful n8n workflow maximizes efficiency by leveraging existing infrastructure.
This advanced n8n workflow operates in two closely linked phases: the Agent front-end and the BigQuery retrieval back-end.
When chat message received n8n trigger, initiating the process upon user input.AI Agent n8n node, which is configured with a specialized system prompt for answering questions about n8n documentation and instructed to use an external tool for retrieval.BigQuery RAG OpenAI tool, passing the user's question as the input (vectorsearchquestion).When Executed by Another Workflow n8n trigger activates the retrieval sub-routine, receiving the question.OpenAI - Create Embedding n8n node sends the question to the OpenAI API using the text-embedding-3-large model to generate a high-quality vector embedding.BigQuery - Vector Retriever n8n node executes a SQL query that leverages BigQuery’s VECTOR_SEARCH functionality. It uses the newly created embedding vector to find the 10 most relevant documents (based on cosine similarity) in the BigQuery vector table.AI Agent receives the retrieved documents and uses the OpenAI Chat Model (GPT-4.1 Mini) along with conversation history (managed by the Simple Memory n8n node) to generate the final, comprehensive, Markdown-formatted response for the user.To utilize this n8n workflow template, follow these steps:
BigQuery - Vector Retriever - n8n docs n8n node within the sub-routine. with your specific Google Cloud Project ID.n8n-docs-rag.n8ndocs.n8ndocs_embeddings) is updated if you are using your own custom RAG data source. This powerful n8n template is designed to work with BigQuery vector stores. When chat message received (n8n Trigger): The starting point of the main n8n workflow. It waits for incoming chat messages to begin the RAG process.
AI Agent (n8n node): Orchestrates the conversation. It uses a detailed system message instructing it to leverage the connected tool and format the output in Markdown. It uses memory for context.
OpenAI Chat Model (n8n node): The Language Model used by the Agent. Configured to use gpt-4.1-mini for cost efficiency in this n8n template.
BigQuery RAG OpenAI (n8n Tool Workflow): This is the crucial connection n8n node that calls the retrieval sub-workflow (the RAG logic) whenever documentation is needed.
When Executed by Another Workflow (n8n Trigger): The n8n trigger for the sub-routine, activated only when called by the AI Agent tool, receiving the vectorsearchquestion.
OpenAI - Create Embedding (n8n node): An HTTP Request n8n node dedicated to calling the OpenAI /v1/embeddings API. It uses the text-embedding-3-large model to convert the question into a vector for the search.
BigQuery - Vector Retriever - n8n docs (n8n node): An HTTP Request n8n node that performs the BigQuery API call. It executes a VECTOR_SEARCH SQL query using the embedding generated by the previous n8n node, retrieving the top 10 relevant documents from the vector store.
Documents retrieved (n8n node): A Set n8n node that bundles the results (rows) from the BigQuery query into a single documents field, preparing them for return to the main AI Agent for final answer synthesis. This step ensures clean data passage back to the main n8n workflow.
Automate customer service on WhatsApp using this n8n workflow. Deploy an AI Sales Agent powered by GPT-4o and a PDF-based RAG knowledge base for instant product query answers using the n8n trigger.

Use this powerful n8n workflow to deploy a Retrieval-Augmented Generation (RAG) powered Code of Conduct Q&A chatbot directly into Slack using GPT-4 and vector storage. Easily customize this n8n template.

Use this efficient n8n workflow to automatically anonymize faces and license plates in uploaded media. This n8n template utilizes the BlurIt API for high-volume privacy compliance.

Deploy a cutting-edge Retrieval-Augmented Generation (RAG) system using this advanced n8n workflow. Integrate Supabase, OpenAI embeddings, and Cohere reranking for precise, context-aware answers from your documents.

Deploy a powerful n8n workflow to create a Telegram chatbot that performs factual web searches using Tavily and summarizes reliable answers using the GPT-5 model for fast, grounded replies.

I am passionate about transforming complex processes into seamless automations with n8n. My expertise spans across creating ETL pipelines, sales automations, and data & AI-driven workflows. As an avid problem solver, I thrive on optimizing workflows to drive efficiency and innovation.







































