Skip to main content
Back to how-to guides Use this pattern when a field makes sense only after another answer, so the customer does not see irrelevant questions.

Concept

By default every required GATHER field is active from the start. The agent asks for all of them. A progressive field stays inactive until a rule says it applies. An inactive field is not asked and does not block completion. You control activation with the activation property. Use depends_on when the rule is “after these fields”. Use when when the rule depends on a value, such as “only for international transfers”. Progressive collection works on a top-level GATHER section and on a GATHER inside a FLOW step. The property names are the same.

Minimal working example

A travel agent asks for the destination first. It asks for the hotel class only after the destination is known. It asks for nights once the destination is set. agents/travel-booking.agent.abl
Variable sources:
  • All three variables are GATHER fields. The customer answers each prompt.
  • COMPLETE reads all three, so the compiler sees no unused field.

How it works

  1. The runtime computes the active fields at the start of each turn.
  2. It extracts values only for active fields. A progressive field is not filled early, even when the customer’s message contains a matching value, unless its dependency already has a value.
  3. It skips inactive fields when it checks for completion. A gated field does not block COMPLETE until it becomes active.
  4. In a FLOW step, the step prompt lists every active field that is still missing. The prompts appear in declaration order, one per line. A gated field appears in a later turn, after its dependencies fill.
  5. A field counts as having a value when it is not null, not undefined, and not an empty string.
When the customer corrects a field that other fields depend on, the runtime clears the dependent fields and asks for them again. This applies to FLOW GATHER with corrections on.

Common variations

Progressive fields inside a FLOW step

Inside a FLOW step, GATHER uses a list of fields. A when condition can read any field value. Write option lists without quotes. agents/transfer-collector.agent.abl
swift_code is active only when the transfer is international. A domestic transfer never asks for it.

Gate by condition only

Use when alone when no single field decides the rule. The condition uses the same expression syntax as COMPLETE and WHEN conditions. The compiler reports INVALID_CEL_SYNTAX for a bad expression. It warns with UNDEFINED_CONDITION_VAR for a variable that nothing declares.

Make a field optional

Use activation: optional for a field the customer may skip. The field never blocks completion. See Collect required and optional fields from users.

Verification

  1. Run the validator. Expect no errors and no warnings.
  2. Start a conversation. Expect the agent to ask only for the destination.
  3. Answer the destination. Expect the agent to ask for the hotel class and the nights.
  4. In the transfer example, choose domestic. Expect no SWIFT question. Repeat with international. Expect the SWIFT question.
  5. In the trace, open the dsl_collect events. Check which fields are active for the turn.
  6. Open the gather_slot_ledger events with the phase completion_check. missingFields must list only active fields.
  7. Correct the destination after the hotel class is set. Expect the hotel class to be asked again in a FLOW step.

Production readiness checklist

  • Every depends_on name exists in the same GATHER block.
  • Every progressive field has a path that activates it, or COMPLETE does not need it.
  • COMPLETE and the flow steps read every required field.
  • Tests cover each branch of every when condition.
  • Tests cover a customer who gives a later answer early, in the first message.
  • Tests cover a correction of a field that others depend on.

Common mistakes

Troubleshooting

Related articles: