> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firedrill.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Read this runner's assignment

> Read-only. It neither refreshes the pre-start slot lease nor authorizes invocation. Tool credentials appear only through the existing common interaction start.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/projects/{projectId}/simulations/{batchId}/work/{workId}
openapi: 3.1.0
info:
  title: Firedrill Control API
  version: 1.0.0
  description: >-
    The control plane for drills, drill runs, and the worlds they run in. Errors
    always carry the canonical envelope; unsafe operations require an
    Idempotency-Key; long work returns an operation resource.
servers:
  - url: https://api.firedrill.run
security:
  - controlCredential: []
paths:
  /v1/projects/{projectId}/simulations/{batchId}/work/{workId}:
    get:
      summary: Read this runner's assignment
      description: >-
        Read-only. It neither refreshes the pre-start slot lease nor authorizes
        invocation. Tool credentials appear only through the existing common
        interaction start.
      operationId: simulations.getWork
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^prj_[0-9a-z]{12,32}$
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            pattern: ^cisuite_[0-9a-z]{12,32}$
        - name: workId
          in: path
          required: true
          schema:
            type: string
            pattern: ^simwork_[0-9a-z]{12,32}$
        - name: runnerId
          in: query
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$
      responses:
        '200':
          description: Current work state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulationWorkProjection'
        default:
          description: Canonical error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    SimulationWorkProjection:
      type: object
      properties:
        organizationId:
          type: string
          pattern: ^org_[0-9a-z]{12,32}$
        projectId:
          type: string
          pattern: ^prj_[0-9a-z]{12,32}$
        batchId:
          type: string
          pattern: ^cisuite_[0-9a-z]{12,32}$
        schemaVersion:
          type: number
          enum:
            - 1
        workId:
          type: string
          pattern: ^simwork_[0-9a-z]{12,32}$
        runnerId:
          type: string
          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,159}$
        version:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        phase:
          type: string
          enum:
            - waiting
            - preparing
            - ready
            - accepted
            - running
            - finished
            - expired
            - withdrawn
        preStartExpiresAtMs:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        capacityOccupied:
          type: boolean
        waiting:
          type: object
          properties:
            code:
              type: string
              enum:
                - fair_queue
                - runner_unavailable
                - unsupported_target
                - runner_capacity
                - tool_capacity
                - organization_concurrency
                - batch_concurrency
                - usage_allowance
                - setup_unavailable
                - preparing_tools
                - cleanup_pending
                - insufficient_session_lifetime
            retryAfterMs:
              type: integer
              minimum: 0
              exclusiveMinimum: true
              maximum: 300000
            action:
              type: string
              enum:
                - wait
                - start_runner
                - free_runner_slot
                - review_usage
                - review_setup
          required:
            - code
          additionalProperties: false
        case:
          type: object
          properties:
            caseId:
              type: string
              pattern: ^cicase_[0-9a-z]{12,32}$
            targetId:
              type: string
              minLength: 1
              maxLength: 96
              pattern: ^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$
            buildHash:
              type: string
              pattern: ^sha256:[0-9a-f]{64}$
            drillId:
              type: string
              minLength: 1
              maxLength: 96
              pattern: ^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$
            seed:
              type: string
              pattern: ^(0|[1-9]\d{0,19})$
            trial:
              type: integer
              minimum: 0
              exclusiveMinimum: true
              maximum: 10000
            attempt:
              type: integer
              minimum: 0
              exclusiveMinimum: true
              maximum: 11
          required:
            - caseId
            - targetId
            - buildHash
            - drillId
            - seed
            - trial
            - attempt
          additionalProperties: false
        session:
          type: object
          properties:
            sessionId:
              type: string
              pattern: ^ses_[0-9a-z]{12,32}$
            leaseGeneration:
              type: integer
              minimum: 0
              exclusiveMinimum: true
              maximum: 9007199254740991
          required:
            - sessionId
            - leaseGeneration
          additionalProperties: false
        hostedRunId:
          type: string
          pattern: ^hrun_[0-9a-z]{12,32}$
      required:
        - organizationId
        - projectId
        - batchId
        - schemaVersion
        - workId
        - runnerId
        - version
        - phase
        - preStartExpiresAtMs
        - capacityOccupied
      additionalProperties: false
    ErrorEnvelope:
      type: object
      properties:
        code:
          type: string
          pattern: ^(control|world)\.[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$
        message:
          type: string
          minLength: 1
        correlationId:
          type: string
          minLength: 1
        retryable:
          type: boolean
        retryAfterMs:
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        operationId:
          type: string
        source:
          type: string
          enum:
            - platform
            - simulated_provider
        issues:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              code:
                type: string
              message:
                type: string
            required:
              - path
              - code
              - message
            additionalProperties: false
        details:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
        evidence:
          type: object
          properties:
            sessionId:
              type: string
            runId:
              type: string
            journalSeq:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            buildHash:
              type: string
          additionalProperties: false
      required:
        - code
        - message
        - correlationId
        - retryable
        - source
      additionalProperties: true
  securitySchemes:
    controlCredential:
      type: http
      scheme: bearer
      description: Opaque control credential

````