Actions3
Overview
This node enables creating and managing polls within Zalo groups. It is particularly useful for group administrators or members who want to gather opinions, votes, or feedback from participants in a structured way. The "Tạo bình chọn" (Create Poll) operation allows users to define a poll question, specify multiple answer options, set voting rules, and optionally pin the poll to the top of the chat.
Practical examples include:
- Organizing group decisions such as event dates or activity preferences.
- Collecting quick feedback on topics within a Zalo group.
- Running informal surveys or quizzes among group members.
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 poll question or topic that participants will vote on. |
| Kiểu nhập lựa chọn | Method to input poll options: either as a list of separate entries ("Danh sách") or a single text field with comma-separated options ("Văn bản"). |
| Các lựa chọn | When using "Danh sách" input type: a collection of individual poll options entered separately. |
| Các lựa chọn | When using "Văn bản" input type: a single string containing all options separated by commas. |
| 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 for visibility. |
| Chọn nhiều phương án | Allow participants to select multiple options when voting. |
| Có thể thêm phương án | Allow participants to add new options to the poll during voting. |
| Ẩ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 | Make votes 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, including details like poll ID and status.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).
If an error occurs and "Continue On Fail" is enabled, the output includes an error field with the error message.
No binary data is produced by this node.
Dependencies
- Requires valid Zalo API credentials with appropriate permissions to create polls in groups.
- Needs configuration of an API key credential (referred generically as "Zalo Credential") in n8n.
- Uses an external Zalo API client library (
zca-js) to interact with Zalo services. - The node expects certain authentication details such as cookies, device IMEI, and user agent strings, which are managed internally via credentials or input data.
Troubleshooting
- Missing or invalid credentials: The node throws an error if the Zalo API instance cannot be initialized due to missing or incorrect authentication data. Ensure the API key credential is correctly configured and valid.
- No poll options provided: If no poll options are entered, the node raises an error prompting to input at least one option.
- Invalid option input format: Errors may occur if the options collection or comma-separated string is malformed. Double-check the input format matches the selected "Kiểu nhập lựa chọn".
- API errors from Zalo: Network issues or permission problems can cause failures. Review the error messages and verify group IDs and permissions.
- Date/time format for expiration: Ensure the expiration time is a valid datetime value or left empty.
To resolve errors, verify all required fields are filled correctly, credentials are valid, and the group ID exists and is accessible.