Overview
This node facilitates logging into the Zalo messaging platform using a QR code. It generates a QR code that users scan with their Zalo app to authenticate and obtain login credentials. The node supports using existing credentials or an API key credential for authentication, but if none are provided, it falls back to generating a fresh QR code login session.
Common scenarios where this node is beneficial include:
- Automating Zalo account login in workflows without manual password entry.
- Integrating Zalo login into broader automation pipelines.
- Automatically saving new Zalo credentials after successful login via QR code scanning.
Practical example:
- A user wants to automate sending messages through Zalo. They use this node to log in by scanning the generated QR code, which then provides the necessary credentials 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 both JSON and binary data:
json:
success: Boolean indicating if the QR code was generated successfully.message: Informational message about the login process status.fileName: The filename of the QR code image (zalo-qr-code.png).usingExistingCredential: Boolean indicating if existing credentials were used.- Additional fields depending on the credential source:
- If using n8n account credential: instructions about automatic creation of new Zalo credentials, credential name, ID, and type.
- If using existing Zalo credentials: details about the credential used.
- If no credentials provided: file path where credentials are saved and instructions for manual or automatic creation.
binary:
data: The QR code image in PNG format encoded as binary data, ready for display or download.
Dependencies
- Requires the
zca-jslibrary for interacting with the Zalo SDK. - Uses
axiosfor HTTP requests when creating credentials via the n8n API. - Optionally requires credentials for:
- An API key credential to connect with Zalo API.
- An n8n account credential for managing credentials via the n8n API.
- Supports configuring an HTTP proxy for network requests.
Troubleshooting
- Timeout generating QR code: If the QR code generation times out (default 30 seconds), check your network connection, proxy settings, and Zalo service availability.
- No credentials provided: The node will generate a QR code for login but cannot automatically save credentials unless n8n API credentials are provided.
- Credential creation errors: Errors during automatic credential creation via the n8n API may require manual intervention using the provided script.
- QR code expired: If the QR code expires before scanning, rerun the node to generate a new one.
- Proxy issues: Incorrect proxy configuration can prevent successful API communication; verify proxy URL and credentials.