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 <token>) 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.