Run a 24/7 website chatbot with OpenAI, Google Sheets, and Gmail
Ready for 3.0What this workflow does
This AI workflow has 16 nodes and runs when a chat message arrives. Along the way it connects OpenAI Chat Model, Data table, Google Sheets and Gmail.
How it runs
Trigger: When a chat message arrives.
- Validate Input (Edit Fields (Set)): sets 3 fields: sessionId, userMessage, receivedAt
- Input Is Valid? (If): checks a condition and branches into true / false
- AI Chatbot Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 1 tool (Knowledge Base Search); memory: Visitor Session Memory; output parser: Grounded Answer Parser
- Empty Message Response (Edit Fields (Set)): sets 1 field: output
- Lead Ready? (If): checks a condition and branches into true / false
- Save Lead To Google Sheets (Google Sheets): append
- Answer Supported? (If): checks a condition and branches into true / false
- Notify Owner via Gmail (Gmail): uses Gmail
- Send Answer (Edit Fields (Set)): sets 1 field: output
- Log Unanswered Question (Data table): uses Data table
…plus 1 more step. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
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 (11)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Data Table Tool
n8n-nodes-base.dataTableTool - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Sheets
n8n-nodes-base.googleSheets - Gmail
n8n-nodes-base.gmail - Data table
n8n-nodes-base.dataTable
From the author
Quick Overview This workflow powers an @n8n/chat website widget that answers visitor questions using an n8n Data Table knowledge base via OpenAI, keeps per-session memory, captures leads to Google Sheets only with consent, emails you via Gmail, and logs…