> ## 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 automatizaciones

> Recorre las automatizaciones de tu cuenta con paginación por cursor.

Lista las automatizaciones ordenadas por actualización reciente.

## Endpoint

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

## Parámetros de consulta

| Parámetro  | Tipo      | Default | Descripción                          |
| ---------- | --------- | ------- | ------------------------------------ |
| `status`   | `string`  | —       | `enabled` o `disabled`.              |
| `pageSize` | `integer` | `10`    | Resultados por página (`1` a `200`). |
| `cursor`   | `string`  | —       | `nextCursor` de la página anterior.  |

## Ejemplo de solicitud

```bash theme={null}
curl "https://api.insuranceboosters.com/api/v1/workflows?pageSize=10" \
  -H "x-ib-api-key: TU_API_KEY"
```

## Respuesta exitosa (`200`)

```json theme={null}
{
  "items": [
    {
      "id": "<workflow-id>",
      "name": "Notificar pago recibido",
      "status": "enabled",
      "trigger": {
        "type": "webhook",
        "secret": "<webhook-secret>"
      },
      "steps": [
        {
          "id": "<step-id>",
          "name": "Avisar sistema externo",
          "actionKey": "http.request",
          "input": {
            "method": "POST",
            "url": "https://ejemplo.com/hooks/pago"
          }
        }
      ],
      "publishedVersionId": "<version-id>",
      "latestVersionNumber": 1,
      "createdAt": 1720000000000,
      "lastUpdatedAt": 1720000000000
    }
  ],
  "pageSize": 10,
  "totalItems": 1,
  "nextCursor": null,
  "hasNextPage": false
}
```

Si `hasNextPage` es `true`, envía `nextCursor` como `cursor` y conserva el mismo `pageSize` y filtro `status`.

## 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`.                                                        |
| `500` | No fue posible listar.                  | Reintenta; si continúa, contacta soporte.                                       |


## OpenAPI

````yaml openapi/automatizaciones-v1.yaml GET /workflows
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:
    get:
      tags:
        - Automatizaciones
      summary: Listar automatizaciones
      operationId: listWorkflows
      parameters:
        - name: status
          in: query
          description: Filtra por estado.
          schema:
            type: string
            enum:
              - enabled
              - disabled
        - name: pageSize
          in: query
          description: Resultados por página (1 a 200).
          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 automatizaciones.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowListResponse'
        '400':
          $ref: be5bd7eb-0cff-4c7d-9210-e93d3634030e
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    WorkflowListResponse:
      type: object
      required:
        - items
        - pageSize
        - totalItems
        - nextCursor
        - hasNextPage
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Workflow'
        pageSize:
          type: integer
        totalItems:
          type: integer
        nextCursor:
          type: string
          nullable: true
        hasNextPage:
          type: boolean
    Workflow:
      type: object
      required:
        - id
        - name
        - status
        - trigger
        - steps
        - createdAt
        - lastUpdatedAt
      properties:
        id:
          type: string
        name:
          type: string
        status:
          $ref: '#/components/schemas/WorkflowStatus'
        trigger:
          $ref: '#/components/schemas/WorkflowTrigger'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowStep'
        publishedVersionId:
          type: string
        latestVersionNumber:
          type: integer
        cronState:
          type: object
          properties:
            lastFiredAt:
              type: integer
            nextDueAt:
              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
    WorkflowStatus:
      type: string
      enum:
        - enabled
        - disabled
    WorkflowTrigger:
      oneOf:
        - $ref: '#/components/schemas/WebhookTrigger'
        - $ref: '#/components/schemas/CronTrigger'
        - $ref: '#/components/schemas/DatabaseRecordCreatedTrigger'
        - $ref: '#/components/schemas/DatabaseRecordUpdatedTrigger'
    WorkflowStep:
      oneOf:
        - $ref: '#/components/schemas/BrowserUseStep'
        - $ref: '#/components/schemas/BrowserScriptStep'
        - $ref: '#/components/schemas/DelayStep'
        - $ref: '#/components/schemas/HttpStep'
        - $ref: '#/components/schemas/CodeStep'
    WebhookTrigger:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          const: webhook
        secret:
          type: string
          description: Generado por la API. Úsalo solo en la URL del webhook.
    CronTrigger:
      type: object
      required:
        - type
        - cron
        - timezone
      properties:
        type:
          type: string
          const: cron
        cron:
          type: string
          description: Expresión cron de 5 campos.
          example: 0 9 * * *
        timezone:
          type: string
          example: America/Mexico_City
    DatabaseRecordCreatedTrigger:
      type: object
      required:
        - type
        - databaseId
      properties:
        type:
          type: string
          const: database_record_created
        databaseId:
          type: string
          description: >-
            Identificador del tablero cuyos registros activarán la
            automatización.
          example: <database-id>
    DatabaseRecordUpdatedTrigger:
      type: object
      required:
        - type
        - databaseId
      properties:
        type:
          type: string
          const: database_record_updated
        databaseId:
          type: string
          description: >-
            Identificador del tablero cuyos registros activarán la
            automatización.
          example: <database-id>
    BrowserUseStep:
      type: object
      additionalProperties: false
      required:
        - actionKey
        - task
        - resultSchema
        - wait
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: browser.use
        task:
          type: string
          minLength: 1
          maxLength: 20000
          description: Tarea para el navegador. Acepta plantillas {{...}}.
        resultSchema:
          type: object
          required:
            - type
          properties:
            type:
              type: string
              const: object
          additionalProperties: true
          description: JSON Schema del output esperado. No debe declarar _files.
        wait:
          type: object
          additionalProperties: false
          properties:
            initialDelaySeconds:
              type: integer
              minimum: 0
              maximum: 604800
              default: 30
            pollIntervalSeconds:
              type: integer
              minimum: 1
              maximum: 3600
              default: 15
            timeoutSeconds:
              type: integer
              minimum: 2
              maximum: 604800
              default: 3600
    BrowserScriptStep:
      type: object
      required:
        - actionKey
        - code
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: browser.script
        code:
          type: string
          minLength: 1
          maxLength: 100000
          description: JavaScript que dirige al agente de IA con el objeto `browser`.
        input:
          type: object
          additionalProperties: true
          description: Variables disponibles como `input.*`. Acepta plantillas {{...}}.
        timeoutMs:
          type: number
    DelayStep:
      type: object
      required:
        - actionKey
        - input
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: system.delay
        input:
          type: object
          required:
            - mode
            - amount
            - unit
          properties:
            mode:
              type: string
              enum:
                - duration
            amount:
              type: integer
              minimum: 1
            unit:
              type: string
              enum:
                - seconds
                - minutes
                - hours
                - days
    HttpStep:
      type: object
      required:
        - actionKey
        - input
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: http.request
        input:
          type: object
          required:
            - method
            - url
          properties:
            method:
              type: string
              enum:
                - GET
                - POST
                - PUT
                - PATCH
                - DELETE
            url:
              type: string
            headers:
              type: object
              additionalProperties:
                type: string
            query:
              type: object
              additionalProperties: true
            body: {}
    CodeStep:
      type: object
      required:
        - actionKey
        - code
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: code.javascript
        code:
          type: string
        input:
          type: object
          additionalProperties: true
        timeoutMs:
          type: number
  responses:
    Unauthorized:
      description: API key inválida o faltante.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
          example:
            message: Invalid API key.
    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.

````