Overview
This node facilitates logging into the Zalo messaging platform using a QR code. It generates a QR code image that users can scan with their Zalo app to authenticate and obtain login credentials. The node supports using existing credentials or performing a fresh login via QR code scanning. After successful login, it can automatically save new credentials through an API if configured.
Common scenarios:
- Automating Zalo account login for bots or integrations without manual credential input.
- Refreshing or obtaining new Zalo session credentials securely via QR code.
- Integrating Zalo login flows in workflows where user interaction is required for authentication.
Practical example:
A workflow that needs to send messages on behalf of a Zalo account can use this node to log in by generating a QR code. The user scans the QR code with their mobile Zalo app, and upon successful login, the node outputs the credentials needed 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 an array with 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 n8n account credential: instructions about automatic credential creation, credential name, ID, and type.
- If using existing Zalo credentials: similar info about the credential.
- If no credentials provided: file path to saved credentials JSON and instructions for manual or automatic credential creation.
binary:
data: The QR code image data encoded as PNG, ready for download or display.
Dependencies
- Requires access to the Zalo API via either:
- An existing Zalo API credential (with cookie, IMEI, user agent, etc.).
- An n8n account credential that allows creating new Zalo credentials via the n8n API.
- Uses the
zca-jslibrary for interacting with Zalo's SDK. - Uses
axiosfor HTTP requests to the n8n API when saving credentials. - Optional HTTP proxy support for routing API requests.
- Requires proper configuration of credentials in n8n for seamless operation.
Troubleshooting
Timeout generating QR code:
If the QR code generation takes longer than 30 seconds, the node throws a timeout error. Check network connectivity and Zalo API availability.No credentials provided:
The node will generate a QR code but cannot reuse existing sessions. Ensure credentials are set up if you want to avoid repeated logins.Credential creation failures:
Errors during automatic credential creation via the n8n API may occur due to incorrect API keys, URLs, or network issues. Review logs and verify API credentials.Proxy issues:
Incorrect proxy settings can prevent communication with Zalo API. Verify the proxy URL format and accessibility.QR code expired or declined:
The node logs these events; users must scan the QR code promptly and accept the login on their device.
Links and References
- Zalo Official Website
- n8n Documentation
- Axios HTTP Client
- zca-js GitHub Repository (Note: Replace with actual repo if available)