AutomationMart
Home/Browse/Line chatbot with Google Sheets memory and Gemini AI
n8n

Line chatbot with Google Sheets memory and Gemini AI

n8nn8n9 modulesv1.0
Google SheetsGemini

Main Use Case This workflow enables automated, AI-assisted replies to users messaging a LINE Official Account, while storing and referencing chat history from Google Sheets to maintain context. Ideal for businesses or support teams that want to provide smart, personalized customer interactions using AI with memory. How It Works (Step-by-Step) 1. Connect to LINE Official Account's API A Webhook listens for incoming messages from users on LINE. When a message is received, it triggers the workflo

At a glance

Line chatbot with Google Sheets memory and Gemini AI is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Google Sheets, Gemini. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Google Sheets, Gemini
Modules
9
Price
Free
Version
v1.0
Line chatbot with Google Sheets memory and Gemini AI workflow diagram

About this workflow

Main Use Case This workflow enables automated, AI-assisted replies to users messaging a LINE Official Account, while storing and referencing chat history from Google Sheets to maintain context. Ideal for businesses or support teams that want to provide smart, personalized customer interactions using AI with memory. How It Works (Step-by-Step) 1. Connect to LINE Official Account's API A Webhook listens for incoming messages from users on LINE. When a message is received, it triggers the workflow. 2. Prepare the Data An Edit Fields module structures incoming data (e.g. extracts user ID, message content). This ensures data is clean and usable downstream. 3. Retrieve Chat History The user’s previous conversations are fetched from a Google Sheet. This ensures the AI has memory and can continue conversations contextually. 4. Prepare Prompt The retrieved chat history is combined with the new message to form a complete prompt for the AI. Example format: “User previously said X. Now they said Y. How should we respond?” 5. AI Agent: Google Gemini The formatted prompt is passed to an AI Agent (Google Gemini Chat Model). The AI generates a response based on the message + history. Tools used: Chat ModeMemory, ToolOutputParser for accurate replies. 6. Split & Clean History The conversation history is split into smaller chunks for cleaning and storage. This ensures the Google Sheet remains readable and manageable over time. 7. Save Chat History The cleaned new message and AI reply are saved to Google Sheets. This updates the chat history for future context. 8. Send Reply to LINE The AI-generated reply is sent back to the user via a POST HTTP Request to the LINE Messaging API. How to Set Up Prerequisites: LINE Official Account Google Sheet to store chat history Google Gemini API or AI agent with context memory Automation platform (e.g., n8n, as this seems visually similar) Step-by-Step: 1. Create a Webhook on LINE: Set the webhook URL to your automation service. Enable webhook events. 2. Design Your Google Sheet: Create a sheet with columns: User ID, Timestamp, Message, AI Reply. 3. Set Up Modules in Automation Platform: Webhook: receives user messages. Edit Fields: extract user ID and message. Google Sheets Read: fetch message history. Prompt Composer: format prompt using past history + new message. AI Agent: connect to Google Gemini for smart replies. Split & Clean: clean and chunk history if needed. Google Sheets Write: save the updated conversation. HTTP Request: send reply to LINE via Messaging API. 4. Test Your Workflow: Send a message from LINE. Watch the full loop: receive → process → AI → store → reply. 5. Deploy & Monitor: Ensure error handling is in place (e.g., for blank messages or failed API calls). Regularly check your Google Sheets for storage limits. (If limits reached, you can increase the history row.) 📦 Benefits Maintains context in conversations Personalized, AI-driven responses Easy history tracking via Google Sheets Fully automated and scalable

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Cybersecurity Intelligence: Create Daily Digest & Viral Topics with Gemini AI

This n8n workflow template simplifies the process of digesting cybersecurity reports by summarizing, deduplicating, organizing, and identifying viral topics of interest into daily emails. It will generate two types of emails: - A daily digest with summaries of deduplicated cybersecurity reports organized into various topics. - A daily viral topic report with summaries of recurring topics that have been identified over the last seven days. This workflow supports threat intelligence analysts dig

Free

Send appointment SMS follow-ups with Typeform, Twilio, and Google Sheets

How it works - 📋 Customer submits your Typeform → instant personalised welcome SMS fires via Twilio - 📊 Submission logged to Google Sheets with name, phone, timestamp, and nudge tracking - 💬 Twilio listens 24/7 for replies → marks customer as responded, stops all future nudges - ⏰ Scheduler runs every 6 hours → finds non-responders and sends up to 2 follow-up nudges - 🛑 System stops contacting anyone who replies or hits the 2-nudge limit The three branches | Branch | Trigger | What it d

Free

Automate email tracking & generate pixel for lead nurturing with Google Sheet

This workflow automates the process of sending personalized lead-nurturing emails and tracking when each recipient opens the message through a custom tracking pixel. It integrates Google Sheets, Gmail, OpenAI, and webhooks to generate, deliver, and monitor engagement with your email sequence. It sends personalized emails containing a unique, invisible tracking pixel and then monitors who opens the email by detecting when the pixel is loaded, logging the activity back to a Google Sheets CRM. ---

Free

Create a WordPress post for every new message from 2 Anthropic Claude prompts based on Google Sheets row updates

Get your WordPress posts generated on auto-pilot from 2 Anthropic Claude prompts (title and content) when a Google Sheets row updates, streamlining content creation.

Free

Create rows in Google Sheets for new Postmark inbound emails

Every time an Inbound email is received in your Postmark, Make will add rows with information on it in your Google Sheets. This scenario requires your sheet to be configured like (this)[https://docs.google.com/spreadsheets/d/1vSKBQ_WKpLwq7FBhIE-dFe5BoI5Ci3OxHo3l25cfJHw/edit?usp=sharing].

Free

Watch Google Sheets rows and send data via HTTP action

Automatically monitor Google Sheets for new rows and send the data as JSON via HTTP action, streamlining data integration and communication.

Free

Automate Telegram message processing - separate text and files 💬📁

Introduction Tired of manually downloading a file through different Telegram messages? This workflow acts as a smart receptionist for your Telegram bot, automatically processing incoming messages to cleanly separate text from file attachments, getting them ready for any automation you can dream up! 📥 --- 🎯 What This Does This workflow solves the challenge of handling varied Telegram messages within a single automation workflow. Incoming messages can be just text, just a file, or a

Free

Scrape B2B leads from Apollo, generate Groq AI emails, and send via Gmail

This n8n workflow automates your entire B2B outreach pipeline from lead discovery to personalized cold email delivery. Submit a form, let Apollo find and enrich your leads, review AI-generated emails in your sheet and send them all with one click. How it works - Form Trigger accepts Job Title, Location and Number of Leads to kick off the workflow - Apollo searches for matching people and enriches each lead with email, phone, LinkedIn URL and company data - Duplicate check runs automatically to s

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free