{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://github.com/petal-labs/petalflow/schemas/graph-workflow/v1.json", "title": "PetalFlow Graph Workflow v1", "type": "object", "additionalProperties": false, "required": [ "id", "version", "schema_version", "kind", "nodes", "edges" ], "properties": { "id": { "type": "string", "minLength": 1 }, "version": { "type": "string", "description": "Workflow business version." }, "schema_version": { "type": "string", "description": "Schema contract version (SemVer).", "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-(?:0|[1-9][0-9]*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9][0-9]*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$" }, "kind": { "type": "string", "const": "graph" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "nodes": { "type": "array", "items": { "$ref": "#/$defs/node" } }, "edges": { "type": "array", "items": { "$ref": "#/$defs/edge" } }, "entry": { "type": "string" } }, "$defs": { "node": { "type": "object", "additionalProperties": false, "required": [ "id", "type" ], "properties": { "id": { "type": "string", "minLength": 1 }, "type": { "type": "string", "minLength": 1 }, "config": { "type": "object", "additionalProperties": true } } }, "edge": { "type": "object", "additionalProperties": false, "required": [ "source", "sourceHandle", "target", "targetHandle" ], "properties": { "source": { "type": "string", "minLength": 1 }, "sourceHandle": { "type": "string", "minLength": 1 }, "target": { "type": "string", "minLength": 1 }, "targetHandle": { "type": "string", "minLength": 1 } } } } }