Schema.Class or Model.Class boilerplate required.
Examples below omit
agents: declarations and agent: fields for brevity — see Nodes for complete step syntax.Workflow Input
The top-levelinput: block defines what the workflow accepts:
Schema validation as the Effect builder API. Invalid input is rejected before any steps run.
Step Output
Each step declares its output shape inline:Model from this declaration and manages the SQLite storage automatically.
Field Types
TOON supports these field types:| Type | TOON Syntax | Effect Equivalent |
|---|---|---|
| String | string | Schema.String |
| Number | number | Schema.Number |
| Boolean | boolean | Schema.Boolean |
| String literal | "value" | Schema.Literal("value") |
| Union literal | "a" | "b" | "c" | Schema.Literal("a", "b", "c") |
| Array | "string[]" | Schema.Array(Schema.String) |
| Optional | string? | Schema.optional(Schema.String) |
| Object | nested block | nested Schema.Struct |
Nested Objects
Nest objects by indenting:Optional Fields
Append? to make a field optional:
Schema.optional(...) and are undefined when not provided.
Imported Schemas
For complex or shared schemas, import them from TypeScript:Schema.Class or Model.Class definitions:
Schema Reuse Across Steps
When multiple steps produce the same shape, define the schema once at the top level:Arrays of Objects
Use[] suffix on an object type:
- prefix under bugs: indicates an array of objects.
Validation
TOON schemas are validated at two points:- Build time — the
.toonfile is parsed and schema definitions are checked for valid types - Runtime — workflow input is validated against the input schema, and step outputs are validated against output schemas before persistence