KV Store

Read, write, list, and delete keys in a bucket of a key-value store. The url picks the store:

URLStore
redb://<path>A redb file, relative to the working directory unless absolute. Created when missing.
nats://, tls://, ws://, wss:// or <host>:<port>A NATS JetStream server.

Any other scheme fails when the flow loads.

Operations

OperationDescription
getRead a value by key.
putWrite event.data.content to key; without key, write every entry of event.data.entries under key_prefix.
listList keys under key_prefix.
deleteDelete a key.

Configuration

- kv_store:
    name: write_flow
    url: "redb://.flowgen/state.redb"
    bucket: flowgen_system
    operation: put
    key: "flows.{{event.data.path}}"

Fields

FieldTypeDefaultDescription
namestringrequiredTask name.
urlstringrequiredredb://<path>, or the URL of a NATS server. Supports {{env.VAR_NAME}} templates.
credentials_pathstringNATS credentials file. A redb file takes none.
bucketstringrequiredBucket name, created when missing.
operationstringrequiredOne of get, put, list, delete.
keystringKey for get, put, and delete; required for get and delete. Letters, digits and -/_=., not starting or ending with .. Supports templating.
key_prefixstringKey prefix for list, and for the keys of put entries; a put needs key or key_prefix. Supports templating.
pruneboolfalseFor a put of entries: delete the keys under key_prefix that no entry names. Requires a key_prefix ending in . or /.
allow_emptyboolfalseWith prune: let an empty entries list delete every key under key_prefix. Otherwise it fails and deletes nothing.
include_valuesboolfalseFor list: also return each key’s value under values.
ttldurationFor put: how long the value lives, e.g. 30d. On NATS it needs a bucket with per-key TTL (NATS 2.11+), as this task creates; on another bucket the task fails to start.
natsobjectOptions of a NATS server url: history, the values the bucket keeps per key, 1 to 64 (default 1), set when this task creates the bucket. Set on a redb:// URL, the task fails to load.
depends_onlistUpstream task names.
retryobjectRetry configuration.

Output

Format: JSON

get

FieldTypeDescription
keystringRequested key.
contentstring / nullStored value, or null if not found.
foundboolWhether the key exists.

put and delete

FieldTypeDescription
keystringWritten or deleted key.

A put of entries returns instead:

FieldTypeDescription
putarrayKeys written because they were new or changed.
deletedarrayKeys removed by prune.
unchangedintEntries that already held their value.

list

FieldTypeDescription
keysarrayKeys under the prefix.
countintNumber of keys returned.
prefixstringPrefix that was listed.
valuesobjectEach key’s value, with include_values.

Examples

Mirror a set of keys

The incoming event carries {"entries": [{"key": "orders/sync", "value": "..."}]}. Keys under key_prefix end up exactly as listed: new and changed values are written, identical ones are left alone, and keys that are no longer listed are deleted.

- kv_store:
    name: apply_flows
    url: "nats://{{env.NATS_HOST}}:4222"
    credentials_path: "{{env.FLOWGEN_CREDENTIALS}}/nats.json"
    bucket: flowgen_system
    operation: put
    key_prefix: "flows."
    prune: true

Read a key

- kv_store:
    name: load_setting
    url: "redb://.flowgen/state.redb"
    bucket: settings
    operation: get
    key: "my_setting"

Returns {key, content, found}. content is null if the key does not exist.

Get the edge.

News, releases, and insights — no noise.

ul. Złota 75A lok. 7, 00-819 Warszawa HQ
NIP 5090052574 · REGON 381354056
Copyright © 2026 CONNVE. All rights reserved.