Overview
This node provides a simple key-value storage mechanism using a JSON file on the local filesystem. It allows users to save string values under specified keys or read values by their keys from the JSON file. Values are stored as base64 encoded strings within the JSON file to preserve data integrity.
Common scenarios for this node include:
- Persisting small amounts of configuration or state data between workflow executions.
- Sharing data between different workflows or nodes without external databases.
- Quick prototyping where lightweight persistent storage is needed without setting up a database.
For example, you could save an API token under a key and later retrieve it in another workflow run, or store user preferences that need to be accessed repeatedly.
Properties
| Name | Meaning |
|---|---|
| Operation | Choose between "Save" (store a key-value pair) or "Read" (retrieve a value by key). |
| Key | The identifier string used to save or retrieve a value. |
| Value | (Only for Save operation) The string value to be saved under the specified key. |
| File Path | Full path to the JSON file used for storage. The directory will be created if missing. |
| Info | Informational notice stating that values are stored as base64 encoded strings. |
Output
The node outputs an array of JSON objects, one per input item processed:
- For Save operation:
{ "success": true, "key": "<the key>", "value": "<the original string value saved>" } - For Read operation:
- If the key exists:
{ "success": true, "key": "<the key>", "value": "<the decoded string value>" } - If the key does not exist:
{ "success": false, "key": "<the key>", "value": "" }
- If the key exists:
No binary data output is produced by this node.
Dependencies
- Requires access to the local filesystem to read/write the JSON file.
- The node automatically creates the directory path if it does not exist.
- No external services or API keys are required.
Troubleshooting
- File system permissions: Ensure the n8n process has read/write permissions for the specified file path and its directories.
- Invalid JSON file: If the JSON file is corrupted or contains invalid JSON, the node will throw a parsing error. Fix or delete the file to resolve.
- Concurrent writes: Simultaneous executions writing to the same file may cause race conditions or data loss. Use with caution in parallel workflows.
- Missing key on read: Reading a non-existent key returns
success: falsewith an empty value; handle this case gracefully in your workflow. - Base64 encoding issues: Values are stored as base64 strings; ensure that values saved are valid UTF-8 strings to avoid decoding errors.