PhoAi Ultimate Debounce

PhoAi Ultimate Debounce

Overview

This node interacts with a Redis database to manage chat messages within a specific chat thread. It retrieves existing messages for a given thread, appends a new message, waits for a specified time, and then returns the updated list of messages. This functionality is useful in scenarios where you want to accumulate chat messages over time, simulate message delays, or batch process messages in workflows.

Practical examples include:

  • Collecting user messages in a chat application before processing them.
  • Implementing delayed message sending or batching in automation workflows.
  • Storing and retrieving conversation history temporarily during workflow execution.

Properties

Name Meaning
Đây là phiên bản Thử nghiệm Chúng tôi sẽ liên tục cập nhât và sửa lỗi.
Mời bạn truy cập https://zalo.me/g/ebsiof941 để cập nhật thông tin mới nhất
A notice informing users that this is an experimental version with ongoing updates and bug fixes. Provides a link for latest information.
ID nhóm chat The unique identifier (thread_id) of the chat group/thread to which messages belong.
Nội dung tin nhắn The content of the message (phoai_content) to be added to the chat thread.
Thời gian chờ The wait time (waitTime) in seconds before the node proceeds after adding the message.

Output

The node outputs JSON data containing the accumulated messages for the specified chat thread. The output structure includes:

  • messages: An array of all messages currently stored for the thread.
  • content: A single string concatenating all messages separated by spaces.

If there are no messages, the output will be an empty array.

Example output JSON:

{
  "messages": [
    "Hello",
    "How are you?",
    "I'm fine, thanks!"
  ],
  "content": "Hello How are you? I'm fine, thanks!"
}

No binary data output is produced by this node.

Dependencies

  • Requires a Redis server accessible with credentials (host, port, username, password, optional TLS, and database index).
  • The node uses the redis npm package to connect and interact with Redis.
  • Users must provide valid Redis connection credentials configured in n8n.
  • No other external services are required.

Troubleshooting

  • Connection errors: If the node cannot connect to Redis, verify the host, port, username, password, and TLS settings. Ensure the Redis server is reachable from the n8n environment.
  • Empty or missing messages: Check that the correct thread_id is provided and that messages are being properly stored in Redis keys.
  • Timeout issues: The node waits for the specified waitTime in seconds. Setting this too low may cause unexpected behavior if dependent processes need more time.
  • JSON parsing errors: Messages are stored as JSON strings in Redis. Corrupted or manually altered data in Redis may cause parsing failures.
  • Credential misconfiguration: Make sure the API key credential for Redis is correctly set up in n8n and linked to the node.

Links and References

Discussion