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

# Get workflow stats

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Counts each workflow's runs over a time window, for a health view.

One row per workflow that ran in the window, with how many runs finished, failed, or were cancelled, and how long they took on average. A workflow with no runs in the window does not appear.

The window defaults to the last 24 hours. Set `since` and `until` to choose your own. A window longer than 30 days is not rejected: `since` is moved forward so the window ends at `until` and covers the 30 days before it, and nothing in the response says that happened. Ask for at most 30 days if you need the range you sent to be the range you get.

This endpoint is limited to 30 requests per minute.



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json get /api/apps/{app_id}/workflows/stats
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - ApiKeyAuth: []
paths:
  /api/apps/{app_id}/workflows/stats:
    get:
      summary: Get workflow stats
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Counts each workflow's runs over a time window, for a health view.


        One row per workflow that ran in the window, with how many runs
        finished, failed, or were cancelled, and how long they took on average.
        A workflow with no runs in the window does not appear.


        The window defaults to the last 24 hours. Set `since` and `until` to
        choose your own. A window longer than 30 days is not rejected: `since`
        is moved forward so the window ends at `until` and covers the 30 days
        before it, and nothing in the response says that happened. Ask for at
        most 30 days if you need the range you sent to be the range you get.


        This endpoint is limited to 30 requests per minute.
      operationId: get_workflow_stats_api_apps__app_id__workflows_stats_get
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose workflows you want to work with.
            title: App Id
          description: ID of the app whose workflows you want to work with.
          example: 6820f3a4e7b91d003c45a1f2
        - name: since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Start of the window, as an ISO 8601 datetime. Defaults to 24 hours
              ago.
            title: Since
          description: >-
            Start of the window, as an ISO 8601 datetime. Defaults to 24 hours
            ago.
          example: '2026-08-01T00:00:00Z'
        - name: until
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: End of the window, as an ISO 8601 datetime. Defaults to now.
            title: Until
          description: End of the window, as an ISO 8601 datetime. Defaults to now.
          example: '2026-08-25T00:00:00Z'
      responses:
        '200':
          description: One row per workflow that ran in the window.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WorkflowStatsRow'
                title: WorkflowStats
        '400':
          description: '`since` or `until` is not an ISO 8601 datetime.'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have access to this app, the app does not exist, the app
            still runs the older automations engine instead of workflows, or you
            used a workspace API key. A missing app and an app you cannot reach
            are deliberately the same answer.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WorkflowStatsRow:
      properties:
        workflow_id:
          type: string
          title: Workflow Id
          description: ID of the workflow these counts belong to.
          example: 68b1c0d4e7b91d003c45a1f2
        total:
          type: integer
          title: Total
          description: Runs that started in the window.
          example: 48
        completed:
          type: integer
          title: Completed
          description: Runs that finished successfully.
          example: 44
        failed:
          type: integer
          title: Failed
          description: Runs that ended in an error.
          example: 3
        cancelled:
          type: integer
          title: Cancelled
          description: Runs that were cancelled before finishing.
          example: 1
        avg_duration_ms:
          type: number
          title: Avg Duration Ms
          description: Mean wall-clock duration of the runs in the window, in milliseconds.
          example: 1840.5
        last_run_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Run At
          description: >-
            When the most recent run in the window started, or `null` when none
            ran.
          example: '2026-08-25T09:12:44Z'
        last_run_status:
          type: string
          title: Last Run Status
          description: >-
            Status of that most recent run. Empty when no run happened in the
            window.
          example: completed
      type: object
      required:
        - workflow_id
        - total
        - completed
        - failed
        - cancelled
        - avg_duration_ms
        - last_run_status
      title: WorkflowStatsRow
      description: Run counts for one workflow over the requested window.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: Personal API key.

````