Skip to content

Get or Write Cache Node

Data/Cache

Returns the cached value, or stores the fallback and returns that. Exactly one caller gets Written = true, even when several runs reach this node at the same moment. The cache is for small, hot values (about 1 MB max) — persist large data to the app's storage instead.

cache_get_or_writedata
Inputs5
Outputs3
Security exposure8/10
Packagedata

Ratings

Scores range from 0 to 10. Higher values mean more impact, exposure, or operational weight.

SecurityAttack surface and exposure impact.
8/10High
PrivacyPotential sensitivity of processed data.
7/10High
PerformanceRuntime or resource pressure.
9/10High
GovernancePolicy, audit, or compliance impact.
8/10High
ReliabilityOperational stability considerations.
9/10High
CostExternal or compute cost impact.
9/10High

Input Pins

5

Input

Execution
exec_in

Initiate Execution

Cache

Struct
cache

Cache handle from the Open Cache node

FlowCacheFlowCache2 fields
scopeCacheScoperequired

Who a cache entry belongs to. Mirrors `flow_like_types::cache::CacheScope` on the wire; kept as its own type so the pin dropdown can carry friendly labels.

variant 1constvariant

Shared by everyone who can execute in the app.

const "app"
variant 2constvariant

Private to the user who triggered the run.

const "user"
namespacestring

Optional grouping travelling alongside every key. Entries sharing a namespace can be invalidated together; unrelated flows also use it to keep short keys from colliding.

default ""
Schema enforced

Key

String
key

The key to read or claim

Fallback

Generic
fallback

Value to store when the key holds nothing live — any type

Lifetime (s)

Integer
ttl_seconds

Seconds until a newly written entry expires. 0 keeps it until it is deleted.

Default 0

Output Pins

3

Output

Execution
exec_out

Done with the Execution

Value

Generic
value

The value now held under the key — whatever type was stored

Written

Boolean
written

True when this run is the one that stored the fallback. Branch on this to do expensive work only once.

Node Info

Internal name
cache_get_or_write
Category
Data/Cache
Version
2