Overview
This node manages a message stack (queue) allowing users to store, retrieve, and manipulate messages in various ways. It supports operations like pushing messages onto the stack, popping messages off, peeking at messages without removal, flushing all messages, checking stack size, and clearing the stack. It also supports delayed processing of messages with options to auto-flush after a delay. This node is useful in scenarios where message buffering, batch processing, or delayed message handling is required, such as accumulating events before processing or managing task queues.
Use Case Examples
- Push messages to a named stack and later pop a limited number of messages for processing.
- Peek at messages in the stack without removing them to inspect current queued data.
- Flush all messages from the stack to process or archive them at once.
- Use push with delay to accumulate messages for a set time before processing them together.
Properties
| Name | Meaning |
|---|---|
| Stack Name | The name of the stack to operate on, allowing multiple independent stacks. |
| Max Messages | Maximum number of messages to return when popping or peeking (0 means return all). |
| Return Format | Determines how messages are returned: as individual items or as a single array. |
Output
JSON
jsonsuccess- Indicates if the operation was successful.operation- The operation performed (e.g., push, pop, peek).stackName- The name of the stack involved in the operation.messagesPushed- Number of messages pushed onto the stack (for push operations).totalMessages- Total messages currently in the stack after the operation.messages- Array of messages returned (for pop, peek, flush operations).count- Count of messages returned or affected by the operation.message- Informational message, e.g., indicating the stack is empty.size- Current size of the stack (for size operation).lastActivity- Timestamp of the last activity on the stack.hasPendingTimeout- Indicates if there is a pending timeout for delayed processing.messagesCleared- Number of messages cleared from the stack (for clear operation).delaySeconds- Delay time in seconds used in delayed push operations.autoFlush- Indicates if auto flush is enabled after delay.willFlushAt- Timestamp when the stack will auto flush after delay.actualWaitTimeSeconds- Actual wait time elapsed during delayed push and flush operations.
Dependencies
- No external dependencies; uses internal in-memory stack management.
Troubleshooting
- If the stack name is not provided or misspelled, the node will create or operate on a different stack than expected, leading to unexpected results.
- Using a maxMessages value larger than the current stack size will simply return all available messages without error.
- If the operation parameter is set to an unsupported value, the node throws an error indicating the operation is not supported.
- Timeouts for delayed operations may be cleared if multiple pushWithDelay or pushWaitFlush operations occur rapidly, affecting expected delay behavior.