| name | iii-state-management |
| description | Creates scoped key-value stores, reads and writes state entries, lists keys, and performs partial updates across functions. Use when persisting data between invocations, managing user sessions, caching computed values, storing feature flags, sharing state between workers, or building a KV data layer as an alternative to Redis or DynamoDB. |
State Management
Comparable to: Redis, DynamoDB, Memcached
Key Concepts
Use the concepts below when they fit the task. Not every state operation needs all of them.
- State is a scoped key-value store accessed via built-in trigger functions
- Install or enable state with
iii worker add iii-state
- state::set writes a value; state::get reads it (returns
null for missing keys)
- state::list retrieves all keys in a scope; state::delete removes a key
- state::list_groups lists scopes that contain state data
- state::update performs a partial merge using an
ops array for fine-grained changes
- Payloads use
scope, key, and value to address state entries
- State is shared across all functions — use meaningful scope names to avoid collisions
Architecture
Function
→ trigger('state::set', { scope, key, value })
→ trigger('state::get', { scope, key })
→ trigger('state::update', { scope, key, ops })
→ trigger('state::delete', { scope, key })
→ trigger('state::list', { scope })
→ iii-state → KvStore / Redis adapter
iii Primitives Used