{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/parallel-ai/json-schema/parallel-ai-task-group-run-response-schema.json",
  "title": "TaskGroupRunResponse",
  "description": "Response from adding new task runs to a task group.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/parallel-ai-tasks-api-openapi.yml#/components/schemas/TaskGroupRunResponse",
  "properties": {
    "status": {
      "$ref": "#/$defs/TaskGroupStatus",
      "description": "Status of the group."
    },
    "run_ids": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Run IDs",
      "description": "IDs of the newly created runs."
    },
    "run_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Run Cursor",
      "description": "Cursor for these runs in the run stream at taskgroup/runs?last_event_id=<run_cursor>. Empty for the first runs in the group."
    },
    "event_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Event Cursor",
      "description": "Cursor for these runs in the event stream at taskgroup/events?last_event_id=<event_cursor>. Empty for the first runs in the group."
    }
  },
  "type": "object",
  "required": [
    "status",
    "run_ids",
    "run_cursor",
    "event_cursor"
  ],
  "$defs": {
    "TaskGroupStatus": {
      "properties": {
        "num_task_runs": {
          "type": "integer",
          "title": "Num Task Runs",
          "description": "Number of task runs in the group."
        },
        "task_run_status_counts": {
          "additionalProperties": {
            "type": "integer"
          },
          "propertyNames": {
            "enum": [
              "queued",
              "action_required",
              "running",
              "completed",
              "failed",
              "cancelling",
              "cancelled"
            ]
          },
          "type": "object",
          "title": "Task Run Status Counts",
          "description": "Number of task runs with each status."
        },
        "is_active": {
          "type": "boolean",
          "title": "Is Active",
          "description": "True if at least one run in the group is currently active, i.e. status is one of {'cancelling', 'queued', 'running'}."
        },
        "status_message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status Message",
          "description": "Human-readable status message for the group."
        },
        "modified_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Modified At",
          "description": "Timestamp of the last status update to the group, as an RFC 3339 string."
        }
      },
      "type": "object",
      "required": [
        "num_task_runs",
        "task_run_status_counts",
        "is_active",
        "status_message",
        "modified_at"
      ],
      "title": "TaskGroupStatus",
      "description": "Status of a task group."
    }
  }
}