---
title: "LINE chatbot that answers with Claude"
kind: "Kit"
category: "Business"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/f283d6c6-fbc9-41ca-a8b6-0e31d334337e"
updated: "2026-11-12"
---

# LINE chatbot that answers with Claude

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow for a LINE Official Account. LINE sends each message to a webhook, Claude writes a short reply in the same language, and the workflow sends it back through LINE’s reply API.

LINE chatbot that answers with Claude is an n8n workflow in the Business category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow lets a LINE Official Account answer with Claude. LINE posts every message to the webhook. A Code node picks out the first text message, and Claude writes a short reply in the language the person used. The workflow sends that reply back with LINE’s reply API. Five nodes do the work, and none of them is a sticky note.

### Who it suits

Small shops, community managers and developers who run a LINE account and want a first-line assistant. Skip it if you need the bot to remember a customer or to hand over to a person. As imported, each message is answered alone, and nothing checks that LINE sent it.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Retail | Shop owners | Answer common questions from customers on LINE | A bakery adds its opening hours to the system line, and the bot answers when someone asks about Sunday. |
| Communities | Group admins | Give members a helper that replies in their own language | A language club’s account answers an Indonesian message in Indonesian. |
| Software | Bot builders | Start from a working webhook and reply loop | A developer adds a second Claude call that summarizes long messages. |
| Education | Tutors | Let students practice writing by chatting | A tutor’s account answers an English practice sentence with a short correction. |

You need some n8n and a LINE developer account: import a file, set two environment values and paste in a webhook address.

### Where to use it

Any n8n that LINE can reach over HTTPS will run it. The reply lands in the same LINE chat as the question.

- n8n Cloud: import the file into a new workflow there
- Your own n8n server: the same file, behind an HTTPS address LINE can reach
- A LINE Official Account: the channel’s webhook URL points at the workflow
- Another chat app: swap the reply node for that app’s API

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. The two secrets are read from the server’s environment.

What you need first

| Need | Detail |
| --- | --- |
| n8n | Reachable over HTTPS, on n8n Cloud or on a server of your own |
| LINE | An Official Account with the Messaging API on, and its channel access token, read as \`LINE\_CHANNEL\_ACCESS\_TOKEN\` |
| Anthropic | An API key, read as \`ANTHROPIC\_API\_KEY\` |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Give n8n the key and the token. Set `ANTHROPIC_API_KEY` and `LINE_CHANNEL_ACCESS_TOKEN` as environment variables on the server, or replace the two `$env` expressions in `Ask Claude` and `Reply via LINE` with the values.
3. Save and publish the workflow, then copy the production address from `LINE Webhook`.
4. In the LINE Developers console, paste that address as the webhook URL, click Verify and turn Use webhook on.
5. Send the account a text message and wait for Claude’s reply.

### How to use it

Message the account in LINE. Claude’s reply follows in the same chat. Stickers, images and other kinds of event get no reply.

What to change for a different result

| To change | Where |
| --- | --- |
| The bot’s character | The \`system\` line in \`Ask Claude\` |
| The length of a reply | \`max\_tokens\` in the same node |
| The model | \`model\` in the same node |
| What it answers | The code in \`Extract Message\` |

### Example

A club member writes in Indonesian to ask how to join next week’s meetup.

Claude answers in Indonesian, in a few sentences, within its 500-token cap. The LINE chat shows the reply as a text message from the account.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. LINE’s call enters at the left, the middle boxes ask Claude, and the box on the right sends the answer back to LINE. Message the account once, then open the run to see what each box handled.

**For experts.** The reply token in each event is what lets the workflow answer without a user ID.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`LINE Webhook\` | Webhook 2 on POST, with the answer sent by a Respond to Webhook node | It hands the call to \`Extract Message\` and to \`Return 200\` |
| \`Extract Message\` | A Code node that finds the first text event in \`body.events\` | Any other event returns nothing, which ends that branch |
| \`Ask Claude\` | Posts to \`https://api.anthropic.com/v1/messages\` with \`claude-opus-4-5\` | Up to 500 tokens, one message and no history |
| \`Reply via LINE\` | Posts to \`https://api.line.me/v2/bot/message/reply\` | Uses the event’s reply token and sends one text |
| \`Return 200\` | Respond to Webhook 1 with the text \`OK\` | It runs last, after the reply branch |

### Good to know

Nothing checks that a call came from LINE, and the bot has no memory.

- Models: Anthropic’s deprecations page, read on 12 November 2026, lists \`claude-opus-4-5\` as active, with a retirement date no sooner than 24 November 2026 and no replacement named. Check the page, or set a newer Claude model in \`Ask Claude\`
- Repairs: the original copy read the request from the wrong place, so it never found a message and never replied. Its two JSON bodies broke on any line break or quote, and a comment claimed a signature check that was not there. Mindket’s copy fixes the first two and corrects the comment
- Signature: LINE signs each webhook with an \`x-line-signature\` header. Nothing here checks it, so anyone who finds the address can send fake events that spend your key. LINE’s documentation says to verify it before processing an event
- Waiting: \`Return 200\` runs after the reply branch, so LINE waits for Claude. When the Claude call or the reply fails, LINE does not get its \`OK\`
- No memory: Claude sees only the one message, and only the first text event in a call is answered
- Billing: LINE’s pricing page, read on 12 November 2026, leaves reply messages out of a plan’s message count. Anthropic bills one call for each message
- Your data: the message goes to Anthropic, and the answer goes back through LINE
- Credentials: the JSON holds none

## README

```markdown
# LINE chatbot that answers with Claude

An n8n workflow that connects a LINE Official Account to Claude. LINE sends each message to a webhook, the workflow pulls out
the first text message, Claude writes a short reply in the same language, and the workflow sends it back through LINE's reply
API.

## What is inside

- `workflow.json`: the workflow as n8n exports it, five nodes, none of them a sticky note. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- `Extract Message` read the call as `$input.first().json`. A Webhook node hands over `headers`, `params`, `query` and `body`,
  so the `events` list was never found and the bot never replied. It now reads `$input.first().json.body`.
- Its first comment said it validated the LINE signature. The code never did, so the comment now says it does not.
- The Claude request and the LINE reply placed raw text between quotes in their JSON bodies, so any message or answer with a
  line break or a quote broke them. Each value now goes through `JSON.stringify(...).slice(1, -1)`.
- The webhook ID is gone.
- Nothing else. The key, the token and the model are the file's own.

## Before you start

- An n8n instance reachable from the internet over HTTPS, on n8n Cloud or your own server. LINE's webhook URL must use HTTPS with a
  certificate from a widely trusted authority, and self-signed ones are refused.
- A LINE Official Account with the Messaging API turned on, and its channel access token.
- An Anthropic API key.
- A way to set two environment variables on the n8n server, or a willingness to type the values into the nodes.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Give n8n the two secrets. The file reads them as `{{ $env.ANTHROPIC_API_KEY }}` in the `x-api-key` header of `Ask Claude`,
   and as `Bearer {{ $env.LINE_CHANNEL_ACCESS_TOKEN }}` in the Authorization header of `Reply via LINE`. Set both as
   environment variables on the server, or replace each expression with the value itself.
3. Save and publish the workflow. Copy the production address from `LINE Webhook`.
4. In the LINE Developers console, paste that address as the channel's webhook URL, click Verify and turn Use webhook on.
5. Send your account a text message and wait for Claude's reply.

## How a run goes

1. `LINE Webhook` (Webhook 2) takes LINE's POST and passes the call to `Extract Message` and to `Return 200`.
2. `Extract Message` (Code) looks through `body.events` for the first event that is a text message, and keeps `userId`,
   `replyToken` and the text. Stickers, images and other events end that branch here.
3. `Ask Claude` posts the text to `https://api.anthropic.com/v1/messages` with `claude-opus-4-5`, up to 500 tokens and a system
   line that asks for a short reply in whatever language the person wrote.
4. `Reply via LINE` posts Claude's answer to `https://api.line.me/v2/bot/message/reply` with the reply token.
5. `Return 200` answers LINE with `OK`. n8n finishes the upper branch first, so this comes last.

## Change the look

- The bot's character: the `system` line in `Ask Claude`.
- The model and the length: `model` and `max_tokens` in the same node.
- What it answers: the Code node. Add more event types, or keep earlier messages by `userId`.

## Good to know

- Anthropic's deprecations page, read on 12 November 2026, lists `claude-opus-4-5` (`claude-opus-4-5-20251101` there) as active,
  with a retirement date no sooner than 24 November 2026 and no replacement named yet. Check the page before relying on it,
  or change `model` in `Ask Claude` to a newer Claude model.
- Each message is answered alone. Claude sees only the one message, with no earlier turns.
- LINE signs every webhook with an `x-line-signature` header. Nothing in this workflow checks it, so anyone who finds the
  address can send fake events, and each text one spends your Anthropic key. LINE's documentation says to verify the signature
  before processing an event.
- `Return 200` runs after the reply branch, so LINE waits for Claude. When the Claude call or the reply fails, the run stops before
  `Return 200` and LINE does not get its `OK`.
- The workflow answers only the first text event in a call.
- Reply messages do not count toward a LINE plan's monthly message count, according to LINE's pricing page, read on
  12 November 2026.
- A LINE reply holds up to five message objects. This one sends a single text.
- The message goes to Anthropic, and the answer goes back through LINE.
```

## What is in it

3 files, 9 KB, downloaded as a zip.

```text
NOTICE.md  583 B
README.md  4 KB
workflow.json  4 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 5 steps, starting when its webhook is called
- AI: No step calls an AI model
- Sign-ins: No sign-in
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 4 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/f283d6c6-fbc9-41ca-a8b6-0e31d334337e)
- [Its page on Mindket](https://mindket.com/p/f283d6c6-fbc9-41ca-a8b6-0e31d334337e)
