{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vaquill-ai/json-schema/vaquill-ai-workflow-run-schema.json",
  "title": "WorkflowRun",
  "description": "One run. `status` is the public five, never the stored spelling.\n\nThe internal vocabulary has eight values, five of which (`preparing`,\n`extracting`, `synthesizing`, `rendering`, plus `pending`) describe a stage\nrather than an outcome. Those read as `running`, and `progressPercent` is\nwhat carries how far along it is.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vaquill-ai-workflows-api-openapi.yml#/components/schemas/WorkflowRun",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Public identifier, `wfr_` followed by 32 hex characters."
    },
    "matterId": {
      "type": "string",
      "title": "Matterid",
      "description": "`mat_` identifier of the matter this run belongs to."
    },
    "workflowId": {
      "type": "string",
      "title": "Workflowid",
      "description": "Identifier of the workflow definition that was run."
    },
    "title": {
      "type": "string",
      "title": "Title",
      "description": "Display title for the run."
    },
    "status": {
      "$ref": "#/$defs/OperationStatus",
      "description": "Run status, using the same five public values as an operation. The internal stage vocabulary (`preparing`, `extracting`, `synthesizing`, `rendering`) all reads as `running`."
    },
    "progressPercent": {
      "type": "integer",
      "title": "Progresspercent",
      "description": "How far along the run is, 0 to 100. This is what carries progress, since the stages all collapse to `running`."
    },
    "progressMessage": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Progressmessage",
      "description": "Short human-readable stage label, for example 'synthesizing findings'. Free text for a progress line only. Never branch on it; branch on `status`."
    },
    "artifacts": {
      "items": {
        "$ref": "#/$defs/WorkflowArtifact"
      },
      "type": "array",
      "title": "Artifacts",
      "description": "Deliverables produced so far. Listing is separate from downloading, so that a URL cannot be minted for an installation revoked between the two calls."
    },
    "startedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Startedat",
      "description": "When the run began executing (RFC 3339)."
    },
    "completedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completedat",
      "description": "When the run reached a terminal status (RFC 3339)."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "title": "Createdat",
      "description": "When the run was created (RFC 3339)."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "title": "Updatedat",
      "description": "When the run was last updated (RFC 3339)."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "id",
    "matterId",
    "workflowId",
    "title",
    "status",
    "progressPercent",
    "createdAt",
    "updatedAt"
  ],
  "$defs": {
    "OperationStatus": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ],
      "title": "OperationStatus",
      "description": "The public five. There is no sixth, and there are no synonyms.\n\nInternal vocabularies spell terminal success `completed`, `ready`,\n`extracted`, `succeeded` and `fresh`; terminal failure `failed` and `error`;\nqueued `pending`, `queued` and `draft`. All of that is collapsed here by\n`app.workspace_api.adapters.status_map`, which refuses to guess."
    },
    "WorkflowArtifact": {
      "properties": {
        "key": {
          "type": "string",
          "title": "Key",
          "description": "Slug identifying this artifact. Pass it to the artifact download route to get bytes."
        },
        "label": {
          "type": "string",
          "title": "Label",
          "description": "Human-readable name for the deliverable."
        },
        "contentType": {
          "type": "string",
          "title": "Contenttype",
          "description": "IANA media type of the produced file."
        },
        "sizeBytes": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sizebytes",
          "description": "Size of the artifact in bytes, when known."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "key",
        "label",
        "contentType"
      ],
      "title": "WorkflowArtifact",
      "description": "An artifact a finished run produced. No URL: fetching one is its own call.\n\nSeparating the listing from the signing is what lets the download route\nre-check the installation at signing time, so a URL cannot be minted for an\ninstallation that was revoked between the two."
    }
  }
}