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 resulting credentials for future API interactions.
Common scenarios where this node is beneficial include:
- Automating Zalo account authentication in workflows without manual password entry.
- Integrating Zalo messaging capabilities into n8n workflows by obtaining valid session credentials.
- Refreshing or creating new Zalo API credentials 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 QR code, which then provides the necessary credentials for subsequent message-sending nodes.
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 credential: includes credential name, ID, type, and instructions.
- If no credentials provided: includes file path to saved credentials and instructions for manual or automatic creation.
binary:
data: The QR code image data in PNG format, ready for download or display.
This output allows downstream nodes to access the QR code image for user scanning and to handle credential information accordingly.
Dependencies
- Requires an API key credential for Zalo or an n8n account credential to attempt login with existing credentials.
- Uses the
zca-jslibrary for interacting with the Zalo SDK. - Optionally requires an HTTP proxy if specified.
- May interact with the n8n API to automatically create new credentials after successful login (if n8n API credentials are provided).
- Environment must support writing files if saving credentials locally.
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 proxy settings.
- No credentials provided: If neither Zalo API nor n8n account credentials are supplied, the node falls back to QR code login only; ensure you scan the QR code promptly.
- Credential creation errors: Automatic creation of credentials via the n8n API may fail due to incorrect API keys, wrong URLs, or network issues. In such cases, credentials are saved to a file for manual creation.
- Proxy issues: Incorrect proxy URLs or authentication failures can prevent API communication. Verify proxy details if used.
- QR code expired or declined: The node logs these events; simply retry the login process by regenerating the QR code.
Links and References
- Zalo Official Website
- n8n Documentation
- Axios HTTP Client
- zca-js GitHub Repository (for Zalo SDK wrapper) (Note: actual repo link not provided in source)