Lola Response Composer icon

Lola Response Composer

Lola Response Composer, a node to compose a message response structure to send back to customer

Overview

The Lola Response Composer node is designed to construct and optionally send a structured message response, typically for customer support or chatbot scenarios. It allows you to compose messages with dynamic content, translation, alternative texts, parameters, and optional image attachments. The node can append the response to chat history and, if configured, send it directly via Lola Messenger (with support for Chatwoot integration).

Common use cases:

  • Sending automated replies in customer support workflows.
  • Composing personalized chatbot responses with variable substitution.
  • Translating outgoing messages based on user language preferences.
  • Attaching images or links to responses.
  • Appending AI or human-generated messages to chat histories.

Practical examples:

  • Automatically reply to a customer in their preferred language with a translated message.
  • Send a random greeting from a set of alternatives.
  • Include dynamic data (like order status) in the response using parameters.
  • Attach an image or a callback link to the message.

Properties

Name Meaning
Quick Send - Only Available for Lola Messanger Whether to send the message directly to Lola Messenger. If enabled, the message will be sent out immediately.
Private Message Whether to send the message as a private message (visible only to the support agent). Only available when "Quick Send" is enabled.
Use Message Composer Whether to load routing information from Lola Message Composer. If disabled, manual entry of source/account/chat IDs is required.
Source ID The source ID of the message (useful for tracking, e.g., Telegram, Slack, Discord). Only shown if "Use Message Composer" is disabled.
Chat Identifier / Conversation ID A unique identifier for the chat session. Required if "Use Message Composer" is disabled.
Account ID The account ID associated with the message. Only shown if "Use Message Composer" is disabled.
Append Response To Chat History Whether to append the response to the chat history.
From Indicates who the message is from. Options:
- AI: When the message is from the AI
- Human: When the message is from the user.
Only shown if "Append Response To Chat History" is enabled.
Output Text The main message text to send back to the customer. Supports variable replacement. Required.
Enable Translate Whether to enable automatic translation of the final text.
Read Lang From Message Whether to read the target language from the incoming message. Only shown if "Enable Translate" is enabled.
Language Code The language code (ISO 639-1, e.g., en, es, fr) to translate the final text into. Required if "Enable Translate" is enabled.
Enable Alternative Texts Whether to enable alternative texts. If enabled, one of the alternatives will be picked randomly for the response.
Alternative Texts List of alternative texts to choose from. Each can include variables (e.g., {variableName}). Only shown if "Enable Alternative Texts" is enabled.
Parameters Additional parameters for variable replacement in the output text. Types:
- JSON: Key-value pairs for JSON values
- Callback Link: For generating links with phone/bot/channel info
- String: Simple string replacements
Image URL An image URL to include in the response (optional).
Image Content (Base64) Base64-encoded image content to include in the response (optional).
Image File Name The file name for the attached image (if any).

Output

The node outputs a field named lola_response_message within the json property of the item. Its structure includes:

{
  "wasTranslated": false,           // Boolean indicating if translation was performed
  "chatId": "...",                  // The chat/conversation ID used
  "sourceId": "...",                // The source ID (if provided)
  "lang": "...",                    // The language code used for the message
  "text": "...",                    // The final composed message text (after substitutions, translation, etc.)
  "inHistory": true,                // Boolean indicating if the message was appended to chat history
  "status": "pending" | "sent"      // Status of the message ("pending" if not sent, "sent" if sent via Quick Send)
}

If an image is included (via URL or Base64), it is sent as part of the message but not directly exposed in the output structure—it's handled internally during message sending.


Dependencies

  • External Services:
    • Optional: Lola Messenger (for direct sending).
    • Optional: Chatwoot (for conversation context when using Message Composer).
  • API Keys/Credentials:
    • Optional: lolaKeyApi credential (only required if sending messages via Lola Messenger).
  • n8n Configuration:
    • No special environment variables are required unless your workflow uses external APIs for translation or messaging.

Troubleshooting

Common Issues:

  • Missing Required Fields:
    • If required fields like "Output Text" or "Chat Identifier" are missing, the node may throw errors.
  • No Lola Message Composer Node Found:
    • If "Use Message Composer" is enabled but no prior Lola Message Composer node exists in the workflow, an error will occur.
  • Unsupported Source:
    • If the message source is not "chatwoot" when using Quick Send, the node will throw an error.
  • Translation Errors:
    • If translation fails (e.g., due to invalid language codes or service issues), the original text is used, and an error is logged.
  • Variable Replacement Issues:
    • If a variable in the output text does not have a corresponding parameter, it will remain unreplaced.

Error Messages:

  • "No Lola Message Composer node found in the workflow": Ensure a previous node provides the necessary message context.
  • "Only Chatwoot messages are supported": Make sure the message source is Chatwoot when using Quick Send.
  • Translation-related errors: Check language codes and translation service availability.

Links and References

Discussion