GATHER: section defines structured information that the agent needs to collect from the user during a conversation. Each field specifies a data type, prompt, validation rules, and collection behavior. The runtime orchestrates multi-turn collection, extracting values from natural conversation and prompting for missing fields.
Syntax
At the top level of an agent document,GATHER: defines fields as named blocks:
FLOW: step, gather uses a different syntax. See GATHER within FLOW.
A top-level field here can carry an
ASR: listening-settings block (vocabulary, provider, language, no-input timeout) for round-trip compatibility, but it has no effect: the reasoning agent has no per-field prompt turn to apply it to, so the call’s existing listening settings are used instead, and the compiler warns GATHER_ASR_REASONING_UNSUPPORTED. ASR: only takes effect on a field gathered inside a FLOW: step — see Field-level listening settings.A
VOICE block with BARGE_IN and STREAMING is read only on a field of a FLOW step GATHER:. On a field of this top-level section it is not read and gives warning W170. See Voice delivery for a field.Field properties
Field types
Thetype property specifies the expected data type for the field value:
Entity binding
Instead of declaringtype, options, and validation inline, a field can reference a reusable
named entity from the ENTITIES: section via entity_ref. The
field then inherits the entity’s type, allowed values, synonyms, and validation.
A field with
entity_ref should not also declare type, options, or values — the referenced
entity owns that contract.Enum options
For enum-style fields,options lists the allowed values directly. Use it as an alternative to
validate: enum(...). Both inline and block forms are accepted:
Value provenance
Thesatisfied_by property restricts which sources may satisfy a field — useful for fields that
must come from an authoritative system rather than user claims.
Validation
validate is always a single-line string. What it’s read as depends on validation_process (default REGEX):
Validation process
enum(a, b, c) is the one special-cased validate expression: the compiler lowers it into the same allowed-values metadata as options — use whichever reads better for the field. Any other non-regex text (min(1), pattern(...), email(), and similar function-call-looking strings) is read literally as a regular expression, not evaluated as a function — it almost never matches what was intended, so don’t write validate that way.
Write a regular expression with a single backslash, such as ^\d{9}$. A double backslash is kept as two characters and never matches. The same applies to extraction_pattern.
A regular expression check rejects every value of type number, integer, currency, or boolean, because those values are not text. Do not put a regular expression validate on those types. Rely on the type, or collect the value as string.
retry_prompt, max_retries, and validation_process need a validate rule. Without one the compiler reports GATHER_VALIDATION_RULE_REQUIRED.
In a FLOW step GATHER, retry_prompt is the question the step asks again after a failed check, and max_retries counts failed attempts per field. When the limit is reached, the agent’s ON_ERROR handler for validation_error with SUBTYPE: max_retries_exceeded runs.
In a top-level GATHER, the model receives retry_prompt as a hint and asks again. The platform counts the attempts and records a validation_max_retries trace event. It resolves a matching ON_ERROR handler and applies its SET assignments, but it does not run the handler’s RESPOND, ESCALATE, or COMPLETE action. To act on the limit, collect the field in a FLOW step.
LLM inference
Wheninfer: true, the runtime can fill the field from what the customer already said, without asking. In a FLOW step, inference runs once, when the step starts to collect. It reads the last few customer messages. It does not read assistant messages, tool results, or memory. The conversation_history_window setting in EXECUTION sets how many messages it reads. The default is 2, the maximum is 10, and 0 turns inference off.
On a top-level GATHER, infer: true only makes the field eligible for extraction. The infer_confidence and infer_confirm properties have no effect there.
Inference properties
When the confidence in an inferred value falls below
infer_confidence, a FLOW step leaves the field empty and asks its prompt. Write infer, infer_confirm, and required as lowercase true or false. Any other spelling reads as false.
Use extraction_hints to steer extraction with example surface forms:
Extraction strategy
Thestrategy property selects how a value is extracted. It can be set per field, and the same
enum is available as a block-level default on flow-step gather.
Range collection
Whenrange: true, the field collects a range with low and high values instead of a single scalar:
{low: number, high: number}. Either end can be missing, so test budget.low IS SET AND budget.high IS SET. Do not set both list and range on one field. The list wins and the range is dropped without a warning.
List collection
Whenlist: true, the field collects multiple values as an array:
["vegetarian", "no nuts"]. A text reply is split on commas. A {{dietary_restrictions}} template prints the array as JSON. Use "item" IN dietary_restrictions to test membership, because CONTAINS works on text only. Do not add validate to a list or range field. The rule applies to the whole value and rejects valid answers.
Preference collection
preferences: true marks a field that holds preferences:
preferences.accept, preferences.desire, preferences.avoid, and preferences.refuse. That scan runs for top-level GATHER fields only.
Progressive activation
Theactivation property controls when a field becomes active for collection:
- A value that contains only a
//line comment is invalid. It is not treated as an omitted activation. - Malformed expressions receive a compiler diagnostic. An unknown activation mode, such as
sometimes, gets no diagnostic in line-based ABL, and a required field with that mode never completes. The YAML form reports errorE175. - For a required field, default GATHER completion stays incomplete when its activation declaration is invalid, even if the field already has a collected or default value.
- A valid condition that evaluates to false leaves the field inactive.
- The independent
required: false,optional, andprogressivepolicies, and an explicitly authoredCOMPLETE_WHEN, keep their existing completion rules. - Write the condition as a block:
activation:followed bywhen:on the next line. The one-line formactivation: { when: "..." }is stored as text, and the field never activates. - Write
whenin lowercase. An uppercaseWHEN:works only in line-based ABL. depends_ongates a field only withactivation: progressive. Withrequiredor no activation, it does not gate.- Write
depends_onas a one-line list, such as[a, b]. A multi-line list is misread without an error. - Write the mode in lowercase in a top-level
GATHER.
Field dependencies
Thedepends_on property lists fields that must be collected before this field activates. Combined with activation, this creates ordered collection flows:
Corrections handling
In flow steps, theCORRECTIONS: true property enables natural corrections — the user can update previously collected values by stating corrections in natural language:
Transient and sensitive fields
Sensitive fields
Fields markedsensitive: true carry PII and receive special handling:
pii_type so the redactor can produce a shape-preserving
mask:
pii_pattern_ref instead of pii_type:
pii_pattern_ref is a free-form reference — the parser has no project scope, so it can’t validate that the named pattern exists. It’s resolved at runtime when the field is written; a reference that matches no configured pattern falls back to pii_type and emits pii_pattern_ref_unresolved. Studio also flags a dangling reference in the gather field editor.
Sensitive display modes
Mask configuration
Write
mask_config as a block with snake_case keys. A camelCase key such as showLast gives warning W170 and the defaults apply. A one-line mask_config: {show_last: 2} is dropped without an error. Without a mask_config block, mask shows the last 3 characters. mask_config has no effect unless sensitive_display is mask. Write sensitive_display in lowercase. An unknown value, such as hide or MASK, shows the raw value.
Transient fields
Fields markedtransient: true are cleared from the session when an agent with a top-level GATHER completes or hands off. The property is not applied to fields in a FLOW step GATHER. Use it for sensitive data that should not persist beyond its immediate use:
Extraction patterns
Theextraction_pattern property defines a custom regex for extracting structured values from user input. Combined with extraction_group, it specifies which capture group to use:
Semantics
Thesemantics block provides supplemental metadata that helps the runtime interpret and process field values:
Semantics properties
Complete example
Related articles:
- Tools — tool definitions (tools and gather work together)
- FLOW — GATHER within flow steps uses a different syntax
- Language overview — syntax rules for lists and blocks