{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kaitoi-io/json-schema/kaitoi-io-public-template-run-detail-schema.json",
  "title": "PublicTemplateRunDetail",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kaitoi-io-openapi.json#/components/schemas/PublicTemplateRunDetail",
  "properties": {
    "taskId": {
      "type": "string",
      "title": "Taskid",
      "description": "Workflow task id used to poll this template endpoint run."
    },
    "sourceType": {
      "type": "string",
      "const": "template_endpoint",
      "title": "Sourcetype",
      "default": "template_endpoint"
    },
    "templateId": {
      "type": "string",
      "title": "Templateid"
    },
    "endpointId": {
      "type": "string",
      "title": "Endpointid"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed"
      ],
      "title": "Status"
    },
    "progress": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Progress"
    },
    "progressMessage": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Progressmessage"
    },
    "nodesCount": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Nodescount"
    },
    "nodeIndex": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Nodeindex"
    },
    "currentNode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Currentnode"
    },
    "logs": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Logs"
    },
    "externalId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Externalid"
    },
    "externalUserId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Externaluserid"
    },
    "externalWorkspaceId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Externalworkspaceid"
    },
    "inputFiles": {
      "items": {
        "$ref": "#/$defs/PublicRunFileInputReference"
      },
      "type": "array",
      "title": "Inputfiles"
    },
    "outputs": {
      "additionalProperties": {
        "oneOf": [
          {
            "$ref": "#/$defs/PublicFileOutput"
          },
          {
            "$ref": "#/$defs/PublicPrimitiveOutput"
          }
        ]
      },
      "type": "object",
      "title": "Outputs"
    },
    "error": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "executionTimeMs": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Executiontimems"
    },
    "fromTaskId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fromtaskid",
      "description": "The earlier run this run builds on, if any."
    },
    "reusedOutputs": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Reusedoutputs",
      "description": "fieldNames of the outputs read from the fromTaskId run instead of made again."
    },
    "createdAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Createdat"
    },
    "updatedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updatedat"
    }
  },
  "type": "object",
  "required": [
    "taskId",
    "templateId",
    "endpointId",
    "status"
  ],
  "$defs": {
    "PublicFileOutput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "file",
          "title": "Type",
          "default": "file"
        },
        "fileId": {
          "type": "string",
          "title": "Fileid"
        },
        "filename": {
          "type": "string",
          "title": "Filename"
        },
        "contentType": {
          "type": "string",
          "title": "Contenttype"
        },
        "sizeBytes": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Sizebytes"
        },
        "downloadUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Downloadurl"
        },
        "expiresAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expiresat"
        },
        "previewUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Previewurl"
        },
        "previewExpiresAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Previewexpiresat"
        }
      },
      "type": "object",
      "required": [
        "fileId",
        "filename",
        "contentType",
        "sizeBytes"
      ],
      "title": "PublicFileOutput"
    },
    "PublicPrimitiveOutput": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "string",
            "number",
            "boolean",
            "json",
            "null"
          ],
          "title": "Type"
        },
        "value": {
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "PublicPrimitiveOutput"
    },
    "PublicRunFileInputReference": {
      "properties": {
        "nodeId": {
          "type": "string",
          "title": "Nodeid"
        },
        "inputName": {
          "type": "string",
          "title": "Inputname"
        },
        "fileId": {
          "type": "string",
          "title": "Fileid"
        },
        "filename": {
          "type": "string",
          "title": "Filename"
        },
        "contentType": {
          "type": "string",
          "title": "Contenttype"
        },
        "sizeBytes": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Sizebytes"
        },
        "externalId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Externalid"
        },
        "externalUserId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Externaluserid"
        },
        "externalWorkspaceId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Externalworkspaceid"
        }
      },
      "type": "object",
      "required": [
        "nodeId",
        "inputName",
        "fileId",
        "filename",
        "contentType",
        "sizeBytes"
      ],
      "title": "PublicRunFileInputReference"
    }
  }
}