Skip to main content
protected children(): Promise<ChildRef[]>
The children this agent has, as the platform records them. The list is read from the platform every time, not from anything this agent wrote down. That is the point: a parent that crashed after creating three workers and came back remembering nothing still enumerates all three, because the record of who belongs to whom never lived in the parent’s state in the first place. There is no registry to keep in sync, and none to lose. Children can be of different types, so what comes back are descriptors rather than stubs — one class cannot type them all. Each carries the name the child is addressed by, so turning one into a live handle is the ordinary binding call:
An agent with no children gets an empty array, not an error. Added with SDK 0.15 — a new inherited member, so a subclass that already declares children must rename it (or align it to override this method). Returns Promise<ChildRef[]> Every child attached to this agent, of every type.

ChildRef

One child of an agent, as the platform records it. A descriptor, not a handle: children of one parent can be of different types, so there is no single class to type a stub against. Turn one into a live handle with the binding for its type — env.<BINDING>.idFromName(child.name). Properties createdAt
readonly createdAt: Date
When the child was created.
name
readonly name: string
The child’s address — the same string env.<BINDING>.idFromName(...) takes, so a descriptor becomes a callable stub without translation.
status
readonly status: string
The child’s lifecycle status as the platform reports it.
type
readonly type: string
The actor type the child runs as, e.g. "Worker".