Zalo Bot Trigger icon

Zalo Bot Trigger

Starts the workflow on incoming Zalo webhook events

Overview

This node acts as a trigger for incoming webhook events from the Zalo Bot platform. It listens for HTTP POST requests sent by Zalo when specific bot-related events occur, such as messages or interactions with the bot. The node can automatically register its webhook URL with Zalo to receive these events, simplifying setup.

Common scenarios include:

  • Automating workflows based on user messages or commands received via Zalo.
  • Integrating Zalo bot interactions into broader automation pipelines.
  • Validating incoming webhook requests using secret tokens to ensure security.

Practical example:

  • When a user sends a message to your Zalo bot, this node triggers a workflow that processes the message content and responds accordingly or logs the interaction.

Properties

Name Meaning
Auto Register Webhook Whether to automatically call the API to set the webhook URL when the node is activated or listening.
Secret Token A secret token (at least 8 characters) used to authenticate incoming webhook requests via a header. If left empty, the node generates one automatically.
Advanced Collection of optional advanced settings:
- Verify Token Optional token to validate incoming requests via query parameter or header.
- Webhook URL (override) Override the default webhook URL used by the node. If empty, the node uses the default n8n webhook URL.

Output

The node outputs JSON data representing the body of the incoming webhook request from Zalo. This JSON contains event details sent by Zalo's bot platform.

If the incoming request fails token validation, no output is produced and an HTTP 401 Unauthorized response is sent.

No binary data output is involved.

Dependencies

  • Requires an API key credential for authenticating with the Zalo Bot API to manage webhook registration.
  • Uses the external Zalo Bot API endpoint at https://bot-api.zapps.me to check, create, or delete webhook registrations.
  • Requires network access to receive incoming webhook HTTP POST requests.
  • Optionally depends on Node.js crypto module for generating secret tokens if none are provided.

Troubleshooting

  • Invalid token errors (HTTP 401): Occur if the incoming webhook request does not contain the expected secret token in headers or query parameters. Ensure the secret token configured in the node matches what Zalo sends.
  • Webhook registration failures: If automatic webhook registration is enabled but fails silently, verify that the API key credential is valid and has permissions, and that the webhook URL is accessible publicly.
  • Secret token too short or missing: The secret token must be at least 8 characters. If left blank, the node attempts to generate one; failure to do so may cause authentication issues.
  • Webhook URL override misconfiguration: If you override the webhook URL, ensure it is correct and reachable by Zalo.

Links and References

Discussion