{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/broad-institute/main/json-schema/broad-institute-workflow-description-schema.json",
  "title": "WorkflowDescription",
  "x-generated": "2026-10-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/broad-institute-openapi.yml#/components/schemas/WorkflowDescription",
  "required": [
    "errors",
    "inputs",
    "name",
    "outputs",
    "submittedDescriptorType",
    "valid"
  ],
  "type": "object",
  "properties": {
    "valid": {
      "type": "boolean",
      "description": "Whether the workflow and inputs as submitted passed validation"
    },
    "errors": {
      "type": "array",
      "description": "The set of validation failure messages",
      "items": {
        "type": "string"
      }
    },
    "name": {
      "type": "string",
      "description": "For a source file with one workflow and zero or more tasks, the name of the workflow. For a single task, the name of the task. For a source file with multiple tasks but no workflows, the empty string."
    },
    "inputs": {
      "type": "array",
      "description": "A list of inputs for this tool",
      "items": {
        "$ref": "#/$defs/ToolInputParameter"
      }
    },
    "outputs": {
      "type": "array",
      "description": "A list of outputs for this tool",
      "items": {
        "$ref": "#/$defs/ToolOutputParameter"
      }
    },
    "submittedDescriptorType": {
      "$ref": "#/$defs/DescriptorTypeAndVersion"
    }
  },
  "$defs": {
    "DescriptorType": {
      "type": "string",
      "description": "One from a list of descriptor type strings (e.g. CWL, WDL). Note that these files can also include associated Docker/container files and test parameters that further describe a version of a tool",
      "enum": [
        "CWL",
        "WDL"
      ]
    },
    "DescriptorTypeAndVersion": {
      "required": [
        "descriptorType",
        "descriptorTypeVersion"
      ],
      "type": "object",
      "properties": {
        "descriptorType": {
          "$ref": "#/$defs/DescriptorType"
        },
        "descriptorTypeVersion": {
          "type": "string"
        }
      },
      "description": "A workflow descriptor file type and version."
    },
    "MapValueType": {
      "required": [
        "keyType",
        "valueType"
      ],
      "type": "object",
      "properties": {
        "keyType": {
          "$ref": "#/$defs/ValueType"
        },
        "valueType": {
          "$ref": "#/$defs/ValueType"
        }
      },
      "description": "A type representing a map from one type to another."
    },
    "ToolInputParameter": {
      "required": [
        "default",
        "name",
        "optional",
        "valueType"
      ],
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of this input value (formatted as expected by the tool)"
        },
        "valueType": {
          "$ref": "#/$defs/ValueType"
        },
        "optional": {
          "type": "boolean",
          "description": "Whether the tool allows this value to not be specified"
        },
        "default": {
          "type": "string",
          "description": "The in-language expression used to evaluate a default value for this parameter, if none is supplied."
        }
      },
      "description": "An input parameter for a tool or workflow."
    },
    "ToolOutputParameter": {
      "required": [
        "name",
        "valueType"
      ],
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of this input value (formatted as expected by the tool)"
        },
        "valueType": {
          "$ref": "#/$defs/ValueType"
        }
      },
      "description": "An output parameter for a tool or workflow."
    },
    "ValueType": {
      "type": "object",
      "properties": {
        "typeName": {
          "type": "string",
          "description": "The type of this value",
          "enum": [
            "String",
            "File",
            "Directory",
            "Float",
            "Int",
            "Boolean",
            "Optional",
            "Array",
            "Tuple",
            "Map",
            "Object"
          ]
        },
        "optionalType": {
          "$ref": "#/$defs/ValueType"
        },
        "arrayType": {
          "$ref": "#/$defs/ValueType"
        },
        "mapType": {
          "$ref": "#/$defs/MapValueType"
        },
        "tupleTypes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ValueType"
          }
        },
        "objectFieldTypes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "fieldName": {
                "type": "string"
              },
              "fieldType": {
                "$ref": "#/$defs/ValueType"
              }
            }
          }
        }
      },
      "description": "The type expected for a given value."
    }
  }
}