Zalo Group icon

Zalo Group

Quản lý nhóm Zalo

Overview

This node enables creating polls within Zalo groups, a popular messaging platform. It is designed to facilitate group decision-making by allowing users to set up questions with multiple options for group members to vote on. Typical use cases include gathering opinions, scheduling events, or making collective choices in group chats.

For example, a team leader can create a poll asking "Which date works best for the meeting?" with several date options. Group members then vote on their preferred dates directly within the Zalo group chat.

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 a single text field with comma-separated options ("Văn bản").
Các lựa chọn (list) When using "Danh sách" option input type: add multiple individual options for the poll.
Các lựa chọn (text) When using "Văn bản" option input type: enter all options in one text box 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 group chat.
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.
Ẩ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 from the Zalo API after creating the poll.
  • groupId: The ID of the group where the poll was created.
  • createPollData: An object summarizing the poll parameters used for creation, including question, options, expiration time, and various settings.

No binary data output is produced by this operation.

Example output JSON snippet:

{
  "success": true,
  "response": { /* Zalo API poll creation response */ },
  "groupId": "123456789",
  "createPollData": {
    "question": "Your question here",
    "options": ["Option 1", "Option 2"],
    "expiredTime": 0,
    "pinAct": false,
    "allowMultiChoices": true,
    "allowAddNewOption": true,
    "hideVotePreview": false,
    "isAnonymous": false
  }
}

Dependencies

  • Requires an active connection to the Zalo API via an API key credential that provides authentication cookies, device IMEI, and user agent strings.
  • The node uses the zca-js library internally to interact with the Zalo API.
  • Proper configuration of the Zalo API credentials in n8n is necessary before using this node.

Troubleshooting

  • Missing or invalid credentials: If the node throws errors about missing API instances or failed login, verify that the Zalo API credentials are correctly configured and valid.
  • Empty poll options error: The node requires at least one poll option. If none are provided, it will throw an error prompting to input at least one choice.
  • Invalid option input format: When using the "Danh sách" input type, ensure each option is properly filled. For the "Văn bản" input type, options must be comma-separated without trailing commas.
  • Date/time format issues: If specifying an expiration time, ensure the datetime is valid and correctly formatted.
  • API call failures: Network issues or changes in the Zalo API may cause failures. Check logs for detailed error messages.

Links and References

Discussion