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 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 either locally or by calling an external n8n API endpoint.

Common scenarios:

  • Automating Zalo account authentication in workflows without manual password entry.
  • Integrating Zalo login into larger automation pipelines where session credentials are needed.
  • Refreshing or creating new Zalo API credentials programmatically after QR code login.

Practical example:
A user wants to automate sending messages through Zalo. They use this node to generate a QR code, scan it with their phone, and then the node saves the authenticated session credentials for subsequent API calls in the workflow.

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 QR code generation was successful.
    • message: Informational message about the login process status.
    • fileName: The filename of the generated QR code image (zalo-qr-code.png).
    • usingExistingCredential: Boolean indicating if existing credentials were used.
    • Additional fields depending on credential usage:
      • If using n8n account credential: instructions and metadata about automatic credential creation.
      • If using existing Zalo credentials: details about the credential name and type.
      • If no credentials provided: file path to saved credentials and instructions for manual or automatic creation.
  • binary:

    • data: The QR code image data in PNG format encoded as binary, ready for further use or download.

Dependencies

  • Requires access to the Zalo API via an SDK library bundled as a dependency.
  • Optionally requires credentials for:
    • A Zalo API credential (session cookie, IMEI, user agent, etc.).
    • An n8n account credential with API key and URL to enable automatic credential creation via n8n's API.
  • Supports configuring an HTTP proxy for outbound requests.
  • Uses Axios for HTTP requests to n8n API when saving credentials.
  • Requires write access to local filesystem if credentials are saved to a file.

Troubleshooting

  • Timeout generating QR code:
    The node waits up to 30 seconds for the QR code to be generated. If it times out, check network connectivity and proxy settings.

  • No credentials provided:
    If neither Zalo nor n8n credentials are supplied, the node will generate a QR code but cannot save credentials automatically. Users must manually handle credential creation.

  • Credential creation failures:
    Errors during automatic credential creation via n8n API may occur due to incorrect API key, URL, or network issues. Verify these configurations.

  • Proxy issues:
    Incorrect proxy URLs or authentication failures can prevent API communication. Ensure the proxy string is correctly formatted.

  • QR code expired or declined events:
    The node logs these events; users should retry scanning the QR code promptly.

Links and References

Discussion