Zalo Poll icon

Zalo Poll

Quản bình chọn Zalo

Overview

This node enables users to create and manage polls within Zalo groups. It is particularly useful for gathering opinions, making group decisions, or conducting surveys in Zalo chat groups. For example, a community manager can use this node to create a poll asking members to vote on the next event date, or a team lead can gather feedback on project priorities.

The "Tạo bình chọn" (Create Poll) operation allows creating a new poll with customizable options such as question text, multiple choice settings, anonymity, and expiration time.

Properties

Name Meaning
ID Nhóm The ID of the Zalo group where the poll will be created (only works with groups).
Chủ đề bình chọn The question or topic of the poll.
Kiểu nhập lựa chọn How to input poll options: either as a list of separate choices or as a single text string separated by commas. Options: "Danh sách" (list), "Văn bản" (text).
Các lựa chọn (list) When using "list" input type, add multiple individual poll options.
Các lựa chọn (text) When using "text" input type, enter all options in one field separated by commas.
Thời hạn bình chọn Optional expiration date/time for the poll; leave empty if no expiration is needed.
Ghim lên đầu trò chuyện Whether to pin the poll message at the top of the chat.
Chọn nhiều phương án Allow participants to select multiple options.
Có thể thêm phương án Allow participants to add new options to the poll.
Ẩn kết quả khi chưa bình chọn Hide poll results until the participant has voted.
Ẩn người bình chọn Make votes anonymous so participants cannot see who voted for which option.

Output

The node outputs JSON data containing:

  • success: Boolean indicating if the poll creation was successful.
  • response: The raw response from the Zalo API after creating the poll, including poll details.
  • groupId: The ID of the group where the poll was created.
  • createPollData: An object summarizing the parameters used to create the poll (question, options, settings).

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential to authenticate with the Zalo platform.
  • Uses the Zalo API client library (zca-js) internally to perform actions.
  • The node expects valid credentials including cookie, IMEI, and user agent information for authentication.
  • Proper configuration of the Zalo API credential in n8n is necessary.

Troubleshooting

  • Missing or invalid credentials: The node throws an error if the Zalo API instance cannot be initialized due to missing or invalid credentials. Ensure that the API key and related authentication details are correctly configured.
  • Empty poll options: If no poll options are provided, the node will throw an error prompting to enter at least one option.
  • Invalid input format: Errors may occur if the options input does not match the selected input type (list vs text). Verify that options are entered correctly according to the chosen method.
  • API errors: Any errors returned by the Zalo API during poll creation will be surfaced. Check the error message for details and verify network connectivity and API limits.
  • Use the "Continue On Fail" option to handle errors gracefully without stopping the workflow.

Links and References

Discussion