Represents a state field whose value is transient and never checkpointed.
Use UntrackedValue for state fields that should be tracked for the lifetime of the process, but should not participate in durable checkpoints or recovery.
class UntrackedValue// Create an untracked in-memory cache
const cache = new UntrackedValue<Record<string, number>>();
// Use with a type schema for basic runtime validation
import { z } from "zod";
const tempSession = new UntrackedValue(z.object({ token: z.string() }), { guard: false });
// You can customize whether to throw on multiple updates per step:
const session = new UntrackedValue(undefined, { guard: false });Whether to guard against multiple updates to this untracked value in a single step.
true (default), throws an error if multiple updates are received in one step.false, only the last value from that step is kept, others are ignored.This helps prevent accidental state replacement within a step.
Optional schema describing the type and shape of the value stored in this field.
If provided, this can be used for runtime validation or code generation.