n8n

How to Automate LINE Chat Support and Scheduling?

Turn LINE chats into fast, helpful replies. An AI assistant answers questions, checks Gmail for updates, and creates calendar events without leaving the chat. It suits support teams that handle many customer messages and also book calls or visits.

Messages arrive through a webhook from LINE. A switch checks if the input is text, then a smart agent with user memory and a GPT 4o mini model plans the answer. The agent can read Gmail, check or create Google Calendar events, and pull quick facts from Wikipedia when needed. A second OpenAI step cleans and shortens the text so it is easy to read. If the message is not text or an error happens, a safe fallback reply goes back. A set node removes messy line breaks, then n8n posts the reply to the LINE API.

Setup needs a LINE channel access token, an OpenAI API key, and Google OAuth for Calendar and Gmail. Add the webhook URL in the LINE console and place your token in the HTTP header. Expect fewer manual replies, faster first response, and easy booking inside chat. Many teams cut reply time by over half and reduce context switching between tools. Use it for customer questions, appointment booking, simple order checks, and quick info requests on LINE.

What are the key features?

  • LINE webhook receives incoming messages and starts the flow
  • Message type switch routes text to AI and non text to a safe reply
  • AI agent with user memory keeps context across messages using the user ID
  • OpenAI chat model plans and writes the response
  • Wikipedia, Gmail Read, and Google Calendar Create and Read are available as tools for the agent
  • Second OpenAI step condenses the answer into a short, easy format
  • Text cleanup removes bad line breaks before sending the LINE reply

What are the benefits?

  • Reduce manual replies by up to 60 percent with AI drafted answers
  • Cut first response time from minutes to seconds for LINE chats
  • Simplify booking by creating calendar events directly from chat
  • Lower context switching by unifying LINE, Gmail, and Calendar in one flow
  • Improve answer clarity with automatic text cleanup and formatting

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with LINE Messaging API, OpenAI, Google Calendar, Gmail and Wikipedia. See the Tools Required section above for links to create accounts with these services.
  3. In the LINE Developers console, create a Messaging API channel and copy your Channel access token. In the channel settings, add the n8n webhook URL from the Line Receiving node as the webhook URL and enable it.
  4. In n8n, open the HTTP Request nodes that send replies to LINE and set the Authorization header to Bearer followed by your LINE Channel access token.
  5. For OpenAI, double click the OpenAI nodes and in the Credential to connect with dropdown click Create new credential. Enter your OpenAI API key and save.
  6. For Google Calendar, open the Google Calendar Create and Google Calendar Read nodes. In the credentials dropdown choose Create new credential and follow the on screen OAuth steps to connect your Google account.
  7. For Gmail Read tool, open the Gmail node, choose Create new credential, and complete the OAuth steps to allow read access.
  8. Confirm the Line Receiving node path matches your configured webhook route. Click the node to copy the full URL if needed and verify it in the LINE console.
  9. Check the AI Agent node system message and memory settings. The session key uses the LINE user ID so conversations keep context per user.
  10. Send a test text message to your LINE bot. You should get a clear AI reply. Try asking to create a meeting to verify Google Calendar create works.
  11. If you send a sticker or image, you should receive the fallback message. If no reply arrives, check the HTTP Request headers and the LINE webhook status page for errors.
  12. Review logs in n8n for any errors from OpenAI or Google. Adjust timeouts and ensure scopes include Gmail read and Calendar access.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Google Calendar

Sign up

Free: $0; all Google Calendar API usage is at no additional cost; quota limits apply (no charges for overages).

LINE Messaging API

Sign up

Free plan (Communication): $0 / mo, 500 messages / mo (USA/Other regions)

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Wikipedia

Sign up

Free: $0 (public Wikimedia APIs). Enterprise Free: $0 with 5,000 on‑demand requests / mo and twice‑monthly snapshots

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.