Zalo Login Via QR Code icon

Zalo Login Via QR Code

LĐăng nhập Zalo bằng QR code và lưu thông tin vào Credentia

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 for this node include:

  • Automating Zalo account authentication in workflows without manual password entry.
  • Integrating Zalo login into custom automation pipelines.
  • Managing multiple Zalo accounts by generating and storing credentials programmatically.

Practical example:

  • A user wants to automate sending messages via Zalo. They use this node to log in by scanning the QR code once, then subsequent workflow nodes use the saved credentials 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 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: instructions, credential name/id/type, or file path and script info for manual credential creation.
  • binary:

    • data: The QR code image data in PNG format encoded as binary, ready for display or saving.

This output allows downstream nodes to access the QR code image for user scanning and to understand the login state and credential handling.

Dependencies

  • Requires the zca-js library for interacting with Zalo's SDK and managing login sessions.
  • Uses axios for HTTP requests, particularly when creating credentials via an external n8n API.
  • Optionally requires two types of credentials configured in n8n:
    • An API key credential for accessing the n8n API to create new Zalo credentials automatically.
    • Existing Zalo API credentials for direct login reuse.
  • Supports configuring an HTTP proxy for network routing.

Troubleshooting

  • Timeout generating QR code: If the QR code generation times out (default 30 seconds), check network connectivity, proxy settings, and Zalo service availability.
  • No credentials provided: If neither existing Zalo nor n8n API credentials are supplied, the node falls back to QR code login only; ensure you scan the QR code promptly.
  • Credential creation failures: Errors during automatic credential creation via the n8n API may occur due to incorrect API keys, unreachable API endpoints, or permission issues. Review API configuration and logs.
  • QR code expired or declined: The node logs these events; simply retry the execution to generate a new QR code.
  • Proxy misconfiguration: Incorrect proxy URLs can prevent API communication; verify the proxy string format.

Links and References

Discussion