Schema
The Schema component is a JSON schema definition for transition, flow, and master-data. Requests are validated on both the front-end and back-end, ensuring instance data consistency.
Schema source:
vnext-schema/schema-definition.schema.json
Usage Types
| Type | Attached At | Purpose |
|---|---|---|
| Master Schema | Workflow root (attributes.schema) | Main structure of instance data; consistency check on every change |
| Transition Schema | Transition definition | Transition request body validation |
| Flow Schema | Workflow definition | Workflow-level validation |
Required Fields
| Field | Type | Description |
|---|---|---|
key | string | Unique schema identifier |
version | string | Schema version (SemVer) |
domain | string | Owning domain |
flow | string | Associated flow |
flowVersion | string | Flow version |
tags | string[] | Tags |
attributes | object | JSON Schema (Draft) definition |
Validation
Schemas are validated with Ajv2019. The front-end can use annotations for form validation; the back-end validates transition/start requests automatically.
- Frontend: form annotations, real-time validation
- Backend: request body validation, instance data merge validation
- CI/CD: the schema itself is centrally validated in the
vnext-schemarepo
Typical Use Cases
- Master schema to keep instance data immutable and versionable
- Transition schema for distinct request body validation per transition
- Form schema for automatic form generation on the UI side
Related
- Schema (conceptual) — conceptual explanation
- Workflow component —
attributes.schemamaster schema reference - Transitions — transition schema usage
- Schema source: vnext-schema (GitHub)