PhoAi Ultimate Debounce

PhoAi Ultimate Debounce

PhoAi Ultimate Debounce

AI-generated

Summary

Debounce message sending within a chat thread by aggregating incoming messages over a specified wait time and returning all collected messages after the delay.

Inputs

  • thread_id (required) — The unique identifier of the chat thread to debounce messages for.
  • phoai_content (required) — The content of the message to add to the debounce queue.
  • waitTime — The wait time in seconds to delay and aggregate messages before outputting (default is 5 seconds).

Output shape

An array of collected message contents aggregated during the wait time is returned as a JSON array under the key 'messages'. If no messages are collected, an empty array is returned.

Messages for the specified thread_id are stored temporarily in Redis. After the wait time, all stored messages are returned in one batch. The node outputs two connections: the first with the collected messages, the second is empty.

Discussion