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

# List pending task runs

> Lists task runs whose on-chain end has not landed yet (`blockchain_status` is `pending` or `running`). Results are ordered oldest-`updated_at`-first, so anything that has been stuck the longest floats to the top. Validated/finished runs are not included — unvalidated runs whose on-chain end has completed are normal lag and excluded. Limited to 100 rows; if `count` equals `limit`, you have more pending rows than fit in one response.



## OpenAPI

````yaml get /subnets/{subnet_id}/task_runs/pending
openapi: 3.0.3
info:
  title: BitRobot API
  description: >
    The BitRobot API allows you to interact with the BitRobot platform,
    including event tracking, task management, and points distribution.


    ## Authentication


    All requests require authentication using an API key. Include your API key
    in the `Authorization` header:


    ```

    Authorization: Bearer brb_your_api_key_here

    ```


    ## Identifiers


    All resource identifiers in the API use the ULID format (Universally Unique
    Lexicographically Sortable Identifier).
  version: 1.0.0
  contact:
    name: BitRobot API Support
servers:
  - url: https://api-stage.bitrobot.ai
    description: Staging server
  - url: https://api.bitrobot.ai
    description: Production server
security: []
tags:
  - name: Events
    description: >
      Event tracking and management endpoints.


      Events allow you to track important actions and state changes in your
      subnet,

      including task execution (rides) and points distribution.
  - name: Subnets
    description: >
      Subnet-scoped integration endpoints for balances, points history, and
      conversion history.
  - name: Connect
    description: >
      BitRobot Connect endpoints for linking a user's subnet wallet to their
      BitRobot account. See the [BitRobot Connect](/bitrobot-connect) guide.
paths:
  /subnets/{subnet_id}/task_runs/pending:
    get:
      tags:
        - Task Runs
      summary: List pending task runs
      description: >-
        Lists task runs whose on-chain end has not landed yet
        (`blockchain_status` is `pending` or `running`). Results are ordered
        oldest-`updated_at`-first, so anything that has been stuck the longest
        floats to the top. Validated/finished runs are not included —
        unvalidated runs whose on-chain end has completed are normal lag and
        excluded. Limited to 100 rows; if `count` equals `limit`, you have more
        pending rows than fit in one response.
      operationId: listPendingTaskRuns
      parameters:
        - name: subnet_id
          in: path
          required: true
          description: The unique identifier of the subnet (ULID format)
          schema:
            type: string
            pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          example: 01ARZ3NDEKTSV4RRFFQ69G5FAV
      responses:
        '200':
          description: Pending task runs retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - data
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  data:
                    type: object
                    properties:
                      task_runs:
                        type: array
                        items:
                          $ref: '#/components/schemas/TaskRunStatus'
                      count:
                        type: integer
                        description: Number of task runs returned in this response.
                      limit:
                        type: integer
                        description: >-
                          Maximum number of task runs returned per request. If
                          `count` equals `limit`, more pending runs exist than
                          fit in a single response.
              example:
                status: success
                data:
                  task_runs:
                    - task_run_id: 01BXC4MDEKTSV4RRFFQ69G5FBW
                      task_id: 01ARZ3NDEKTSV4RRFFQ69G5FAV
                      event_id: ride_001
                      status: completed
                      blockchain_status: pending
                      validated_at: null
                      raw_data_invalid: false
                      force_ended: false
                      ingested_at: '2026-05-26T08:11:16Z'
                      updated_at: '2026-05-26T08:20:52Z'
                      seconds_since_update: 8348
                  count: 1
                  limit: 100
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid or missing API key
      security:
        - BearerAuth: []
components:
  schemas:
    TaskRunStatus:
      title: Task Run Status
      type: object
      description: >-
        Current state of a task run, suitable for polling and stuck-run
        detection.
      properties:
        task_run_id:
          type: string
          pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          description: Unique identifier of the task run (ULID).
        task_id:
          type: string
          pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          description: Identifier of the task this run belongs to.
        event_id:
          type: string
          description: The original `event_id` passed to `task_start`.
        status:
          type: string
          enum:
            - in_progress
            - completed
          description: Lifecycle status as set by `task_start` / `task_end`.
        blockchain_status:
          type: string
          enum:
            - pending
            - running
            - finished
          description: >-
            On-chain progress. `pending` = start hasn't landed on chain yet.
            `running` = start landed, end hasn't. `finished` = on-chain end has
            landed. A row is **stuck** when this is `pending` or `running` for
            longer than expected.
        validated_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Timestamp the run was validated. Null until `task_validate`
            succeeds.
        raw_data_invalid:
          type: boolean
          description: >-
            True if the CID verification of the raw data file failed; the run
            cannot be validated.
        force_ended:
          type: boolean
          description: >-
            True if the run was ended with `force_end: true` (no raw data was
            produced).
        ingested_at:
          type: string
          format: date-time
          description: When BitRobot first received the `task_start` event for this run.
        updated_at:
          type: string
          format: date-time
          description: >-
            Last time any field on the row changed. Combine with
            `seconds_since_update` to identify stuck runs.
        seconds_since_update:
          type: integer
          description: >-
            Seconds elapsed since `updated_at`. Useful for detecting runs that
            have been stuck in `pending` / `running` for too long.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Description of the error
          example: Invalid or missing API key
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        API key authentication. Your API key should start with `brb_`.

        Example: `Authorization: Bearer brb_1234567890abcdef`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.