Message Stack

Store and retrieve messages from a stack/queue with optional delay processing

Overview

This node manages a message stack (or queue) allowing users to perform various operations such as adding messages, retrieving messages, viewing messages without removal, clearing the stack, and more. It supports multiple independent stacks identified by a stack name. This node is useful in scenarios where message accumulation, delayed processing, or batch handling of messages is required, such as buffering events, batching API calls, or managing workflow messages.

Use Case Examples

  1. Push messages to a named stack to accumulate data for batch processing.
  2. Pop a specified number of messages from the stack for processing.
  3. Clear all messages from a specific stack to reset the queue.

Properties

Name Meaning
Stack Name The name of the stack to operate on, allowing multiple independent stacks to be managed separately.

Output

JSON

  • success - Indicates if the operation was successful.
  • operation - The operation performed on the stack (e.g., clear).
  • stackName - The name of the stack on which the operation was performed.
  • messagesCleared - The number of messages that were cleared from the stack.

Troubleshooting

  • If the stack name is not provided or is empty, the node may not function correctly as it relies on this to identify the message stack.
  • Clearing a stack that is already empty will return a success message with zero messages cleared, which is expected behavior.
  • If an unsupported operation is specified, the node will throw an error indicating the operation is not supported.

Discussion