Build an SEO chatbot with GPT-4o-mini using your Google Sheets data
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) 5. AI Agent — SEO Consultant (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (7)
- Edit Fields (Set)
n8n-nodes-base.set - Google Sheets
n8n-nodes-base.googleSheets - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger
What it does
Description Add your approved SEO Q&A pairs to a Google Sheet, activate the workflow, and share the chat URL with your team or clients. The chatbot reads your entire knowledge base on every question and answers strictly from your own content — never from outside sources. Every conversation is automatically logged to a second sheet so you can track common questions and improve your knowledge base over time. Built for SEO agencies, consultants, and marketing teams who want a branded AI assistant without hallucinated or off-brand answers. --- What This Workflow Does - Reads your knowledge base live — Pulls all Q&A rows from your Google Sheet on every question so answers always reflect your latest approved content - Answers strictly from your content — GPT-4o-mini is instructed to never use outside knowledge, keeping every response on-brand and accurate - Delivers an honest fallback — If a question is not covered in your sheet, the bot tells the user directly and points them to your support team instead of guessing - Maintains conversation memory — Users can ask follow-up questions naturally without repeating context, just like a real chat - Logs every exchange automatically — Appends each session ID, timestamp, question, and answer to a Chat Log sheet for analytics and gap identification - Returns the reply in real time — The answer is sent back to the chat interface instantly at the same time as it is being logged --- Setup Requirements Tools Needed - n8n instance (self-hosted or cloud) - OpenAI account with GPT-4o-mini API access - Google account with two Google Sheets (one for the knowledge base, one for the chat log) Credentials Required - OpenAI API key - Google Sheets OAuth2 (used in two steps — read and log) > ⚠️ Google Sheets OAuth2 appears in 2 steps — connect it in both 3. Google Sheets — Read Knowledge Base and 9. Google Sheets — Log Chat Estimated Setup Time: 15–20 minutes --- Step-by-Step Setup 1. Import the workflow — Open n8n → Workflows → Import from JSON → paste the workflow JSON → click Import 2. Create your Knowledge Base sheet — Open Google Sheets → create a new sheet → add a tab named exactly SEO FAQ → add these four column headers in row 1: Question, Answer, Category, Last Updated → fill in at least 5–10 Q&A rows before testing 3. Create your Chat Log sheet — In the same Google Sheet or a separate one → add a tab named exactly Chat Log → add these four column headers in row 1: Session ID, Timestamp, User Question, Bot Answer 4. Fill in Config Values — Open node 2. Set — Config Values → replace all placeholders: | Field | What to enter | |---|---| | YOURKNOWLEDGEBASESHEETID | The ID from your Knowledge Base sheet URL (the string between /d/ and /edit) | | SEO FAQ | Leave as-is, or change to match your tab name exactly | | YOURCHATLOGSHEETID | The ID from your Chat Log sheet URL (same method) | | Chat Log | Leave as-is, or change to match your log tab name exactly | | YOUR COMPANY NAME | Your agency or business name | | botPersona | Edit the persona description to match your brand voice | 5. Connect Google Sheets for reading — Open node 3. Google Sheets — Read Knowledge Base → click the credential dropdown → add Google Sheets OAuth2 → sign in with your Google account → authorize access 6. Connect OpenAI — Open node 6. OpenAI — GPT-4o-mini Model → click the credential dropdown → add your OpenAI API key → test the connection 7. Connect Google Sheets for logging — Open node 9. Google Sheets — Log Chat → click the credential dropdown → select the same Google Sheets OAuth2 credential you connected in step 5 8. Activate the workflow — Toggle the workflow to Active → click on node 1. Chat Message Received → copy the Chat URL shown → share this URL with your team or embed it in your site --- How It Works (Step by Step) Step 1 — Chat Trigger: Receive User Question This step creates a public chat interface at a shareable URL. Every time a user types a message and hits send, that message is passed to the next step aut