{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getorquesta-com/json-schema/getorquesta-com-workstream-proposal-schema.json",
  "title": "WorkstreamProposal",
  "description": "A workstream an agent asked to create; it becomes a Workstream when a project admin approves it.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getorquesta-com-openapi.json#/components/schemas/WorkstreamProposal",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "projectId": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "approved",
        "rejected"
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "code",
        "analysis",
        "action"
      ]
    },
    "branch": {
      "type": [
        "string",
        "null"
      ]
    },
    "workingDirectory": {
      "type": [
        "string",
        "null"
      ]
    },
    "systemPrompt": {
      "type": [
        "string",
        "null"
      ]
    },
    "autoMerge": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "cli": {
      "type": [
        "string",
        "null"
      ]
    },
    "model": {
      "type": [
        "string",
        "null"
      ]
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "agentTokenId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "proposedBy": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "decidedBy": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "decidedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "decisionNote": {
      "type": [
        "string",
        "null"
      ]
    },
    "workstreamId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Set once approved."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}