Execution context for storing and retrieving values during a run.

Functions

get

fn (key: Str | Var): Any
fn (key: Str | Var, default-value: Any): Any

Retrieve a value from the execution context by key.

With one argument, returns the stored value or null if key is not set. With two arguments, returns default-value when the key is unset or stored as null.

Example

api-key ::hot::ctx/get("anthropic.api.key")
model   ::hot::ctx/get("brain.model", "claude-sonnet-4-5")

set

fn (ctx-map: Map)
fn (key: Str | Var, value: Any): Any

Store value in the execution context under key. Also accepts a map to set several values at once.

If the key is defined in ctx metadata, the secret setting of the key determines whether the value is masked in logs.

Example

::ctx ::hot::ctx

::ctx/set("request-id", Uuid())
::ctx/set({tenant: "acme", region: "us-east-1"})

::ctx/get("request-id")

set-secret

fn (ctx-map: Map)
fn (key: Str | Var, value: Any): Any

Store value in the execution context under key, explicitly marking it as a secret.

Prefer this over ::hot::ctx/set for runtime-created secrets that are not defined in ctx metadata, so that the value will be masked in logs.

Example

::ctx ::hot::ctx

token exchange-oauth-code(code)
::ctx/set-secret("provider.access.token", token)
// Later log lines render the value as ****