Overview
This node provides an in-memory key-value store (KVS) with multiple scopes for storing and retrieving data during workflow executions in n8n. It supports operations to set, get, delete, or clear key-value pairs within different scopes: execution, workflow, or instance level.
Common scenarios include:
- Temporarily storing intermediate data during a single workflow run.
- Persisting data across multiple runs of the same workflow.
- Sharing data globally across all workflows running on the same n8n instance.
For example, you could use it to cache API responses during a workflow execution to avoid redundant calls, or to keep track of counters or flags that persist between workflow runs.
Properties
Name | Meaning |
---|---|
Scope | The scope where data is stored or cleared: - Workflow: Data persists across workflow executions. - Instance: Data is shared across all workflows in this n8n instance. - Execution: Data is only available during the current workflow execution. |
(Note: For the "Clear" operation, only the "Scope" property is relevant as per your request.)
Output
The node outputs a JSON object containing the result of the operation under the kvsResult
field. For the "Clear" operation, the output structure is:
{
"kvsResult": {
"success": true,
"operation": "clear",
"scope": "<scope>"
}
}
success
: Boolean indicating if the clear operation was successful.operation
: The string"clear"
indicating the performed operation.scope
: The scope where the data was cleared (workflow
,instance
, orexecution
).
No binary data is produced by this node.
Dependencies
- This node uses an internal in-memory key-value storage engine.
- No external services or API keys are required.
- No special environment variables or n8n credentials are needed.
Troubleshooting
- Could not determine workflow ID: This error occurs if the node cannot identify the current workflow's unique identifier when using the "workflow" or "execution" scope. Ensure the node is executed within a valid workflow context.
- Unsupported operation: If an invalid operation is specified, the node will throw an error. Make sure to select one of the supported operations ("set", "get", "delete", "clear").
- Since this node stores data in memory, data in the "execution" scope will be lost after the workflow finishes, and data in other scopes may be lost if the n8n instance restarts.