{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/data.schema.json",
  "title": "Workflow Catalog Data Schema",
  "cuddler": {
    "specVersion": "1.0.0",
    "documentTypeId": "workflow-catalog",
    "schemaVersion": "1.0.0",
    "output": {
      "primaryContentType": "application/json",
      "supportedContentTypes": [
        "application/json",
        "text/html"
      ]
    },
    "profile": {
      "id": "workflow-catalog",
      "version": "1.0.0",
      "for-ai": [
        {
          "instruction": "Explain what this Cuddler schema profile governs so AI consumers understand when to use this schema family.",
          "input": "",
          "output": "Workflow Catalog data-and-template schema family for publishing catalog-level workflow inventories and summaries."
        }
      ]
    },
    "schemaLinks": [
      {
        "rel": "related",
        "targetSchema": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/template.schema.json",
        "targetDocumentTypeId": "workflow-catalog",
        "for-ai": [
          {
            "instruction": "Explain why this related schema is linked here and when an AI consumer should follow it.",
            "input": "",
            "output": "Use the paired Workflow Catalog template schema when validating or rendering the companion template document for the same artifact family."
          }
        ]
      }
    ],
    "artifactType": "Workflow Catalog",
    "status": "Public normative publication",
    "publisher": "TrackThat Inc.",
    "sourceUrl": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/data.schema.json",
    "attributionNotice": "\u00a9 2026 TrackThat. This work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). See https://www.cuddler.dev/license/ for the site license summary. You are free to share, use, adapt, and modify this material, including for commercial purposes, provided you give appropriate attribution and include a link to the original source URL and the CC BY 4.0 license at https://creativecommons.org/licenses/by/4.0/.",
    "governingDomainSpecification": {
      "title": "Process Document Role",
      "url": "https://www.cuddler.dev/standards/document-role/process/v1.0.0/"
    },
    "governingArtifactSpecification": {
      "title": "Cuddler Artifact Specification",
      "version": "1.0.0",
      "url": "https://www.cuddler.dev/standards/artifact-specification/v1.0.0/"
    }
  },
  "$ref": "#/$defs/Root",
  "$defs": {
    "Root": {
      "allOf": [
        {
          "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/CuddlerDocument"
        },
        {
          "type": "object",
          "properties": {
            "$schema": {
              "type": "string",
              "format": "uri",
              "const": "https://www.cuddler.dev/standards/artifact-definitions/workflow-catalog/1.0.0/data.schema.json",
              "for-ai": [
                {
                  "instruction": "Use this guidance when preparing a valid value for this schema node.",
                  "input": "",
                  "output": "Absolute URI of this immutable Workflow Catalog Data Schema."
                }
              ]
            },
            "meta": {
              "allOf": [
                {
                  "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/Meta"
                },
                {
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "const": "1.0.0",
                      "for-ai": [
                        {
                          "instruction": "Use this guidance when preparing a valid value for this schema node.",
                          "input": "",
                          "output": "Schema version for the Workflow Catalog document family."
                        }
                      ]
                    },
                    "documentTypeId": {
                      "const": "workflow-catalog",
                      "for-ai": [
                        {
                          "instruction": "Use this guidance when preparing a valid value for this schema node.",
                          "input": "",
                          "output": "Stable document type identifier for workflow catalogs."
                        }
                      ]
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "for-ai": [
                        {
                          "instruction": "Use this guidance when preparing a valid value for this schema node.",
                          "input": "",
                          "output": "Reader-facing title for the workflow catalog document."
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "final",
                        "deprecated"
                      ],
                      "for-ai": [
                        {
                          "instruction": "Use this guidance when preparing a valid value for this schema node.",
                          "input": "",
                          "output": "Lifecycle status of the catalog document."
                        }
                      ]
                    },
                    "language": {
                      "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/LanguageTag",
                      "for-ai": [
                        {
                          "instruction": "Use this guidance when preparing a valid value for this schema node.",
                          "input": "",
                          "output": "Primary simplified Cuddler language tag for the catalog document."
                        }
                      ]
                    },
                    "summary": {
                      "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/NonEmptyString",
                      "for-ai": [
                        {
                          "instruction": "Use this guidance when preparing a valid value for this schema node.",
                          "input": "",
                          "output": "One-sentence summary of the workflow catalog purpose."
                        }
                      ]
                    }
                  }
                }
              ]
            },
            "content": {
              "allOf": [
                {
                  "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/Content"
                },
                {
                  "type": "object",
                  "required": [
                    "sections",
                    "documentModel"
                  ],
                  "properties": {
                    "sections": {
                      "type": "array",
                      "minItems": 3,
                      "items": {
                        "oneOf": [
                          {
                            "title": "Overview",
                            "allOf": [
                              {
                                "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/Section"
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "const": "overview",
                                    "for-ai": [
                                      {
                                        "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                        "input": "",
                                        "output": "Section key for the catalog overview."
                                      }
                                    ]
                                  },
                                  "heading": {
                                    "const": "Overview",
                                    "for-ai": [
                                      {
                                        "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                        "input": "",
                                        "output": "Displayed heading for the overview section."
                                      }
                                    ]
                                  },
                                  "blocks": {
                                    "type": "array",
                                    "minItems": 1,
                                    "maxItems": 1,
                                    "items": {
                                      "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/TextBlock"
                                    },
                                    "for-ai": [
                                      {
                                        "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                        "input": "",
                                        "output": "Exactly one narrative text block that explains the catalog at a glance."
                                      }
                                    ]
                                  }
                                }
                              }
                            ],
                            "for-ai": [
                              {
                                "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                "input": "",
                                "output": "Narrative introduction to the workflow catalog and the standard it follows."
                              }
                            ]
                          },
                          {
                            "title": "Workflow Inventory",
                            "allOf": [
                              {
                                "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/Section"
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "const": "workflow-inventory",
                                    "for-ai": [
                                      {
                                        "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                        "input": "",
                                        "output": "Section key for the workflow inventory."
                                      }
                                    ]
                                  },
                                  "heading": {
                                    "const": "Workflow Inventory",
                                    "for-ai": [
                                      {
                                        "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                        "input": "",
                                        "output": "Displayed heading for the workflow inventory section."
                                      }
                                    ]
                                  },
                                  "blocks": {
                                    "type": "array",
                                    "minItems": 1,
                                    "maxItems": 1,
                                    "items": {
                                      "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/TableBlock"
                                    },
                                    "for-ai": [
                                      {
                                        "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                        "input": "",
                                        "output": "Exactly one table block summarizing the catalog workflows."
                                      }
                                    ]
                                  }
                                }
                              }
                            ],
                            "for-ai": [
                              {
                                "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                "input": "",
                                "output": "Structured summary of the workflows included in the catalog."
                              }
                            ]
                          },
                          {
                            "title": "Authoring Guidance",
                            "allOf": [
                              {
                                "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/Section"
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "const": "authoring-guidance",
                                    "for-ai": [
                                      {
                                        "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                        "input": "",
                                        "output": "Section key for authoring guidance."
                                      }
                                    ]
                                  },
                                  "heading": {
                                    "const": "Authoring Guidance",
                                    "for-ai": [
                                      {
                                        "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                        "input": "",
                                        "output": "Displayed heading for the authoring guidance section."
                                      }
                                    ]
                                  },
                                  "blocks": {
                                    "type": "array",
                                    "minItems": 1,
                                    "maxItems": 1,
                                    "items": {
                                      "$ref": "https://www.cuddler.dev/standards/document-role/data/v1.0.0/cuddler.base.defs.schema.1.0.0.json#/$defs/BulletsBlock"
                                    },
                                    "for-ai": [
                                      {
                                        "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                        "input": "",
                                        "output": "Exactly one bullets block that records the key authoring rules for the catalog."
                                      }
                                    ]
                                  }
                                }
                              }
                            ],
                            "for-ai": [
                              {
                                "instruction": "Use this guidance when preparing a valid value for this schema node.",
                                "input": "",
                                "output": "Author-facing rules that preserve contract alignment across workflow catalogs."
                              }
                            ]
                          }
                        ]
                      },
                      "allOf": [
                        {
                          "contains": {
                            "type": "object",
                            "required": [
                              "key"
                            ],
                            "properties": {
                              "key": {
                                "const": "overview"
                              }
                            }
                          },
                          "minContains": 1
                        },
                        {
                          "contains": {
                            "type": "object",
                            "required": [
                              "key"
                            ],
                            "properties": {
                              "key": {
                                "const": "workflow-inventory"
                              }
                            }
                          },
                          "minContains": 1
                        },
                        {
                          "contains": {
                            "type": "object",
                            "required": [
                              "key"
                            ],
                            "properties": {
                              "key": {
                                "const": "authoring-guidance"
                              }
                            }
                          },
                          "minContains": 1
                        }
                      ],
                      "for-ai": [
                        {
                          "instruction": "Use this guidance when preparing a valid value for this schema node.",
                          "input": "",
                          "output": "Top-level sections in display order for the workflow catalog narrative and summary views."
                        }
                      ]
                    },
                    "documentModel": {
                      "$ref": "#/$defs/WorkflowCatalogModel",
                      "for-ai": [
                        {
                          "instruction": "Use this guidance when preparing a valid value for this schema node.",
                          "input": "",
                          "output": "Required structured workflow catalog facts that provide stable machine-readable targets for rendering, validation, and downstream tooling."
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      ]
    },
    "PathLike": {
      "type": "string",
      "pattern": "^(?!/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*//)(?:[A-Za-z0-9._-]+/)*[A-Za-z0-9._-]+$",
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Catalog-relative path that uses forward slashes, stays within the package root, and does not use Windows drive prefixes."
        }
      ]
    },
    "PromptFormat": {
      "type": "string",
      "enum": [
        "markdown"
      ],
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Prompt instruction format. Workflow Catalog v1.0.0 standardizes Markdown instructions."
        }
      ]
    },
    "WorkflowStepScript": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "relativePath",
        "shell"
      ],
      "properties": {
        "relativePath": {
          "allOf": [
            {
              "$ref": "#/$defs/PathLike"
            },
            {
              "pattern": "script\\.ps1$"
            }
          ],
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Catalog-relative path to the supporting PowerShell script for this step."
            }
          ]
        },
        "shell": {
          "type": "string",
          "const": "powershell",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Script runtime used by this step adjunct. Workflow Catalog v1.0.0 currently fixes this to PowerShell for interoperability with the process core."
            }
          ]
        }
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Optional script adjunct for one workflow step. The step remains schema-valid without this object when prompt instructions are sufficient."
        }
      ]
    },
    "WorkflowStep": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "stepId",
        "title",
        "instructions",
        "format"
      ],
      "properties": {
        "stepId": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Stable lowercase kebab-case identifier for the step. Order is preserved by the surrounding steps array."
            }
          ]
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Human-readable title for the step."
            }
          ]
        },
        "summary": {
          "type": "string",
          "minLength": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Optional short explanation of what the step does."
            }
          ]
        },
        "instructions": {
          "type": "string",
          "minLength": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Canonical Markdown prompt instructions that define the step behavior."
            }
          ]
        },
        "format": {
          "$ref": "#/$defs/PromptFormat",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Declared prompt instruction format for this step."
            }
          ]
        },
        "script": {
          "$ref": "#/$defs/WorkflowStepScript",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Optional PowerShell script adjunct for this step."
            }
          ]
        }
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "One ordered unit of execution in a workflow. A step is defined by a typed questionnaire and MAY also carry supporting script behavior."
        }
      ]
    },
    "WorkflowSummary": {
      "type": "object",
      "required": [
        "workflowId",
        "name",
        "description",
        "stepCount",
        "stepTitles"
      ],
      "properties": {
        "workflowId": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Stable lowercase kebab-case workflow identifier."
            }
          ]
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Human-readable workflow name."
            }
          ]
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Short explanation of the procedure implemented by the workflow."
            }
          ]
        },
        "stepCount": {
          "type": "integer",
          "minimum": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Number of ordered steps owned by this workflow."
            }
          ]
        },
        "stepTitles": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1,
            "for-ai": [
              {
                "instruction": "Use this guidance when preparing a valid value for this schema node.",
                "input": "",
                "output": "One reader-facing workflow step title."
              }
            ]
          },
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Ordered step titles exposed for browse and render surfaces."
            }
          ]
        }
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Stable workflow summary facts intended for rendering and browsing surfaces."
        }
      ]
    },
    "Workflow": {
      "allOf": [
        {
          "$ref": "#/$defs/WorkflowSummary"
        },
        {
          "type": "object",
          "required": [
            "steps"
          ],
          "properties": {
            "steps": {
              "type": "array",
              "minItems": 1,
              "items": {
                "$ref": "#/$defs/WorkflowStep"
              },
              "for-ai": [
                {
                  "instruction": "Use this guidance when preparing a valid value for this schema node.",
                  "input": "",
                  "output": "Ordered execution sequence for the workflow. Array order is the execution order."
                }
              ]
            }
          }
        }
      ]
    },
    "WorkflowCatalogModel": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "catalogId",
        "catalogName",
        "catalogDescription",
        "workflowCount",
        "stepCount",
        "supportsOptionalScripts",
        "countsNarrative",
        "authoringRules",
        "workflows"
      ],
      "properties": {
        "catalogId": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Stable lowercase kebab-case catalog identifier."
            }
          ]
        },
        "catalogName": {
          "type": "string",
          "minLength": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Human-readable catalog name."
            }
          ]
        },
        "catalogDescription": {
          "type": "string",
          "minLength": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Short explanation of the workflow catalog."
            }
          ]
        },
        "workflowCount": {
          "type": "integer",
          "minimum": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Number of workflows owned by the catalog."
            }
          ]
        },
        "stepCount": {
          "type": "integer",
          "minimum": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Total number of ordered steps across all workflows in the catalog."
            }
          ]
        },
        "supportsOptionalScripts": {
          "type": "boolean",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Whether the catalog standard permits step-owned script adjuncts in addition to prompt instructions."
            }
          ]
        },
        "countsNarrative": {
          "type": "string",
          "minLength": 1,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Reader-facing narrative that summarizes workflow and step counts for rendered views."
            }
          ]
        },
        "authoringRules": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1,
            "for-ai": [
              {
                "instruction": "Use this guidance when preparing a valid value for this schema node.",
                "input": "",
                "output": "One authoring rule or implementation reminder."
              }
            ]
          },
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Ordered authoring rules that keep workflow catalogs aligned with the process contract."
            }
          ]
        },
        "workflows": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/Workflow"
          },
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Ordered workflows owned by the catalog."
            }
          ]
        }
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Stable workflow catalog facts. This model is the machine-friendly source of truth for catalogs that follow the Cuddler process core model."
        }
      ]
    }
  },
  "for-ai": [
    {
      "instruction": "Use this guidance when preparing a valid value for this schema node.",
      "input": "",
      "output": "Use this schema to generate workflow catalog documents that describe repeatable procedures as ordered workflows and steps, with prompt instructions and optional PowerShell helpers for process teams."
    }
  ]
}
