Overview
This node integrates with the Zalo Bot Platform, allowing users to interact programmatically with their Zalo bots. The "Get Updates (Long Polling)" operation enables the node to receive new messages or events sent to the bot by continuously polling the Zalo server for updates. This long-polling approach is useful in development or local testing scenarios where webhook setup is not feasible or desired.
Practical examples include:
- Continuously fetching incoming messages to trigger workflows based on user input.
- Monitoring bot interactions without setting up a public webhook endpoint.
- Debugging and testing bot responses locally before deploying webhook-based automation.
Properties
| Name | Meaning |
|---|---|
| Timeout(seconds) | Duration in seconds for the long-polling request to wait for new updates before timing out. Default is 30 seconds, with allowed values from 1 to 300 seconds. |
Output
The node outputs an array of JSON objects, each representing the response from the Zalo Bot API for the "getUpdates" operation. The JSON structure corresponds directly to the API's update payload, typically including fields such as message data, sender information, timestamps, and update identifiers.
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential containing the Zalo Bot Token and optionally a base URL for the API (defaults to
https://bot-api.zapps.me). - The node makes HTTP POST requests to the Zalo Bot API endpoints.
- Proper credential configuration in n8n is necessary to authenticate requests.
Troubleshooting
- Missing Bot Token: If the bot token is not provided in credentials, the node will throw an error indicating the missing token. Ensure the API key credential is correctly set up.
- API Errors: If the Zalo API returns an error (e.g., invalid token, rate limits), the node throws an error with the description returned by the API. Check the token validity and API usage limits.
- Timeout Issues: Setting the timeout too low may cause frequent empty responses; too high may delay workflow execution. Adjust the timeout property according to your use case.
- Network Connectivity: Ensure that the n8n instance has internet access to reach the Zalo API endpoint.