Line Chatbot with Google Sheets as Memory
detail.loadingPreview
A Line chatbot that uses Google Sheets to store and retrieve conversation history for AI interactions.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This workflow enables a Line chatbot to maintain conversational memory by leveraging Google Sheets. It captures user messages, retrieves past interactions from Google Sheets, sends them along with the current message to an AI agent for context-aware responses, and then updates the Google Sheet with the latest conversation history.
Key Features
- Integrates with Line messaging platform via webhook.
- Uses Google Sheets as a persistent memory for conversation history.
- Utilizes an AI Agent (potentially Gemini) for generating contextually relevant responses.
- Stores up to 4 archived conversation turns along with the current history.
- Sends replies back to the user via the Line API.
How To Use
- Set up Line Developer Account: Create a Line Official Account and obtain Channel Access Token.
- Set up Google Cloud Project: Enable Google Sheets API and authenticate your service account or OAuth2 credentials.
- Create a Google Sheet: Design a sheet with columns for 'UserID ', 'History', 'LastUpdated', and 'History_Archive_1' through 'History_Archive_4'.
- Configure n8n:
- Set up the Webhook node with your Line webhook URL and verify it.
- Configure the Google Sheets nodes ('Get History' and 'Save History') with your Google Sheets credentials and the correct Document ID and Sheet Name.
- Set up the AI Agent node with your desired AI model and system message.
- Adjust the Edit Fields nodes to correctly map incoming Line message data.
- Configure the Prepare Prompt node to correctly construct the prompt for the AI, including conversation history.
- Set the HTTP Request node with your Line messaging API endpoint and Channel Access Token for sending replies.
- Deploy and Test: Activate the workflow and send messages to your Line bot to test its memory functionality.
Apps Used
Workflow JSON
{
"id": "e111b74e-f9db-4e6c-bc37-f72c6311e507",
"name": "Line Chatbot with Google Sheets as Memory",
"nodes": 0,
"category": "AI & Chatbots",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: e111b74e-f9db...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
Youtube Discord Bot (Unverified)
A Discord bot that answers questions about YouTube videos using AI.
Telegram AI Assistant with Long Term Memory & Note Storage
An AI assistant for Telegram that leverages long-term memory and note-taking capabilities.
Slack AI Assistant with Webhook Integration
This workflow sets up a Slack AI assistant that responds to messages received via a webhook. It uses Google Gemini Chat Model for AI processing and a Window Buffer Memory node to maintain conversation history.
Chatbot Pizza Order Automation
Automates pizza orders via a chatbot interface, handling menu inquiries, order placement, and status checks.
Build a WhatsApp AI Concierge for Hotels with n8n
Automate hotel guest inquiries with an n8n WhatsApp chatbot. This workflow uses an AI node to process messages against a hotel encyclopedia, ensuring accurate and professional responses.
Telegram Profanity & Toxicity Filter
This n8n workflow automatically monitors incoming Telegram messages for profanity and toxic language. It leverages Google's Perspective API to analyze message content, and if a message is deemed inappropriate, the workflow sends an automated warning response back to the sender.