Context chains
Explicit context records can represent parent/root workflow trees with participants, versions and conversation references. Use the context domain API for those application records.
The runtime's executable model context is a separate backend handler/witness with authorized source versions, profile provenance, bounded tokens and captured stage cutoffs. Passing an explicit context record cannot override published Agent instructions, policy or authority.
For backend execution, choose the published indexed-plus-pending or strict memory mode. See context design and memory orchestration.
Working with explicit chains
Create a root with purpose, memorySpaceId and optional owner/data. Pass its returned contextId as parentId when creating a child. get(childId, { includeChain: true }) returns a ContextChain with the current context, root, optional parent, ancestors/descendants, siblings, depth and total node count. getChildren(id, { recursive: true, status: "active" }) selects active descendants; without recursive, it selects immediate children.
Update status/data with contexts.update. getHistory returns retained version/status/data/timestamp/updater records; getVersion and getAtTimestamp(id, Date) return null when a retained state is absent. At deletion, choose cascadeChildren or orphanChildren explicitly and inspect descendant/orphan results. JSON/CSV export can include chain and version history. The context reference and supported example define the exact parameters/results.