iii / worker
$worker

iii-state

v0.12.0

Distributed key-value state management with reactive change triggers.

engine module
baked into the iii engine; no separate install required.

functions

6

state::delete

function

Delete a value from state

request
  • keystringrequired

    Identifier for the value to delete within the scope.

  • scopestringrequired

    Namespace that groups related keys.

response
valueunknown

state::get

function

Get a value from state

request
  • keystringrequired

    Identifier for the value within the scope.

  • scopestringrequired

    Namespace that groups related keys.

response
valueunknown

state::list

function

Get a group from state

request
  • scopestringrequired

    Namespace whose keys should be listed as a group.

response
valueunknown

state::list_groups

function

List all state groups

request
empty object
response
  • groupsstring[]required

state::set

function

Set a value in state

request
  • keystringrequired

    Identifier for the value within the scope.

  • scopestringrequired

    Namespace that groups related keys (e.g. `users`, `orders`).

  • valueunknownrequired

    Arbitrary JSON value to store. Replaces any existing value at `scope`/`key`.

response
  • new_valueunknownrequired

    The value after the update

  • old_valueunknown

    The value before the update (None if key didn't exist)

state::update

function

Update a value in state

request
  • keystringrequired

    Identifier for the value to update within the scope.

  • opsunknown[]required

    Ordered list of update operations applied atomically to the existing value.

  • scopestringrequired

    Namespace that groups related keys.

response
  • errorsunknown[]

    Errors encountered while applying ops. Successfully applied ops are still reflected in `new_value`. Field is omitted from JSON when empty for backward compatibility.

  • new_valueunknownrequired

    The value after the update

  • old_valueunknown

    The value before the update (None if key didn't exist)

triggers

1

state

trigger

State trigger

invocation
  • condition_function_idstring

    Optional function ID to evaluate before invoking handler

  • keystring

    State key to watch (exact match filter)

  • scopestring

    State scope to watch (exact match filter)

return
  • event_typeall ofrequired

    Type of state change

    all of (1)
    variant 1
    valueunknown
  • keystringrequired

    State key

  • new_valueunknownrequired

    New value

  • old_valueunknown

    Previous value (null for created events)

  • scopestringrequired

    State scope

  • typestringrequired

    Always "state"