Overview
This node listens for incoming messages on a messaging platform (likely Zalo, based on the code context) and triggers workflows when new messages arrive. It supports listening to both user-to-user messages and group messages. Additionally, it can optionally perform voice-to-text transcription on voice messages using Wit.ai, enabling workflows to react to spoken content converted into text.
Common scenarios where this node is beneficial include:
- Automating responses or actions based on received user or group messages.
- Transcribing voice messages automatically to enable text-based processing or logging.
- Filtering messages by type and optionally ignoring messages sent by the bot itself.
Practical examples:
- A customer support workflow that triggers whenever a user sends a message, transcribes any voice notes, and routes the content to agents.
- A group chat monitoring system that listens for specific keywords in group messages and triggers alerts.
- An automated chatbot that processes both text and voice inputs from users.
Properties
| Name | Meaning |
|---|---|
| Event Types | Types of messages to listen for: - User Messages - Group Messages |
| Self Listen | Whether to allow listening to messages sent by yourself (the bot itself). |
| Enable Voice Recognition | Whether to enable voice-to-text recognition for voice messages using Wit.ai. |
| Voice Processing Mode | Mode for processing voice messages: - Auto language detection - Manual language selection |
| Manual Language Selection | If manual mode is selected, choose the language for voice recognition: - Vietnamese - English - Chinese - Japanese |
| Wit.ai Credentials Required | Notice indicating that Wit.ai credentials are required if voice recognition is enabled. |
Output
The node outputs JSON data representing the incoming message event. The structure includes:
message: The original message object received from the messaging platform.isVoiceMessage: Boolean indicating if the message is a voice message.- If voice recognition is enabled and the message is a voice message, additional fields under
voiceProcessing:voiceToText: Array of transcribed text strings from the voice message.processingError: Any error encountered during voice processing.processingSkipped: Boolean indicating if voice processing was skipped.skipReason: Reason why processing was skipped, if applicable.detectedLanguage: Language detected in the voice message (if auto mode).confidence: Confidence score of the transcription.
If the node outputs binary data (e.g., audio files), it would represent the raw voice message content, but this node primarily focuses on JSON output with optional voice transcription results.
Dependencies
- Requires an API key credential for the messaging platform (Zalo API).
- If voice recognition is enabled, requires Wit.ai API credentials configured in n8n.
- The node uses Wit.ai service to convert voice messages to text.
- Proper configuration of webhook URL and authentication tokens is necessary for receiving real-time message events.
Troubleshooting
- Missing Wit.ai credentials: If voice recognition is enabled but Wit.ai credentials are not configured for the selected language(s), the node will throw an error. Ensure you have valid Wit.ai API tokens set up for all languages you intend to use.
- Webhook setup issues: The node relies on webhooks to receive messages. Make sure the webhook URL is correctly configured and publicly accessible.
- Self Listen setting: If you do not want the node to trigger on messages sent by the bot itself, ensure "Self Listen" is disabled; otherwise, you may get duplicate or unwanted triggers.
- Voice processing errors: Errors during voice transcription are captured and included in the output. Common causes include invalid audio format or network issues with Wit.ai.
- Token expiration or invalidation: If the messaging platform API token expires or becomes invalid, the node will fail to connect or listen for messages. Refresh or update your API credentials as needed.
Links and References
This summary is based solely on static analysis of the provided source code and property definitions.