Overview
This node facilitates logging into the Zalo messaging platform using a QR code. It generates a QR code image that users scan with their Zalo app to authenticate. Upon successful login, it captures and optionally saves the user's Zalo credentials for future API interactions.
Common scenarios where this node is beneficial include:
- Automating Zalo account authentication without manual password entry.
- Integrating Zalo login flows into workflows that require authenticated access.
- Automatically managing and refreshing Zalo credentials in an n8n environment.
Practical example:
- A workflow that needs to send messages or retrieve data from a Zalo account can use this node to authenticate via QR code, then store the credentials securely for subsequent API calls.
Properties
| Name | Meaning |
|---|---|
| Proxy | HTTP proxy URL (e.g., https://user:pass@host:port) to route Zalo API requests through. |
Output
The node outputs one item containing:
json:
success: Boolean indicating if the QR code was generated successfully.message: Informational message about the login process status.fileName: The filename of the generated QR code image (zalo-qr-code.png).usingExistingCredential: Boolean indicating if existing credentials were used.- Additional fields depending on credential usage:
- If using an existing n8n account credential: instructions about automatic creation of new Zalo credentials after login, credential name, ID, and type.
- If using existing Zalo credentials: details about the credential used.
- If no credentials provided: instructions about saving credentials to file and auto-creation scripts/APIs.
binary:
data: The QR code image data encoded as PNG, ready for display or download.
Dependencies
- Requires the
zca-jslibrary for interacting with the Zalo SDK. - Uses
axiosfor HTTP requests, particularly when creating credentials via the n8n API. - Optionally requires two types of credentials configured in n8n:
- A Zalo API credential (optional).
- An n8n account credential with API access (required for some features).
- Supports configuring an HTTP proxy for API requests.
Troubleshooting
- Timeout generating QR code: If the QR code generation times out (default 30 seconds), check network connectivity and proxy settings.
- No credentials provided: The node will generate a QR code but cannot save credentials automatically without proper credentials configured.
- Credential creation errors: Errors during automatic credential creation via the n8n API may occur if the API key or URL is incorrect or unreachable.
- QR code expired: If the QR code expires before scanning, rerun the node to generate a new one.
- Login declined or failed: The node logs detailed error messages; ensure the Zalo app scans the QR code promptly and approves the login.
Links and References
- Zalo Official Website
- n8n Documentation
- Axios GitHub Repository
- [zca-js (Zalo SDK) - if publicly available] (no direct link available from source)