@etohq/workflows-input-schema
v0.0.1-next-20260318155517
Published
Renderer-agnostic input schema spec + logic AST + validation plugin contracts
Readme
@etohq/workflows-input-schema
Canonical, renderer-agnostic input schema spec for Eto Workflows.
This package only contains types: the executable runtime lives in
@etohq/workflows-input-schema-runtime, and the builder/editor model lives in
@etohq/workflows-input-schema-builder.
Core Ideas
- JSON-safe values: submissions and rule operands use
InputValue(scalars + tagged wrappers). - Canonical logic AST: rules use
PredicateSpec(and/or/not/op) +PredicateRef. - Deterministic semantics: avoid UI-specific behavior in the spec.
Minimal Example
import type { InputSchemaSpec } from "@etohq/workflows-input-schema"
export const schema: InputSchemaSpec = {
id: "schema_1",
version: 1,
name: "Onboarding",
fields: [
{ key: "name", value_type: "string", required: true },
{ key: "dob", value_type: "date", required: false },
],
layout: [
{ type: "section", id: "s1", children: [{ type: "field", field_key: "name" }] },
{ type: "ending", id: "done", title: { default: "Done" } },
],
rules: [
{
id: "end_when_name_present",
scope: { node_id: "s1" },
when: { type: "op", op: "is_present", left: { type: "field", field_key: "name" } },
then: [{ type: "end", ending_id: "done" }],
},
],
}Notes
RuleSpec.scopeis node-scoped only ({ node_id }). Field scoping (if needed) is a builder-only convenience that compiles intonode_id.
