Overview
This node enables logging into the Zalo messaging platform using a QR code. It generates a QR code image that users scan with their Zalo mobile app to authenticate. Upon successful login, it captures and saves the necessary credentials (such as cookies, IMEI, and user agent) 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 programmatically obtaining valid session credentials.
- Managing multiple Zalo accounts by generating and storing credentials via QR login.
Practical example:
- A workflow that sends automated messages on Zalo after authenticating via QR code login, without requiring manual intervention each time.
Properties
| Name | Meaning |
|---|---|
| Proxy | HTTP proxy URL to route Zalo API requests through, e.g., https://user:pass@host:port. |
Output
The node outputs an array of items, each containing:
json:
success: Boolean indicating if the QR code was generated successfully.message: Informational message about the login or QR code generation status.fileName: The filename of the QR code image (zalo-qr-code.png).usingExistingCredential: Boolean indicating if existing credentials were used.credentialInstructions: Instructions related to credential usage or creation.- Additional fields depending on credential source, such as credential name, ID, type, or file path for saved credentials.
- If no credentials are provided, instructions for manual credential creation script are included.
binary:
data: The QR code image data in PNG format, ready for use or download.
This output allows subsequent nodes to access the QR code image for display or further processing and provides detailed information about the authentication state and credentials management.
Dependencies
- Requires the Zalo API SDK library for handling login and QR code generation.
- Optionally requires credentials for:
- An API key credential to connect with Zalo API.
- An n8n account credential for managing Zalo credentials via n8n's API.
- Uses Axios for HTTP requests when creating credentials via n8n API.
- Supports optional HTTP proxy configuration for network routing.
- Requires appropriate permissions to save or create credentials either locally or via n8n API.
Troubleshooting
- Timeout generating QR code: If the QR code does not generate within 30 seconds, a timeout error occurs. Check network connectivity and proxy settings.
- No credentials provided: If neither Zalo API nor n8n account credentials are supplied, the node will still generate a QR code but cannot automatically save credentials. Users must manually handle credential creation.
- Credential creation failures: Errors during automatic credential creation via n8n API are logged. Ensure the API key and URL are correct and the n8n instance is accessible.
- QR code expired: If the QR code expires before scanning, restart the node to generate a new one.
- Proxy issues: Incorrect proxy URLs or authentication can prevent successful API communication.
- SDK connection errors: Network or API changes may cause connection errors; verify SDK compatibility and update if needed.