Generate BigQuery SQL from natural language queries using GPT-4o chat
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This AI workflow has 11 nodes and runs when a chat message arrives. Along the way it connects OpenAI Chat Model and Google BigQuery.
How it runs
Trigger: When a chat message arrives.
- Output all table, and column names in your schema (Google BigQuery): uses Google BigQuery
- combine the table names with user question (Merge): merges the data from its input branches
- Combine into one field (Aggregate): combines items into one
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; memory: Simple Memory; output parser: Structured Output Parser
- Convert table names and columns into single text for agent (Code): runs custom JavaScript code
- Run query against schema (Google BigQuery): uses Google BigQuery
- Ask User to try another question (Code): runs custom JavaScript code
Services it uses
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 (9)
- Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Google BigQuery
n8n-nodes-base.googleBigQuery - Aggregate
n8n-nodes-base.aggregate - Code
n8n-nodes-base.code - Merge
n8n-nodes-base.merge - AI Agent
@n8n/n8n-nodes-langchain.agent
From the author
Give business users a chat box; get back valid BigQuery SQL and live query results. The workflow: 1. Captures a plain-language question from a chat widget or internal portal. 2. Fetches the current table + column schema from your BigQuery dataset (via…