Skip to main content

generated-schema


title: Schema Reference sidebar_position: 1

DSL schema reference

A ruleset is a JSON document that describes a business process as a tree of steps. Every field documented below is derived from the Zod schema the engine actually enforces at save time — this page is generated from that schema, so it cannot describe a shape the engine would reject, nor omit one it accepts.

Schema version 1 is the only version this engine supports. No step executes in this phase: the schema fixes the document shape and its validation, not any run behaviour.

Envelope fields

The top-level fields of a ruleset document:

FieldPresence
schemaVersionrequired
namerequired
envelopeoptional
subjectKeyoptional
timezoneoptional
stepsrequired

timezone is optional and defaults to UTC when the ruleset declares none; when declared, it must be a zone identifier the host platform's own timezone database recognizes, and the same value is what every date/time function in the ruleset resolves against.

Step types

Every step declares a type drawn from this fixed, six-member catalog:

Step type
compute
branch
foreach
lookup
xmlTransform
extract

JSON Schema

The full JSON Schema, generated from rulesetSchema via Zod v4's native z.toJSONSchema():

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"schemaVersion": {
"type": "number"
},
"name": {
"type": "string",
"minLength": 1
},
"envelope": {
"type": "object",
"properties": {
"wallClockMs": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"stepCount": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"memoryBytes": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"foreachIterations": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"modelCalls": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"subjectKey": {
"type": "string"
},
"timezone": {
"type": "string"
},
"steps": {
"$ref": "#/$defs/__schema0"
}
},
"required": [
"schemaVersion",
"name",
"steps"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"onError": {
"default": {
"mode": "hard"
},
"oneOf": [
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "hard"
}
},
"required": [
"mode"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "soft"
},
"fallback": {}
},
"required": [
"mode",
"fallback"
],
"additionalProperties": false
}
]
},
"type": {
"type": "string",
"const": "compute"
},
"outputs": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"id",
"onError",
"type",
"outputs"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"onError": {
"default": {
"mode": "hard"
},
"oneOf": [
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "hard"
}
},
"required": [
"mode"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "soft"
},
"fallback": {}
},
"required": [
"mode",
"fallback"
],
"additionalProperties": false
}
]
},
"type": {
"type": "string",
"const": "branch"
},
"cases": {
"type": "array",
"items": {
"type": "object",
"properties": {
"when": {
"type": "string"
},
"steps": {
"$ref": "#/$defs/__schema0"
}
},
"required": [
"when",
"steps"
],
"additionalProperties": false
}
},
"otherwise": {
"$ref": "#/$defs/__schema0"
}
},
"required": [
"id",
"onError",
"type",
"cases"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"onError": {
"default": {
"mode": "hard"
},
"oneOf": [
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "hard"
}
},
"required": [
"mode"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "soft"
},
"fallback": {}
},
"required": [
"mode",
"fallback"
],
"additionalProperties": false
}
]
},
"type": {
"type": "string",
"const": "foreach"
},
"collection": {
"type": "string"
},
"itemVar": {
"type": "string"
},
"indexVar": {
"type": "string"
},
"steps": {
"$ref": "#/$defs/__schema0"
}
},
"required": [
"id",
"onError",
"type",
"collection",
"itemVar",
"steps"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"onError": {
"default": {
"mode": "hard"
},
"oneOf": [
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "hard"
}
},
"required": [
"mode"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "soft"
},
"fallback": {}
},
"required": [
"mode",
"fallback"
],
"additionalProperties": false
}
]
},
"type": {
"type": "string",
"const": "lookup"
},
"dataset": {
"type": "string"
},
"datasetVersion": {
"type": "string"
},
"match": {
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"equal",
"notEqual",
"lessThan",
"lessThanInclusive",
"greaterThan",
"greaterThanInclusive",
"in",
"notIn",
"contains",
"doesNotContain",
"approxEqual"
]
},
"value": {
"type": "string"
},
"tolerance": {
"type": "number"
}
},
"required": [
"field",
"operator",
"value"
],
"additionalProperties": false
}
},
"cardinality": {
"type": "string",
"enum": [
"one",
"many"
]
},
"output": {
"type": "string"
}
},
"required": [
"id",
"onError",
"type",
"dataset",
"match",
"cardinality",
"output"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"onError": {
"default": {
"mode": "hard"
},
"oneOf": [
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "hard"
}
},
"required": [
"mode"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "soft"
},
"fallback": {}
},
"required": [
"mode",
"fallback"
],
"additionalProperties": false
}
]
},
"type": {
"type": "string",
"const": "xmlTransform"
},
"input": {
"type": "string"
},
"xsd": {
"type": "object",
"properties": {
"ref": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"ref",
"version"
],
"additionalProperties": false
},
"schematron": {
"type": "object",
"properties": {
"ref": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"ref",
"version"
],
"additionalProperties": false
},
"conversion": {
"type": "object",
"properties": {
"convention": {
"type": "string",
"const": "rl-xml-json-v1"
},
"namespaces": {
"type": "string",
"enum": [
"prefix",
"strip",
"uri"
]
},
"attributePrefix": {
"type": "string"
},
"repeatedElements": {
"type": "string",
"enum": [
"always-array",
"array-when-repeated"
]
},
"mixedContent": {
"type": "string",
"enum": [
"text-key",
"reject"
]
}
},
"required": [
"convention",
"namespaces",
"attributePrefix",
"repeatedElements",
"mixedContent"
],
"additionalProperties": false
},
"output": {
"type": "string"
},
"violationsOutput": {
"type": "string"
}
},
"required": [
"id",
"onError",
"type",
"input",
"xsd",
"conversion",
"output",
"violationsOutput"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"onError": {
"default": {
"mode": "hard"
},
"oneOf": [
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "hard"
}
},
"required": [
"mode"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "soft"
},
"fallback": {}
},
"required": [
"mode",
"fallback"
],
"additionalProperties": false
}
]
},
"type": {
"type": "string",
"const": "extract"
},
"document": {
"type": "string"
},
"ai": {
"type": "object",
"properties": {
"model": {
"type": "string"
},
"prompt": {
"oneOf": [
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "generated"
}
},
"required": [
"mode"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "authored"
},
"text": {
"type": "string"
}
},
"required": [
"mode",
"text"
],
"additionalProperties": false
}
]
},
"targetSchema": {},
"cache": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"reuse",
"bypass"
]
},
"ttlSeconds": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"mode"
],
"additionalProperties": false
}
},
"required": [
"model",
"prompt",
"targetSchema",
"cache"
],
"additionalProperties": false
},
"output": {
"type": "string"
}
},
"required": [
"id",
"onError",
"type",
"document",
"ai",
"output"
],
"additionalProperties": false
}
]
}
}
}
}