Actions12
- Zalo Send Message Actions
- Zalo Text To Speech Actions
Overview
This node integrates with the Zalo platform to convert text into speech using Zalo's Text-to-Speech (TTS) API. It allows users to input text and receive a synthesized audio output in various formats and voices. The node supports converting text to speech and optionally sending the generated audio as a voice message through Zalo.
Common scenarios where this node is beneficial include:
- Creating automated voice notifications or alerts from text content.
- Generating audio messages for accessibility purposes.
- Sending personalized voice messages in Zalo chats automatically.
Practical example:
- A customer support workflow that converts a text response into a voice message and sends it directly to a user's Zalo chat.
Properties
| Name | Meaning |
|---|---|
| Text | The text content to be converted into speech. |
| Voice (Giọng đọc) | The voice profile used for speech synthesis. Options: - Phụ nữ miền Nam 1 - Phụ nữ miền Bắc 1 - Đàn ông miền Nam - Đàn ông miền Bắc - Phụ nữ miền Bắc 2 - Phụ nữ miền Nam 2 |
| EnCode Output | The audio encoding format of the output. Options: WAV, MP3, AAC |
| Speed | Playback speed of the synthesized speech, ranging from 0.8 (slower) to 1.2 (faster). |
Output
The node outputs JSON data containing the response from the Zalo TTS API. The key fields include:
data.url: The URL of the generated audio file.- Other metadata returned by the API such as error codes or messages if any.
If the operation is "Convert Text to Speech", the output JSON contains the direct API response including the audio URL.
If the operation is "Send TTS Message", the node additionally sends the generated audio as a voice message to a specified Zalo thread and outputs a JSON object indicating success, the thread ID, thread type, and the TTS audio URL.
The node does not output binary data directly but provides URLs to the synthesized audio files.
Dependencies
Requires valid credentials for two APIs:
- Zalo API credentials (including cookie, IMEI, user agent) for sending messages.
- Zalo TTS API credentials containing an API key for text-to-speech conversion.
The node makes HTTP POST requests to
https://api.zalo.ai/v1/tts/synthesizewith appropriate headers and body parameters.Requires n8n environment to have these credentials configured properly.
Troubleshooting
Zalo login error: If the node fails to initialize the Zalo API client, verify that the Zalo API credentials are correct and contain valid cookie, IMEI, and user agent values.
Zalo TTS API credentials missing or invalid: Ensure that the Zalo TTS API credential with a valid API key is set up in n8n.
API errors from Zalo TTS: If the API returns an error or non-zero error code, check the error message for details. Common issues include invalid API key, exceeding rate limits, or malformed request parameters.
Missing audio URL in response: When sending TTS messages, if the audio URL is missing, verify the text input and other parameters like voice, speed, and encode type.
Playback speed out of range: The speed must be between 0.8 and 1.2; values outside this range may cause errors.
Network or connectivity issues: Ensure n8n can reach the Zalo TTS API endpoint.