Overview
This node provides an in-memory key-value store (KVS) with multiple scopes for storing, retrieving, deleting, and clearing data. It is useful when you want to persist or share data temporarily within workflows or across the entire n8n instance without relying on external databases.
Common scenarios include:
- Caching intermediate results during workflow execution.
- Sharing state or configuration data between different workflows in the same n8n instance.
- Storing temporary flags or counters that reset after each workflow run.
For example, you can use this node to count how many times a particular event has occurred during a workflow execution or to store user preferences accessible by multiple workflows.
Properties
Name | Meaning |
---|---|
Scope | Defines where the data is stored: - Workflow: Data persists across executions of the current workflow. - Instance: Data is shared across all workflows in the n8n instance. - Execution: Data exists only during the current workflow execution. |
Key | The identifier string for the value to set, get, or delete. |
Note: The provided properties are specific to the "Delete" operation under the "Default" resource.
Output
The node outputs a JSON object containing the result of the operation under the kvsResult
field. For the Delete operation, the output includes:
success
: Boolean indicating whether the deletion was successful.key
: The key that was deleted.operation
: The string"delete"
indicating the performed operation.
Example output JSON:
{
"kvsResult": {
"success": true,
"key": "myKey",
"operation": "delete"
}
}
No binary data is produced by this node.
Dependencies
- This node uses an internal singleton key-value engine to manage data storage in memory.
- No external services or API keys are required.
- No special environment variables or n8n configurations are needed.
Troubleshooting
- Could not determine workflow ID: This error occurs if the node cannot identify the current workflow's ID when using the "workflow" or "execution" scope. Ensure the node is used within a properly initialized workflow context.
- Unsupported operation: If an invalid operation is specified, the node will throw an error. Confirm the operation is one of "set", "get", "delete", or "clear".
- JSON parsing errors: When setting or getting values with JSON parsing enabled, invalid JSON strings will cause errors. Verify that input strings are valid JSON.
- Key not found: When getting a key that does not exist, the node returns the default value if provided; otherwise, it may return null or undefined.