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 messaging capabilities into n8n workflows by programmatically obtaining valid login credentials.
- Refreshing or creating new Zalo API credentials via QR code scanning.
Practical example:
- A user wants to automate sending messages on Zalo. They use this node to log in via QR code, which then provides the necessary credentials for subsequent API calls to send messages.
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 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 API key credential or n8n account credential, includes instructions, credential name, ID, and type.
- If no credentials were provided, includes file path to saved credentials and instructions for automatic credential creation.
binary:
data: The QR code image data in PNG format encoded as binary, ready for download or display.
This output allows downstream nodes to access the QR code image for user scanning and to handle the resulting credentials accordingly.
Dependencies
- Requires the
zca-jslibrary for interacting with the Zalo SDK. - Uses
axiosfor HTTP requests to the n8n API when creating credentials automatically. - Optionally requires credentials for:
- A Zalo API key credential (optional).
- An n8n account credential with API key and URL (required for automatic credential creation).
- Supports configuring an HTTP proxy for network 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 can generate a QR code without credentials, but automatic saving of credentials requires an n8n API credential.
- Credential creation errors: Errors during automatic credential creation via the n8n API will be logged; ensure the API key and URL are correct and accessible.
- QR code expired: If the QR code expires before scanning, rerun the node to generate a new one.
- Proxy issues: Incorrect proxy URLs or authentication failures may prevent successful API communication.
Links and References
- Zalo Official Website
- n8n Documentation
- Axios GitHub Repository
- [zca-js (Zalo SDK) - assumed internal or private package]