Skip to content

CollectNode

  • NodeVerification
optional ask?: (missing, state) => string;

Deterministic, framework-emitted question shown when fields are still missing. Collect extraction never speaks model-authored text, so this is the only user-facing copy a collect node produces. Must not claim any downstream outcome (order placed, delivery scheduled, payment, website).

Parameter Type

missing

string[]

state

FlowState

string


optional choices?: ChoiceOption[];

id: string;

optional instructions?: (missing, state) => Instructions;

Extraction-only guidance for the (non-speaking) field extraction turn. This text is NEVER shown to the user — see ask for user-facing copy.

Parameter Type

missing

string[]

state

FlowState

Instructions


kind: "collect";

optional maxTurns?: number;

onComplete: (data, state) =>
| Transition
| Promise<Transition>;
Parameter Type

data

unknown

state

FlowState

| Transition | Promise<Transition>


optional outputSchema?: StandardSchemaV1<unknown, unknown>;
NodeVerification.outputSchema

optional required?: string[];

Field names used for deterministic missing-field prompts. Zod object schemas expose these automatically; other Standard Schema implementations should declare them. Completion still validates the complete object asynchronously either way.


optional resolvers?: CollectResolverSpec[];

Deterministic tier-0 slot resolvers. A field resolved here is excluded from the model schema this turn.


schema: StandardSchemaV1;

optional verbatimFields?: readonly string[];

Fields the user must supply in their own words. A model-extracted value for one of these is dropped unless it appears in the turn text, which stops the model inventing an identifier the user never gave. Declare it only for slots that are quoted rather than normalised: extraction legitimately rewrites dates, times, numbers, enums and free-text summaries, and a value that arrives from a button or list reply is never in the turn text at all.


optional verify?: NodeVerify;
NodeVerification.verify