Chat with a Google Sheet using AI
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.
What to replace before upgrading
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (11)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - Edit Fields (Set)
n8n-nodes-base.set - Google Sheets
n8n-nodes-base.googleSheets - Switch
n8n-nodes-base.switch - Filter
n8n-nodes-base.filter - Code
n8n-nodes-base.code
What it does
This workflow allows you to ask questions about the data in a Google Sheet over a chat interface. It uses n8n's built-in chat, but could be modified to work with Slack, Teams, WhatsApp, etc. Behind the scenes, the workflow uses GPT4, so you'll need to have an OpenAI API key that supports it. How it works The workflow uses an AI agent with custom tools that call a sub-workflow. That sub-workflow reads the Google Sheet and returns information from it. Because models have a context window (and therefore a maximum number of characters they can accept), we can't pass the whole Google Sheet to GPT - at least not for big sheets. So we provide three ways of querying less data, that can be used in combination to answer questions. Those three functions are: 1. List all the columns in the sheet 2. Get all values of a single column 3. Get all values of a single row Note that to use this template, you need to be on n8n version 1.19.4 or later.