{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.sommatic.ai/schemas/git-sync/resource-header.schema.json",
  "title": "Sommatic resource file header",
  "description": "Every workflow or knowledge resource file in a package carries this header. Workflow files also carry the studio export format (__export_version 2.0, draft_nodes, draft_edges, editor_state). Runtime fields (id, created, modified, status, execution_state, latest_version_id, version_counter) are never stored.",
  "type": "object",
  "required": ["sommatic"],
  "properties": {
    "sommatic": {
      "type": "object",
      "required": ["kind", "key", "schema_version"],
      "properties": {
        "kind": { "enum": ["workflow", "knowledge-resource"] },
        "key": { "type": "string", "description": "Same key as in sommatic.json." },
        "schema_version": { "type": "string", "const": "1.0" }
      },
      "additionalProperties": false
    },
    "__export_version": { "type": "string", "const": "2.0", "description": "Workflow files only." }
  },
  "not": {
    "anyOf": [
      { "required": ["id"] },
      { "required": ["created"] },
      { "required": ["modified"] },
      { "required": ["status"] },
      { "required": ["execution_state"] },
      { "required": ["latest_version_id"] },
      { "required": ["version_counter"] }
    ]
  }
}
