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

# Listar ejecuciones

> Recorre las ejecuciones de una automatización con filtros y paginación por cursor.

Lista las ejecuciones de una automatización.

## Endpoint

```text theme={null}
GET /workflows/{workflowId}/runs
```

## Parámetros de consulta

| Parámetro     | Tipo      | Default | Descripción                                               |
| ------------- | --------- | ------- | --------------------------------------------------------- |
| `status`      | `string`  | —       | `queued`, `running`, `succeeded`, `failed` o `cancelled`. |
| `startAfter`  | `integer` | —       | Timestamp (ms) mínimo de creación.                        |
| `startBefore` | `integer` | —       | Timestamp (ms) máximo de creación.                        |
| `pageSize`    | `integer` | `10`    | Resultados por página.                                    |
| `cursor`      | `string`  | —       | `nextCursor` de la página anterior.                       |

## Ejemplo de solicitud

```bash theme={null}
curl "https://api.insuranceboosters.com/api/v1/workflows/<workflow-id>/runs?pageSize=10&status=succeeded" \
  -H "x-ib-api-key: TU_API_KEY"
```

## Respuesta exitosa (`200`)

```json theme={null}
{
  "items": [
    {
      "id": "<run-id>",
      "workflowId": "<workflow-id>",
      "versionId": "<version-id>",
      "versionNumber": 1,
      "status": "succeeded",
      "currentStepIndex": 1,
      "context": {},
      "startedAt": 1720000001000,
      "finishedAt": 1720000003000,
      "createdAt": 1720000000000,
      "lastUpdatedAt": 1720000003000
    }
  ],
  "pageSize": 10,
  "totalItems": 1,
  "nextCursor": null,
  "hasNextPage": false
}
```

## Errores frecuentes

| HTTP  | Qué significa                           | Qué hacer                                                                       |
| ----- | --------------------------------------- | ------------------------------------------------------------------------------- |
| `400` | El `cursor` de paginación no es válido. | Reinicia el recorrido sin `cursor` o usa el `nextCursor` de la página anterior. |
| `401` | API key inválida o faltante.            | Verifica `x-ib-api-key`.                                                        |
| `404` | La automatización no existe.            | Confirma `workflowId`.                                                          |


## OpenAPI

````yaml openapi/automatizaciones-v1.yaml GET /workflows/{workflowId}/runs
openapi: 3.1.0
info:
  title: Insurance Boosters API — Automatizaciones
  version: 1.0.0
  description: >
    API pública para crear, publicar y ejecutar automatizaciones por webhook,
    cron o eventos de registros, y consultar sus versiones y ejecuciones.
  license:
    name: Propietaria
    url: https://insuranceboosters.com
servers:
  - url: https://api.insuranceboosters.com/api/v1
    description: Producción
security:
  - IbApiKey: []
tags:
  - name: Automatizaciones
    description: Definición, publicación y control de automatizaciones.
  - name: Versiones
    description: Instantáneas publicadas de una automatización.
  - name: Ejecuciones
    description: Historial y detalle de corridas.
  - name: Webhooks
    description: Disparo público de automatizaciones con trigger webhook.
paths:
  /workflows/{workflowId}/runs:
    get:
      tags:
        - Ejecuciones
      summary: Listar ejecuciones
      operationId: listWorkflowRuns
      parameters:
        - $ref: '#/components/parameters/WorkflowId'
        - name: status
          in: query
          description: Filtra por estado de la ejecución.
          schema:
            type: string
            enum:
              - queued
              - running
              - succeeded
              - failed
              - cancelled
        - name: startAfter
          in: query
          description: Incluye ejecuciones creadas después de este timestamp (ms).
          schema:
            type: integer
        - name: startBefore
          in: query
          description: Incluye ejecuciones creadas antes de este timestamp (ms).
          schema:
            type: integer
        - name: pageSize
          in: query
          description: Resultados por página.
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 10
        - name: cursor
          in: query
          description: Cursor `nextCursor` de la página anterior.
          schema:
            type: string
      responses:
        '200':
          description: Página de ejecuciones.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    WorkflowId:
      name: workflowId
      in: path
      required: true
      description: Identificador de la automatización.
      schema:
        type: string
  schemas:
    RunListResponse:
      type: object
      required:
        - items
        - pageSize
        - totalItems
        - nextCursor
        - hasNextPage
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowRun'
        pageSize:
          type: integer
        totalItems:
          type: integer
        nextCursor:
          type: string
          nullable: true
        hasNextPage:
          type: boolean
    WorkflowRun:
      type: object
      required:
        - id
        - workflowId
        - status
        - createdAt
        - lastUpdatedAt
      properties:
        id:
          type: string
        workflowId:
          type: string
        versionId:
          type: string
        versionNumber:
          type: integer
        status:
          $ref: '#/components/schemas/RunStatus'
        currentStepIndex:
          type: integer
        context:
          type: object
          additionalProperties: true
        triggerEvent:
          type: object
          additionalProperties: true
        startedAt:
          type: integer
        finishedAt:
          type: integer
        createdAt:
          type: integer
        lastUpdatedAt:
          type: integer
    AuthError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    RunStatus:
      type: string
      enum:
        - queued
        - running
        - succeeded
        - failed
        - cancelled
  responses:
    Unauthorized:
      description: API key inválida o faltante.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
          example:
            message: Invalid API key.
    NotFound:
      description: Recurso no encontrado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Workflow not found.
    InternalError:
      description: Error inesperado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    IbApiKey:
      type: apiKey
      in: header
      name: x-ib-api-key
      description: API key emitida por Insurance Boosters.

````