CollectNode
Extends
Section titled “Extends”NodeVerification
Properties
Section titled “Properties”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).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”string
choices?
Section titled “choices?”optional choices?: ChoiceOption[];id: string;instructions?
Section titled “instructions?”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”kind: "collect";maxTurns?
Section titled “maxTurns?”optional maxTurns?: number;onComplete
Section titled “onComplete”onComplete: (data, state) => | Transition| Promise<Transition>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
Returns
Section titled “Returns”| Transition
| Promise<Transition>
outputSchema?
Section titled “outputSchema?”optional outputSchema?: StandardSchemaV1<unknown, unknown>;Inherited from
Section titled “Inherited from”NodeVerification.outputSchemarequired?
Section titled “required?”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.
resolvers?
Section titled “resolvers?”optional resolvers?: CollectResolverSpec[];Deterministic tier-0 slot resolvers. A field resolved here is excluded from the model schema this turn.
schema
Section titled “schema”schema: StandardSchemaV1;verbatimFields?
Section titled “verbatimFields?”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.
verify?
Section titled “verify?”optional verify?: NodeVerify;Inherited from
Section titled “Inherited from”NodeVerification.verify