Latenode

Sync LINE chat history to Google Sheets and get AI-powered responses

This template receives LINE messages on a webhook, loads that user's prior turns from Google Sheets, asks Gemini for a reply, logs the new turn, and sends the reply through the LINE Messaging API.

Connect Google Sheets and Google AI. Put the Google AI API key on the Google AI connection. Put the LINE channel access token in the JavaScript node. Paste the Latenode webhook URL into the LINE Official Account webhook.

Updated Sep 16, 2026Est. run: 15sEst. cost: $0.0009
How Latenode estimates time and cost

Latenode bills workflow runtime in CPU seconds. The first 10,000 CPU seconds are free each month, then usage follows pay-as-you-go CPU-second pricing. Plug-and-Play (PnP) AI nodes are billed separately—each PnP token is $1 USD, charged pay-as-you-go at vendor cost plus a small processing fee, with no API keys required.

Full pricing — how CPU seconds work →

Workflow preview

What this template does

  • Replies to LINE users with conversation context
  • Stores chat history in Google Sheets
  • Writes replies with Gemini
  • Keeps the LINE channel access token in the JavaScript node

How it works

1
Trigger

Receive the LINE message

A webhook receives the payload when a LINE user sends a message.

2
Action

Load chat history

Google Sheets returns prior messages for that user id so Gemini has context.

3
AI

Write the reply

Gemini reads the current message plus history and returns a reply. Put the Google AI API key on the Google AI connection.

4
Action

Log and reply on LINE

Google Sheets appends the new turn. JavaScript posts the reply to LINE. Put the LINE channel access token in that JavaScript node.

Setup guide

1

Add a webhook trigger

Add a webhook trigger and copy its URL. In the LINE Official Account developer console, set that URL as the webhook.

2

Connect Google Sheets

Add a Google Sheets connection. Use columns for user id, timestamp, role, and message so each conversation can be looked up.

3

Connect Google AI

Add a Google AI connection and paste your Google AI API key there. Send Gemini the current LINE message plus the rows you loaded from Sheets.

4

Reply on LINE

In JavaScript, read reply token and user id from the webhook, post the Gemini text to the LINE Messaging API, and append both turns to Sheets. Put the LINE channel access token in that JavaScript node. Send a test LINE message and confirm the reply.

Requirements

A LINE Official Account that can POST to the Latenode webhook
A LINE channel access token stored in the JavaScript node
A Google Sheet Latenode can read and append to
A Google AI API key stored on the Google AI connection

FAQ

Common questions about this template

Each run uses credits on your Latenode plan. We charge for processing time (1 credit = 30 seconds). Your actual cost depends on your plan and how long the run takes. See pricing plans for plans and how credits work.