Vars (CE)

Mini stockage clé/valeur en mémoire pour n8n CE

Actions3

Overview

This node provides a simple in-memory key-value storage system for n8n workflows, allowing users to set, get, and reset values during workflow execution. It is useful for temporarily storing data that needs to be shared or reused across different parts of a workflow without external databases or persistent storage. For example, you can store user session data, intermediate calculation results, or configuration flags that influence workflow behavior.

Use Case Examples

  1. Set operation: Store one or more key-value pairs in memory for later use.
  2. Get operation: Retrieve stored values by specifying their keys.
  3. Reset operation: Clear all or specific keys from the in-memory storage.

Properties

Name Meaning
Values Defines the key-value pairs to be stored in memory. Each entry requires a key and its associated value.
Merge Input If enabled, merges the input JSON object with the stored values in the output, allowing preservation of original input data alongside stored data.

Output

JSON

  • json - The output JSON object containing the stored key-value pairs, optionally merged with the input JSON object.

Dependencies

  • No external dependencies; uses internal in-memory Map for storage.

Troubleshooting

  • Error if no values provided for Set operation: Ensure at least one key-value pair is defined.
  • Error if key is missing or empty: Provide a non-empty string as key.
  • Error if value is missing for a key in Set operation: Provide a value for each key.
  • Error if input to merge is not a JSON object: Ensure input data is a JSON object when 'Merge Input' is enabled.
  • Error if no keys provided for Get or Reset operations: Provide at least one key to retrieve or reset.
  • Error if keys to reset are not found in memory: Verify keys exist before attempting partial reset.

Discussion