line-messaging-api

n8n node for LINE Messaging API integration

Package Information

Released: 11/18/2025
Downloads: 4 weeklyΒ /Β 2,108 monthly
Latest Version: 0.7.1
Author: warnyin

Documentation

πŸ“± LINE Messaging API for n8n

npm version
npm downloads
License: MIT

Powerful LINE Messaging API integration for n8n workflows

Send messages, manage users, and automate your LINE Official Account with ease

Installation β€’ Features β€’ Usage β€’ Examples β€’ Documentation


πŸš€ Installation

Option 1: Via n8n UI (Recommended)

  1. Open your n8n instance
  2. Navigate to Settings β†’ Community Nodes
  3. Click "Install a community node"
  4. Enter: @warnyin/n8n-nodes-line-messaging-api
  5. Click Install

Option 2: Manual Installation

npm install @warnyin/n8n-nodes-line-messaging-api

Option 3: Docker

Add to your environment variables:

N8N_COMMUNITY_PACKAGES=@warnyin/n8n-nodes-line-messaging-api

βš™οΈ Configuration

1. Create a LINE Messaging API Channel

  1. Visit LINE Developers Console
  2. Create a new Provider or select an existing one
  3. Create a Messaging API Channel
  4. Navigate to Messaging API tab
  5. Copy your Channel Access Token (issue one if needed)
  6. Copy your Channel Secret

2. Configure Credentials in n8n

  1. In n8n, go to Credentials β†’ New Credential
  2. Search for LINE Messaging API
  3. Paste your Channel Access Token
  4. Paste your Channel Secret
  5. Click Save to test the connection

3. Set Up Webhook (Optional - for receiving messages)

πŸ“‹ Click to expand webhook setup instructions

To receive messages from LINE users:

  1. In n8n, create a new workflow
  2. Add a Webhook node
  3. Set HTTP Method to POST
  4. Set Path to something like line-webhook
  5. Copy the Production URL (e.g., https://your-n8n.com/webhook/line-webhook)
  6. Go to LINE Developers Console
  7. Select your channel β†’ Messaging API tab
  8. Under Webhook settings, click Edit
  9. Paste your n8n webhook URL
  10. Toggle Use webhook to Enabled
  11. Click Verify to test

✨ Features

πŸ“¨ Message Operations

Operation Description Max Recipients
Push Send message to a specific user 1 user
Reply Reply to user messages (requires reply token) 1 user
Multicast Send message to multiple users 500 users
Broadcast Send message to all followers All followers

πŸ’¬ Message Types

Basic Messages

  • πŸ“ Text
  • πŸ–ΌοΈ Image
  • πŸŽ₯ Video
  • 🎡 Audio

Rich Messages

  • πŸ“ Location
  • 😊 Sticker
  • 🎨 Flex (JSON-based)

πŸ‘€ Profile Operations

  • Get User Profile: Retrieve user information (display name, picture URL, status message)

πŸ“– Usage

Basic Text Message

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  LINE Node  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Resource: Message
β”‚ Operation: Push
β”‚ User ID: U1234567890abcdef
β”‚ Message Type: Text
β”‚ Text: Hello from n8n! πŸ‘‹
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Reply to User Message

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Webhook Node │────▢│  LINE Node  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Receive LINE β”‚     β”‚ Resource: Message
β”‚ events       β”‚     β”‚ Operation: Reply
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚ Reply Token: {{$json.replyToken}}
                     β”‚ Message Type: Text
                     β”‚ Text: Thanks for your message!
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Send Image Message

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  LINE Node  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Resource: Message
β”‚ Operation: Push
β”‚ User ID: U1234567890abcdef
β”‚ Message Type: Image
β”‚ Original Content URL: https://example.com/image.jpg
β”‚ Preview Image URL: https://example.com/preview.jpg
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Send Flex Message

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  LINE Node  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Resource: Message
β”‚ Operation: Push
β”‚ User ID: U1234567890abcdef
β”‚ Message Type: Flex
β”‚ Alt Text: Product Information
β”‚ Flex Contents: {
β”‚   "type": "bubble",
β”‚   "body": {
β”‚     "type": "box",
β”‚     "layout": "vertical",
β”‚     "contents": [...]
β”‚   }
β”‚ }
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”„ Workflow Examples

Example 1: Auto-Reply Bot

Webhook (LINE) β†’ Code (Extract message) β†’ LINE (Reply)

Code Node:

const event = $input.item.json.events[0];
return {
  replyToken: event.replyToken,
  userMessage: event.message.text,
  userId: event.source.userId
};

Example 2: Broadcast Daily Updates

Schedule Trigger β†’ HTTP Request (Get data) β†’ LINE (Broadcast)

Example 3: User Info Lookup

Manual Trigger β†’ LINE (Get Profile) β†’ Set Node β†’ ...

πŸ› οΈ Development

Prerequisites

  • Node.js β‰₯ 14
  • npm or yarn

Local Setup

# Clone the repository
git clone https://github.com/warnyin/n8n-nodes-line-messaging-api.git
cd n8n-nodes-line-messaging-api

# Install dependencies
npm install

# Build the project
npm run build

# Link for local testing
npm link

# In your n8n directory
npm link @warnyin/n8n-nodes-line-messaging-api

Available Scripts

Command Description
npm run build Compile TypeScript and copy assets
npm run dev Watch mode for development
npm run lint Run ESLint
npm run lintfix Fix ESLint issues automatically
npm run format Format code with Prettier

πŸ“š Documentation

Official Resources

Useful Links


πŸ› Troubleshooting

Authentication failed - please check your credentials
  1. Verify your Channel Access Token is correct
  2. Ensure the token is a long-lived token (not short-lived)
  3. Check that the token hasn't expired
  4. Make sure you copied the token from the correct channel

The error message in v0.1.4+ will show detailed API responses to help debug.

Webhook not receiving messages
  1. Ensure webhook URL is publicly accessible (https required)
  2. Verify "Use webhook" is enabled in LINE console
  3. Check webhook URL matches exactly in LINE console
  4. Test webhook verification in LINE console
  5. Ensure n8n workflow is activated
Message sending fails
  1. Check User ID format is correct (starts with U)
  2. For replies, ensure reply token is valid (only usable once, expires in 1 minute)
  3. Verify message content meets LINE's requirements (e.g., URLs must be HTTPS)
  4. Check rate limits haven't been exceeded

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


⬆ back to top

Made with ❀️ for the n8n community

Discussion