Reply to LINE customer chats with Google Gemini and log to Google Sheets

Go to Workflow
0 views
Built by Oka Hironobu Oka Hironobu
Created on August 09, 2026

Description

Quick Overview
This workflow turns a LINE Official Account into an AI chat assistant by receiving customer messages via a webhook, generating a reply with Google Gemini, sending the response through the LINE Messaging API, and logging each conversation to Google Sheets.

How it works
Receives incoming LINE Messaging API events through a POST webhook.
Extracts the reply token, user ID, and message text from the LINE event payload.
Skips processing when the incoming event does not contain a text message.
Adds a predefined brand name and support persona to guide the reply style.
Sends the customer message and persona instructions to Google Gemini to generate a short, helpful response in the customer’s language.
Replies to the customer via the LINE Messaging API using the reply token and then appends the exchange to a Google Sheets log.

Setup
In your LINE Official Account settings, enable webhooks and set the workflow’s webhook URL as the channel webhook endpoint.
Add a LINE channel access token as an HTTP Header Auth credential (Authorization: Bearer ) for the LINE Messaging API request.
Add Google Gemini (PaLM) API credentials for the Gemini chat model.
Add Google Sheets OAuth credentials, select the target spreadsheet, and ensure a sheet (for example, “LINE Log”) exists for appending conversation rows.
Update the brand name and persona text to match your business tone and response rules.

Nodes Used (5)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
Google Sheets
n8n-nodes-base.googleSheets
HTTP Request
n8n-nodes-base.httpRequest