Overview
This node implements a webhook trigger for the Line messaging platform. It listens for incoming HTTP requests from Line's webhook system, verifies their authenticity using a signature check, and then routes different types of Line events (such as messages, postbacks, joins, leaves, etc.) to separate outputs.
Common scenarios where this node is beneficial include:
- Automating responses or workflows based on user messages or interactions in a Line chat.
- Handling various event types from Line, such as when users join or leave groups.
- Integrating Line messaging events into broader automation pipelines within n8n.
For example, you could use this node to listen for text messages sent by users on Line and trigger a workflow that sends back automated replies or logs the messages for analysis.
Properties
Name | Meaning |
---|---|
Path | The URL path segment on which the webhook listens for incoming Line events. For example, if set to "line-webhook", the webhook will respond to requests at /line-webhook . This must be unique and is required. |
Output
The node outputs multiple streams corresponding to different Line event types. Each output returns an array of JSON objects representing the events of that type received in the webhook call.
The possible outputs correspond to these event types:
- Text message
- Audio message
- Sticker message
- Image message
- Video message
- Location message
- Postback event
- Join event
- Leave event
- Member joined event
- Member left event
Each output item contains a JSON object with two main fields:
destination
: The ID of the destination (e.g., the bot or group receiving the event).event
: The full event object as received from Line, including details like event type, timestamp, source, and message content.
No binary data is output by this node.
Dependencies
- Requires an API authentication credential containing a secret key used to verify the webhook signature (
channel_secret
). - The node depends on the
crypto
module for HMAC SHA256 signature verification. - Must be configured with a valid webhook URL accessible by Line's servers, matching the specified Path property.
- Requires proper setup of the Line Messaging API to send webhook events to this URL.
Troubleshooting
- Signature Verification Failure: If the webhook signature header is missing or does not match the expected HMAC signature, the node responds with HTTP 500 and no workflow execution occurs. Ensure the correct secret key is configured and that Line is sending the signature header properly.
- Missing Credentials: If the API authentication credential is not provided or lacks the necessary secret, the node throws an error and rejects webhook calls.
- Incorrect Path Configuration: If the Path property does not match the actual webhook URL registered with Line, events will not reach the node.
- No Events in Payload: If the incoming request body does not contain any events, the node outputs empty arrays on all outputs.