{
"$schema": "http://json-schema.org/draft/2020-12/schema",
"description": "Describes the user inputs needed to execute a Virtual Workflow and to render a screen for those inputs.",
"type": "object",
"anyOf": [
{ "required": ["groups"] },
{ "required": ["compositionToVary"] }
],
"properties": {
"groups": {
"description": "A map of named groups, each containing a set of input properties to render on screen.",
"type": "object",
"propertyNames": {
"description": "The key name of the group.",
"pattern": "^[A-Za-z0-9 _-]+$",
"maxLength": 100
},
"additionalProperties": {
"description": "A group object containing a label and one or more input properties.",
"type": "object",
"properties": {
"label": {
"description": "The display label for the group.",
"type": "string",
"minLength": 1
}
},
"propertyNames": {
"description": "The key name of the group property.",
"pattern": "^[A-Za-z0-9 _-]+$",
"maxLength": 100
},
"additionalProperties": {
"description": "A single input property definition including control type, constraints, and value.",
"type": "object",
"properties": {
"label": {
"description": "The display label for this specific input field.",
"type": "string",
"minLength": 1
},
"enabled": {
"description": "Indicates if the field is interactive or read-only.",
"type": "boolean"
},
"required": {
"description": "Whether a value must be provided. Cannot be used if 'range' is present.",
"type": "boolean"
},
"inputControl": {
"description": "The UI component type to be rendered.",
"enum": ["TextField", "TextArea", "NumberField", "Slider", "Checkbox", "Dropdown"]
},
"value": {
"description": "The current state or value of the input. Type must match the inputControl. For Dropdown, this is always an array of strings.",
"type": ["string", "number", "boolean", "array"]
},
"multiSelect": {
"description": "Applicable to Dropdown. If true, allows selecting multiple options.",
"type": "boolean",
"default": false
},
"format": {
"description": "Specifies the visual formatting for numeric data.",
"enum": ["integer", "decimal", "percent"]
},
"range": {
"description": "Defines a set of min, target, and max values for numeric inputs.",
"type": "object",
"properties": {
"min": {
"description": "The lower bound of the allowed range.",
"$ref": "#/$defs/RangeProperty"
},
"target": {
"description": "The ideal or reference value within the range.",
"$ref": "#/$defs/RangeProperty"
},
"max": {
"description": "The upper bound of the allowed range.",
"$ref": "#/$defs/RangeProperty"
}
},
"minProperties": 2,
"additionalProperties": false
},
"constraints": {
"description": "Validation rules for numeric, slider and text inputs.",
"type": "object",
"additionalProperties": false,
"properties": {
"min": {
"description": "The minimum allowed value for NumberField or Slider inputs",
"type": "number"
},
"max": {
"description": "The maximum allowed value for NumberField or Slider inputs.",
"type": "number"
},
"step": {
"description": "The increment step for Slider inputs.",
"type": "number"
},
"maxLength": {
"description": "The maximum character length for TextField or TextArea inputs.",
"type": "number",
"minimum": 0,
"maximum": 1000
}
}
},
"items": {
"description": "A list of options for Dropdown input controls.",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "object",
"required": ["value", "label"],
"additionalProperties": false,
"properties": {
"value": {
"description": "The technical value submitted to the backend.",
"type": "string",
"pattern": "^[A-Za-z0-9 _-]+$",
"maxLength": 100
},
"label": {
"description": "The user-friendly label displayed in the dropdown list.",
"type": "string",
"maxLength": 100
}
}
}
}
},
"required": ["inputControl"],
"dependentSchemas": {
"range": {
"description": "When 'range' is present: inputControl must be NumberField or Slider, and 'value' and 'required' cannot be set.",
"properties": {
"inputControl": { "enum": ["NumberField", "Slider"] },
"value": false,
"required": false
}
},
"items": {
"description": "items is only applicable to Dropdown inputs.",
"properties": {
"inputControl": { "enum": ["Dropdown"] }
}
},
"multiSelect": {
"description": "multiSelect is only applicable to Dropdown inputs.",
"properties": {
"inputControl": { "enum": ["Dropdown"] }
}
}
},
"allOf": [
{
"description": "Sliders MUST have a constraints object with min, max, and step.",
"if": {
"properties": { "inputControl": { "const": "Slider" } }
},
"then": {
"required": ["constraints"],
"properties": {
"constraints": { "required": ["min", "max", "step"] },
"value": { "type": "number" }
}
}
},
{
"description": "Conditional rule: NumberFields allow numbers, but the constraints object remains optional.",
"if": {
"properties": { "inputControl": { "enum": ["NumberField", "Slider"] } }
},
"then": {
"properties": { "value": { "type": "number" } }
}
},
{
"description": "value must be a string for TextField, TextArea",
"if": {
"properties": { "inputControl": { "enum": ["TextField", "TextArea"] } }
},
"then": {
"properties": { "value": { "type": "string" } }
}
},
{
"description": "value must be a boolean for Checkbox inputs.",
"if": {
"properties": { "inputControl": { "const": "Checkbox" } }
},
"then": {
"properties": { "value": { "type": "boolean" } }
}
},
{
"description": "For any Dropdown, value MUST be an array of strings.",
"if": { "properties": { "inputControl": { "const": "Dropdown" } } },
"then": {
"properties": {
"value": { "type": "array", "items": { "type": "string" } }
}
}
}
]
}
}
},
"compositionToVary": {
"description": "Defines the tabular layout configuration for varying ingredients and process parameters.",
"type": "object",
"required": ["columnLayout"],
"additionalProperties": false,
"properties": {
"columnLayout": {
"description": "The structure defining table columns and property mappings.",
"type": "object",
"required": ["heading"],
"anyOf": [
{ "required": ["ingredientProperty"] },
{ "required": ["processParameterProperty"] }
],
"additionalProperties": false,
"properties": {
"heading": {
"description": "Array of strings representing column display names. At least one item is required.",
"type": "array",
"minItems": 1,
"items": { "type": "string" }
},
"ingredientProperty": {
"description": "Maps columns to ingredient attributes. Logic: 1. If valid attribute name: pull existing value. 2. If attribute name not found: show empty cell for input. 3. If empty string: read-only.",
"type": "array",
"minItems": 1,
"items": { "type": "string" }
},
"processParameterProperty": {
"description": "Maps columns to process parameter attributes. Logic: 1. If valid attribute name: pull existing value. 2. If attribute name not found: show empty cell for input. 3. If empty string: read-only.",
"type": "array",
"minItems": 1,
"items": { "type": "string" }
}
}
}
}
}
},
"additionalProperties": false,
"$defs": {
"RangeProperty": {
"description": "Reusable structure for a single bound within a range.",
"type": "object",
"properties": {
"required": { "type": "boolean" },
"value": { "type": "number" }
}
}
}
}