{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/continuous-delivery-foundation/json-schema/continuous-delivery-foundation-pipeline-tree-response-schema.json",
  "title": "PipelineTreeResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/continuous-delivery-foundation-pipeline-overview-api-openapi.yml#/components/schemas/PipelineTreeResponse",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ok"
      ]
    },
    "data": {
      "$ref": "#/$defs/PipelineGraph"
    }
  },
  "$defs": {
    "PipelineGraph": {
      "type": "object",
      "properties": {
        "complete": {
          "type": "boolean",
          "description": "Whether the pipeline run is complete"
        },
        "stages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PipelineStage"
          }
        }
      }
    },
    "PipelineStage": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the stage"
        },
        "name": {
          "type": "string",
          "description": "Display name of the stage"
        },
        "state": {
          "$ref": "#/$defs/PipelineState"
        },
        "type": {
          "type": "string",
          "description": "Type of the stage (e.g., \"STAGE\", \"PARALLEL\")"
        },
        "title": {
          "type": "string",
          "description": "Full title/description of the stage"
        },
        "pauseDurationMillis": {
          "type": "integer",
          "format": "int64",
          "description": "Duration in milliseconds the stage was paused"
        },
        "startTimeMillis": {
          "type": "integer",
          "format": "int64",
          "description": "Stage start time in milliseconds since epoch"
        },
        "totalDurationMillis": {
          "types": [
            "integer",
            null
          ],
          "format": "int64",
          "description": "Total duration in milliseconds (null if still running)"
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PipelineStage"
          },
          "description": "Child stages (for parallel or nested stages)"
        },
        "seqContainerName": {
          "types": [
            "string",
            null
          ],
          "description": "Name of sequential container if applicable"
        },
        "nextSibling": {
          "types": [
            "object",
            null
          ],
          "$ref": "#/$defs/PipelineStage"
        },
        "isSequential": {
          "type": "boolean",
          "description": "Whether this stage is sequential"
        },
        "synthetic": {
          "type": "boolean",
          "description": "Whether this is a synthetic stage"
        },
        "placeholder": {
          "type": "boolean",
          "description": "Whether this is a placeholder stage"
        },
        "agent": {
          "types": [
            "string",
            null
          ],
          "description": "Agent information for the stage"
        },
        "causeOfBlockage": {
          "types": [
            "string",
            null
          ],
          "description": "Human-readable reason this stage is blocked. Currently set when the stage's state is \"queued\" because its `agent`/`node` step is waiting for an executor (e.g. \"Waiting for next available executor on 'linux'\"). Omitted when the stage is not blocked."
        },
        "url": {
          "type": "string",
          "description": "URL to view this stage in the UI"
        }
      }
    },
    "PipelineState": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "paused",
        "skipped",
        "not_built",
        "finished",
        "success",
        "unstable",
        "failure",
        "unknown",
        "aborted"
      ]
    }
  }
}