Lola Message Composer
Lola Message Composer, a node to compose a message structure to send to Lola Assistant
Overview
The Lola Message Composer node is designed to construct a standardized message object for use with the Lola Assistant. It allows users to compose messages from various sources (such as Telegram, WhatsApp, Chatwoot Omnichannel, or custom parameters) and prepares them in a format suitable for downstream processing or sending to the Lola Assistant. This node is particularly useful when integrating chatbots or automating communication workflows across multiple messaging platforms.
Common scenarios:
- Normalizing incoming messages from different chat platforms before passing them to Lola Assistant.
- Creating custom messages with specific user and chat details for testing or advanced automation.
- Automatically detecting and handling the language of incoming messages.
Practical examples:
- A workflow that receives messages from Telegram, uses this node to standardize the message structure, and then sends it to Lola Assistant for further processing.
- Composing a custom message with an image attachment and sending it to Lola Assistant, specifying the language and other metadata.
Properties
| Name | Meaning |
|---|---|
| Source | Selects the origin of the message. Options: Telegram, Whatsapp, Chatwoot Omnichannel, Custom. Determines which input fields are required/visible. |
| Source ID | The source ID of the message, useful for tracking in command executions (e.g., telegram, slack, discord). Required when Source is "Custom". |
| Chat First Name | The first name of the user who sent the message. Used when Source is "Custom". |
| Chat Last Name | The last name of the user who sent the message. Used when Source is "Custom". |
| User Identifier | The ID of the user to execute the workflow as. Required when Source is "Custom". |
| Chat Identifier | A unique identifier for the chat session. Required when Source is "Custom". |
| Phone Number | The phone number of the user who sent the message. Used when Source is "Custom" or "Telegram". |
| Message Identifier | A unique identifier to track the message. Used when Source is "Custom". |
| Message Type | Specifies the type of message to send. Options include: image, audio, video, file, location, contact, text. Required when Source is "Custom". |
| Input Text | The message content to send to Lola Assistant. Required when Source is "Custom". |
| Auto Detect Language | Whether to automatically detect the language of the message. If enabled, language detection is performed; otherwise, the specified language is used. |
| Language | The language of the message (ISO 639-1 code, e.g., en, es, fr, it, pt). Only shown if Auto Detect Language is disabled. |
| Fallback Language | The fallback language to use if automatic detection fails (ISO 639-1 code). Only shown if Auto Detect Language is enabled. |
| Image (Base64) | If the message type is "image", specify the image in base64 format. Used when Source is "Custom". |
Output
The node outputs a single item with a json field containing a lola_message object. The structure is as follows:
{
"lola_message": {
"source": "<Source ID>",
"chatwoot": { /* Chatwoot-specific info, if applicable */ },
"message": {
"message_id": "<Message Identifier>",
"from": {
"id": "<User Identifier>",
"is_bot": false,
"first_name": "<Chat First Name>",
"last_name": "<Chat Last Name>",
"language_code": {
"languageCode": "<Detected or specified language code>",
"languageName": "<Language name>",
"confidence": 1,
"success": true,
"reason": "Hardcoded" or detection reason
},
"phone": "<Phone Number>"
},
"chat": {
"id": "<Chat Identifier>"
},
"date": <Timestamp>,
"type": "<Message Type>",
"text": "<Input Text>",
"image": "<Image data (if provided)>",
"image_url": "<Image URL (if available)>",
"contact": { /* Contact info, if any */ },
"reply": { /* Reply info, if any */ }
}
}
}
- If the message type is "image" and an image is provided, the
imagefield will contain the base64 data. - Additional fields like
contactandreplymay be present depending on the input.
Dependencies
- No external API keys are strictly required for composing the message, but the node supports optional credentials (
lolaKeyApi) for integration with Lola Assistant. - For language auto-detection, the node relies on internal helper functions and may require network access if using external language detection services.
Troubleshooting
Common issues:
- Missing required fields: If required properties (like User Identifier, Chat Identifier, etc.) are not provided when Source is set to "Custom", the node may throw validation errors.
- Invalid language codes: Providing an invalid ISO 639-1 language code may result in incorrect language assignment or errors during downstream processing.
- Incorrect message type: If "image" is selected as the message type but no image data is provided, the output may lack the expected image content.
Error messages and resolutions:
- "Parameter X is required" — Ensure all required fields for the selected Source are filled.
- "Failed to detect language" — If auto-detect is enabled and detection fails, check the input text and fallback language settings.
Links and References
- n8n Documentation
- ISO 639-1 Language Codes
- Lola Assistant Documentation (add actual link if available)