💬 Line Message API : push message & reply

10,339 views · 💬 Support Chatbots

Description

Workflow Description

This workflow demonstrates how to use the LINE Messaging API to handle two scenarios:

  1. Replying to a user’s message using a reply token.
  2. Sending a push message to a specific LINE user using their user ID.

Key Features

  1. Webhook Integration: Receives and processes incoming messages from LINE using a webhook.
  2. Conditional Logic: Checks if the received event type is a message and handles it accordingly.
  3. Reply Message: Automatically responds to the user’s message using the LINE reply token.
  4. Push Message: Sends a test message to a specific LINE user using their unique user ID.

Pre-Configuration

To simplify the setup process, create a Header Auth credential in n8n:


Node Configurations

1.1. Webhook from LINE Message


1.2. If Condition


1.3. Line: Reply with Token


2.1. Manual Trigger: Test Workflow


2.2. Edit Fields


2.3. Line: Push Message


工作流程描述

此工作流程展示如何使用 LINE Messaging API 處理兩種情境:

  1. 使用 reply token 回應使用者的訊息。
  2. 使用使用者的 user ID 發送 推播訊息

主要功能

  1. Webhook 整合:透過 Webhook 接收並處理來自 LINE 的訊息。
  2. 條件邏輯:檢查接收到的事件類型是否為訊息並進行處理。
  3. 回應訊息:使用 LINE 的 reply token 自動回覆使用者的訊息。
  4. 推播訊息:使用 LINE User ID 向指定用戶發送測試訊息。

預先設定

為簡化設定流程,請在 n8n 中建立 Header Auth 憑證:


節點設定

1.1. Webhook from LINE Message


1.2. If 條件判斷


1.3. Line: Reply with Token


2.1. 手動觸發:測試工作流程


2.2. Edit Fields


2.3. Line: 推播訊息

🔗 Nodes Used

HTTP Request, Webhook

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup