Declare anDocumentation Index
Fetch the complete documentation index at: https://docs.bastani.ai/llms.txt
Use this file to discover all available pages before exploring further.
inputs array on defineWorkflow and:
- The CLI materialises one
--<field>=<value>flag per declared input. - Required-field, enum-membership, integer, and unknown-flag validation runs before any session spawns.
- The interactive picker renders the same schema as a form.
- Your worker’s composition root iterates the schema via
getInputSchema(workflow)to register the same flags one-for-one.
Declaring inputs
WorkflowInput shape
Field name. Used as the object key on
ctx.inputs and as the CLI flag (--<name>).string— single-line text input.text— multi-line text input.enum— one ofvalues[].integer— whole number; coerced from the string flag.
When
true, the input must be provided (unless it has a default or, for enum, the first declared value is used).Default value applied when no value is provided.
Required when
type: "enum". The set of allowed values.Used in CLI flag help, picker form labels, and
atomic workflow inputs <name> output.Placeholder text shown in the picker form.
Reading inputs in the workflow
Only declared field names are valid keys onctx.inputs. Accessing an undeclared field is a compile-time error.
Inspecting the schema at runtime
getInputSchema(workflow) returns the declared WorkflowInput[]. Use it to register CLI flags one-for-one:
validateInputs
runWorkflow calls validateInputs(workflow, raw) for you. You can call it directly when you need to validate before doing anything else:
defineWorkflowdefault values when no value is provided.- The first declared
values[]entry whenrequired: true && type: "enum"and no value is provided. - Whatever the caller passed in
raw.
Input precedence
CLI flags compose entirely at the calling-CLI layer — the SDK only sees the finalinputs map. The atomic CLI applies this order:
- Workflow-declared defaults.
- Required-enum first value.
- Whatever the user passes (positional
prompt,--<field>flags, picker form).
Inspecting a workflow’s schema from the CLI
Patterns
- Positional prompt — declare an input named
promptto acceptatomic workflow -n my-wf -a claude "the prompt". - Human-in-the-loop — see
examples/hil-favorite-color/for asking the user mid-workflow. - Structured output — see
examples/structured-output-demo/for JSON-schema-validated outputs per SDK.