{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usewrit-app/json-schema/usewrit-app-data-workflows-list-schema.json",
  "title": "DataWorkflowsList",
  "description": "The Data-explorer workflow picker payload.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usewrit-app-data-api-openapi.yml#/components/schemas/DataWorkflowsList",
  "type": "object",
  "required": [
    "workflows"
  ],
  "properties": {
    "workflows": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DataWorkflowSummary"
      }
    }
  },
  "$defs": {
    "DataWorkflowSummary": {
      "type": "object",
      "required": [
        "workflow_id",
        "workflow_name",
        "run_count",
        "last_data_at",
        "last_delta"
      ],
      "properties": {
        "workflow_id": {
          "type": "integer",
          "format": "int64"
        },
        "workflow_name": {
          "type": "string"
        },
        "run_count": {
          "type": "integer",
          "description": "Distinct successful runs that contributed at least one row."
        },
        "last_data_at": {
          "type": [
            "string",
            "null"
          ],
          "description": "Newest contributing run's timestamp."
        },
        "last_delta": {
          "description": "Newest two snapshots compared under the sampled identity; null when the dataset has fewer than 2 snapshots or is too large.",
          "oneOf": [
            {
              "type": "object",
              "required": [
                "new",
                "changed",
                "removed"
              ],
              "properties": {
                "new": {
                  "type": "integer"
                },
                "changed": {
                  "type": "integer"
                },
                "removed": {
                  "type": "integer"
                }
              }
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  }
}