Overview
This node allows sending various types of messages through the Line messaging platform, focusing here on the "Flex" message operation. Flex messages are highly customizable message formats that can include rich layouts and interactive elements. This node is useful when you want to send visually appealing and structured messages beyond simple text or images, such as product catalogs, event invitations, or complex notifications.
A practical example would be using the Flex message to create a card-like layout with images, buttons, and text blocks to showcase a product in an e-commerce chatbot.
Properties
| Name | Meaning |
|---|---|
| Alt Text | Alternative text shown in device notifications, talk lists, and quote messages as a fallback for the Flex message. Max 400 characters. |
| Flex Content | The JSON payload defining the Flex message layout and content. It must be a valid JSON string representing the Flex message structure created via a Flex simulator or manually crafted. |
Output
The node outputs an array of items where each item contains a json object with a message field. The message field holds an object describing the message to be sent, specifically:
- For the Flex operation, it includes:
type: always"flex"altText: the alternative text stringcontents: the parsed JSON object representing the Flex message layout
Example output snippet:
{
"json": {
"message": {
"type": "flex",
"altText": "Your alt text here",
"contents": { /* Flex message JSON object */ }
}
}
}
No binary data output is produced by this node.
Dependencies
- Requires a valid connection to the Line messaging API.
- Needs appropriate API credentials (such as an API key or token) configured in n8n to authenticate requests to Line.
- The user must provide correctly formatted Flex message JSON content; otherwise, parsing will fail.
Troubleshooting
- JSON Parsing Errors: If the Flex Content property contains invalid JSON, the node will throw a parsing error. Ensure the JSON is well-formed and valid according to the Flex message specification.
- Alt Text Length: The alternative text must not exceed 400 characters. Exceeding this limit may cause errors or message rejection.
- API Authentication Issues: Missing or incorrect API credentials will prevent message delivery. Verify that the API key/token is correctly set up in n8n.
- Invalid Flex Structure: Even if JSON parses correctly, an invalid Flex message structure may cause the Line API to reject the message. Use the official Flex simulator to validate your message payload before use.