Zalo Poll icon

Zalo Poll

Quản bình chọn Zalo

Overview

This node enables users to create and manage polls within Zalo group chats. It is particularly useful for gathering opinions, making decisions, or conducting quick surveys among group members on the Zalo platform. For example, a team leader can create a poll to decide on a meeting time, or a community manager can gather feedback on event preferences.

The "Tạo bình chọn" (Create Poll) operation allows creating a new poll with customizable questions and options, setting expiration times, and configuring participant permissions such as multi-choice voting and anonymity.

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 entries ("Danh sách") or as a single text field with comma-separated options ("Văn bản").
Các lựa chọn The poll options entered individually when "Danh sách" is selected.
Các lựa chọn The poll options entered as a comma-separated string when "Văn bản" is selected.
Thời hạn bình chọn Optional expiration date/time for the poll; leave empty if no expiration is desired.
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 in their vote.
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 from participants until they have voted.
Ẩn người bình chọn Keep voters anonymous so participants cannot see who voted for which option.

Output

The node outputs JSON data containing:

  • success: Boolean indicating whether the poll creation was successful.
  • response: The raw response object returned by the Zalo API after creating the poll.
  • groupId: The ID of the group where the poll was created.
  • createPollData: An object summarizing the parameters used to create the poll, including question, options, expiration, and permission 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 these credentials in n8n is necessary for the node to function.

Troubleshooting

  • Missing or invalid credentials: The node throws an error if the Zalo API instance cannot be initialized due to missing or incorrect authentication details. Ensure that the API key credential is correctly set up with valid cookie, IMEI, and user agent values.
  • Empty poll options: If no poll options are provided, the node will throw an error requesting at least one option. Make sure to enter options either as a list or as a comma-separated string depending on the chosen input type.
  • Invalid expiration time: If the expiration time is set incorrectly, it may cause unexpected behavior. Use a valid date-time format or leave it empty for no expiration.
  • API errors: Any errors returned by the Zalo API during poll creation will be surfaced by the node. Check the error messages for details and verify the parameters sent.

If the node is set to continue on failure, errors will be included in the output JSON under an error field instead of stopping execution.

Links and References

Discussion