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 enables logging into the Zalo messaging platform via 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 Zalo API credentials or an n8n account credential for authentication, but it can also operate without any credentials by generating a fresh QR code login session.

Common scenarios where this node is beneficial include:

  • Automating Zalo login processes in workflows.
  • Integrating Zalo messaging capabilities into n8n workflows after obtaining valid login credentials.
  • Managing multiple Zalo accounts by programmatically generating and saving credentials.

Practical example:

  • A workflow that triggers when a user scans the QR code, logs in to Zalo, and then sends automated messages or retrieves user data.

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 both JSON and binary data:

  • json:

    • success: Boolean indicating if the QR code was generated successfully.
    • message: Informational message about the login status or credential usage.
    • 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 type:
      • For n8n account credential: includes credentialName, credentialId, credentialType ("n8nZaloApi"), and info about automatic credential creation via n8n API.
      • For existing Zalo API credential: includes similar metadata with credentialType as "zaloApi".
      • If no credentials are provided, includes file path to saved credentials and instructions for manual or automatic creation.
  • binary:

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

Dependencies

  • Requires the Zalo SDK library (zca-js) for handling Zalo login and QR code generation.
  • Uses Axios for HTTP requests to the n8n API when creating credentials automatically.
  • Optional: Requires configured credentials for either Zalo API access or an n8n account API key to enable advanced features like automatic credential creation.
  • Supports optional HTTP proxy configuration for network routing.

Troubleshooting

  • Timeout generating QR code: If the QR code generation times out (default 30 seconds), check your network connection, proxy settings, and Zalo service availability.
  • No credentials provided: The node can generate a QR code without credentials, but automatic credential creation requires proper API keys; ensure credentials are set up correctly.
  • Credential creation errors: Errors during automatic credential creation via the n8n API may occur due to incorrect API URLs, missing API keys, or network issues. Verify API endpoint accessibility and credential validity.
  • QR code expired or declined: If the QR code expires or is declined, regenerate the QR code by re-executing the node.
  • Proxy issues: Incorrect proxy URLs or authentication failures can prevent successful API calls; verify proxy details.

Links and References

Discussion