Zalo Gom Tin Nhắn icon

Zalo Gom Tin Nhắn

Gom tin nhắn Zalo và chờ trong một khoảng thời gian

Zalo Gom Tin Nhắn

AI-generated

Overview

This node collects and aggregates Zalo chat messages temporarily stored in a selected database (Redis, PostgreSQL, or MySQL). It waits for a specified debounce time before sending the collected messages as a single combined output. This is useful for scenarios where multiple messages in a chat thread need to be grouped and processed together, such as summarizing chat conversations or batching notifications.

Use Case Examples

  1. Collecting chat messages from a Zalo conversation thread and sending them as a single combined message after a 10-second wait time.
  2. Using Redis to temporarily store incoming messages from a chat thread and then outputting the aggregated messages for further processing.

Properties

Name Meaning
Loại Cơ Sở Dữ Liệu Select the type of database to temporarily store messages (Redis, PostgreSQL, or MySQL).
ID Nhóm Chat (Thread ID) Unique identifier of the chat thread to group messages.
Nội Dung Tin Nhắn Content of the message to be collected.
Thời Gian Chờ (giây) Wait time in seconds before aggregating and sending the collected messages.

Output

JSON

  • threadId - The unique identifier of the chat thread.
  • messages - An array of collected message contents from the chat thread.
  • content - A single string combining all collected messages joined by spaces.

Dependencies

  • Requires credentials for the selected database type (Redis, PostgreSQL, or MySQL) to store and retrieve messages.

Troubleshooting

  • If the node skips sending messages, it means a newer message arrived during the wait time, so the node waits for the last message in the sequence before sending.
  • Errors related to database connection or credentials will cause the node to fail unless 'Continue On Fail' is enabled, in which case the error message is output.
  • Ensure the database credentials are correctly configured for the selected database type to avoid connection issues.

Discussion