Pop icon

Pop

Pop data off the shelf

Overview

The ShelfPop node is designed to retrieve ("pop") data associated with a specific key from a shared "shelf" within the n8n flow context. This allows for temporary storage and retrieval of data between different nodes or executions in a workflow. Common scenarios include passing data between non-consecutive nodes, implementing caching mechanisms, or managing stateful operations across multiple steps.

Practical Example:
Suppose you have stored an array of items under a key called userList using another node. You can use ShelfPop with the key userList to retrieve all those items later in your workflow.

Properties

Name Type Meaning
Key String The key associated with the data to retrieve

Output

  • The node outputs all items stored under the specified key as individual JSON objects (one per item).
  • If the key does not exist, is undefined, or the shelf is empty, the output will be an empty array.
  • Output Structure Example:
    [
      { "field1": "value1", "field2": "value2" },
      { "field1": "value3", "field2": "value4" }
    ]
    
  • No binary data is produced by this node.

Dependencies

  • Relies on the n8n flow context (this.getContext("flow")) to access the shared shelf object.
  • No external services or API keys are required.

Troubleshooting

  • No Key found: If the "Key" property is not provided, the node logs "No Key found" and returns no data. Ensure you specify the correct key.
  • Shelf is empty: If the shelf has not been initialized or contains no data, the node logs "Shelf is empty" and returns no data. Make sure data has been previously stored in the shelf.
  • Shelf key not found: [key]: If the specified key does not exist in the shelf, the node logs this message and returns no data. Double-check that the key matches what was used to store the data.

Links and References

Discussion