Key-Value Set
Key-Value Set writes the value of a
key-value store entry, picked by the entry or by
its key. Use it at the end of a flow to persist a cursor, timestamp, or
counter that the next run reads with
Key-Value Get or the $kv expression root.
You find it on the node picker’s Storage shelf.
By entry or by key
Section titled “By entry or by key”Pick the Entry, or leave it empty and give a Key. By key, the
entry is created when the workspace has none under it, and every entry
under the key is written when there are several, so $kv reads the new
value whichever it finds. A key can be an expression, which is how a flow
keeps one entry per customer: cursor:{{ $prev->customerId }}. Setting
neither fails the run.
Configuration
Section titled “Configuration”

| Field | Type | Default | Description |
|---|---|---|---|
Entry (keyValueStoreId) | string ✦ (optional) | — | The key-value entry to write to. Leave empty to write by key instead. |
Key (key) | string ✦ (optional) | — | Or the key to write, creating the entry when the workspace has none under it. |
Value (value) | string ✦ (optional) | — | The value to store under the chosen entry. |
Fields marked ✦ accept expressions.
Try this node — run it once against your own workspace, with your credentials, without building a flow first.
Output
Section titled “Output”The node writes the resolved value to the entry, then emits its upstream input unchanged as its own output, so you can place it mid-flow without disrupting the JSON pipeline.
When an Agent calls this node as a tool, the write follows the agent’s approval mode: it asks first in the default mode and runs on its own in Auto-write. See Add human approval.
What gets stored
Section titled “What gets stored”An entry holds any JSON value. Valid JSON is stored as its own type; text that is not valid JSON is stored as a string.
The value field resolves to |
Stored as |
|---|---|
null |
null |
42 |
the number 42 |
4.25 |
the number 4.25 |
true |
the boolean true |
{"cursor": "abc"} |
an object |
[1, 2, 3] |
an array |
"42" |
the string 42 |
hello |
the string hello |
007 |
the string 007, because a leading zero is not valid JSON |
| nothing at all | an empty string |
Example
Section titled “Example”The KeyValueStore / Set template in the
template gallery stores an object built from
the upstream output with a @json block:
@json($prev){ "lastSyncedAt": "$.lastSyncedAt", "version": "$.version", "cursor": "$.cursor", "updatedBy": "smoke-test"}@endjsonFor a single scalar, write the expression on its own; wrap it in quotes when the result must be stored as a string even if it looks like a number:
{{ $prev->cursor }}"{{ $prev->cursor }}"A computed value goes through echo tags in a raw-text template, because
a @json body is strict JSON and cannot contain function calls:
{ "lastRunAt": {!! json_encode(now()->toIso8601String()) !!}, "startedBy": {!! json_encode($start->userEmail) !!}}Related
Section titled “Related”- Key-Value Get reads the value in the next run.
- Key-value covers creating and managing entries.
- Use expressions documents
@jsonblocks, echo tags, and the$kvroot.