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. For example, you can store API tokens, intermediate calculation results, or flags that control workflow logic.

Use Case Examples

  1. Set operation: Store one or more key-value pairs in memory for later use.
  2. Get operation: Retrieve one or more values by their keys from memory, optionally merging with the input data.
  3. Reset operation: Clear all or selected keys from the memory storage.

Properties

Name Meaning
Keys List of keys to retrieve from the in-memory storage. Each key is a string and is required for the Get operation.
Merge Input Boolean flag to determine whether to merge the input JSON object with the retrieved values in the output. If true, the output JSON will combine input and stored values; otherwise, only stored values are output.

Output

JSON

  • json - The output JSON object containing the retrieved key-value pairs or the set values.
  • binary - If the input item contains binary data, it is preserved and passed through to the output.

Troubleshooting

  • Ensure that keys provided for Get and Reset operations are not empty or missing, as this will cause errors.
  • When using Merge Input, the input data must be a JSON object; arrays or non-object types will cause an error.
  • For the Set operation, ensure that each key has an associated value; missing values will cause errors.
  • If Reset operation is partial (keys only), all specified keys must exist in memory; otherwise, an error is thrown listing missing keys.

Discussion