Skip to content
Registry

state

v0.21.1

Distributed key-value state management with reactive change triggers — registers the `state` trigger type and the `state::*` functions.

Install

bash
iii trigger compose::add worker=state@0.21.1

Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.

Functions7

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
valuestring

state::get

Function

Get a value from state

Request
  • keystringrequired

    Identifier for the value within the scope.

  • scopestringrequired

    Namespace that groups related keys.

Response
valuestring

state::list

Function

Get a group from state

Request
  • scopestringrequired

    Namespace whose keys should be listed as a group.

Response
valuestring

state::list_groups

Function

List all state groups

Request
Empty object
Response
  • groupsstring[]required

state::on-config-change

Function

Internal: reload state configuration from the authoritative store on change.

Request
Empty object
Response
  • okbooleanrequired

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.

  • opsone of[]required

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

    one of (6)
    Variant 1
    • pathstringrequired
    • typestringrequiredenum set
    • valueunknown
    Variant 2
    • pathany of
      Show 2 nested
      any of (2)
      Variant 1
      any of (2)
      Variant 1
      valuestring
      Variant 2
      itemsstring[]
      Variant 2
      valuenull
    • typestringrequiredenum merge
    • valueunknownrequired
    Variant 3
    • byinteger· int64required
    • pathstringrequired
    • typestringrequiredenum increment
    Variant 4
    • byinteger· int64required
    • pathstringrequired
    • typestringrequiredenum decrement
    Variant 5
    • pathany of
      Show 2 nested
      any of (2)
      Variant 1
      any of (2)
      Variant 1
      valuestring
      Variant 2
      itemsstring[]
      Variant 2
      valuenull
    • typestringrequiredenum append
    • valueunknownrequired
    Variant 6
    • pathstringrequired
    • typestringrequiredenum remove
  • scopestringrequired

    Namespace that groups related keys.

Response
  • errorsobject[]

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

    • codestringrequired

      Stable error code, e.g. `"merge.path.too_deep"`.

    • doc_urlstring

      Optional documentation URL for this error class.

    • messagestringrequired

      Human-readable description with concrete numbers when applicable.

    • op_indexinteger· uintrequiredmin 0

      Index of the offending op within the original `ops` array.

  • new_valueunknownrequired

    The value after the update

  • old_valueunknown

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

Triggers1

state

Trigger

State trigger

Invocation
  • condition_function_idstring

    Optional function evaluated per event; only an explicit `false` skips.

  • keystring

    Only fire for writes to this key (any key when unset).

  • scopestring

    Only fire for writes in this scope (any scope when unset).

Return
  • event_typeall ofrequired

    Type of state change

    all of (1)
    Variant 1
    valuestringenum state:created, state:updated, state:deleted
  • keystringrequired

    State key

  • new_valueunknownrequired

    New value

  • old_valueunknown

    Previous value (null for created events)

  • scopestringrequired

    State scope

  • typestringrequired

    Always "state"

Search the registry

Find workers, kits and executables, or jump to a page.