{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/broad-institute/json-schema/broad-institute-workflow-metadata-response-schema.json",
  "title": "WorkflowMetadataResponse",
  "description": "Workflow and call level metadata",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/broad-institute-cromiam-workflows-for-job-manager-api-openapi.yml#/components/schemas/WorkflowMetadataResponse",
  "required": [
    "id",
    "status",
    "submission"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The identifier of the workflow"
    },
    "status": {
      "type": "string",
      "description": "The status of the workflow"
    },
    "submission": {
      "type": "string",
      "description": "Submission datetime of the workflow in ISO8601 format with milliseconds",
      "format": "date-time"
    },
    "start": {
      "type": "string",
      "description": "Start datetime of the workflow in ISO8601 format with milliseconds",
      "format": "date-time"
    },
    "end": {
      "type": "string",
      "description": "End datetime of the workflow in ISO8601 format with milliseconds",
      "format": "date-time"
    },
    "inputs": {
      "type": "object",
      "additionalProperties": {
        "type": "object"
      },
      "description": "Map of input keys to input values"
    },
    "outputs": {
      "type": "object",
      "additionalProperties": {
        "type": "object"
      },
      "description": "Map of output keys to output values"
    },
    "calls": {
      "$ref": "#/$defs/CallMetadata"
    },
    "failures": {
      "$ref": "#/$defs/FailureMessage"
    }
  },
  "$defs": {
    "CallMetadata": {
      "type": "object",
      "properties": {
        "inputs": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          },
          "description": "map from input names onto resolved values"
        },
        "executionStatus": {
          "type": "string",
          "description": "status of call"
        },
        "executionEvents": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExecutionEvent"
          }
        },
        "backendStatus": {
          "type": "string",
          "description": "status of the backend"
        },
        "backendLogs": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "map of log files from backend"
        },
        "outputs": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "map from output names to local files"
        },
        "start": {
          "type": "string",
          "description": "starting time of call",
          "format": "date-time"
        },
        "end": {
          "type": "string",
          "description": "ending time of call",
          "format": "date-time"
        },
        "jobId": {
          "type": "string",
          "description": "unique ID of job"
        },
        "returnCode": {
          "type": "integer",
          "description": "result code",
          "format": "int32"
        },
        "backend": {
          "type": "string",
          "description": "type of backend executing the call"
        },
        "stdout": {
          "type": "string",
          "description": "location of stdout"
        },
        "stderr": {
          "type": "string",
          "description": "location of stderr"
        },
        "shardIndex": {
          "type": "integer",
          "description": "call index within a scatter block, as reported by execution service",
          "format": "int32"
        }
      },
      "description": "Stuff you need to know about calls"
    },
    "ExecutionEvent": {
      "required": [
        "description",
        "startTime"
      ],
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "description": "Description of the event"
        },
        "startTime": {
          "type": "string",
          "description": "When the event started",
          "format": "date-time"
        },
        "endTime": {
          "type": "string",
          "description": "When the event finished",
          "format": "date-time"
        }
      },
      "description": ""
    },
    "FailureMessage": {
      "required": [
        "failure",
        "timestamp"
      ],
      "type": "object",
      "properties": {
        "failure": {
          "type": "string",
          "description": "The failure message"
        },
        "timestamp": {
          "type": "string",
          "description": "The time at which this failure occurred",
          "format": "date-time"
        }
      },
      "description": "Failure messages"
    }
  }
}