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

Set `execution_product` to `workflows` or `hooks` to filter the results. Omit it to include both.
A hook that denies an action still completed successfully; failed runs indicate execution errors.

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 can span at most 30 days. Ask for a longer one and the call still succeeds, but `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. Set `since` and `until` to choose your own window, up to that cap. Leave both out for the last 24 hours.



## 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:
  - PersonalAccessTokenAuth: []
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.


        Set `execution_product` to `workflows` or `hooks` to filter the results.
        Omit it to include both.

        A hook that denies an action still completed successfully; failed runs
        indicate execution errors.


        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 can span at most 30 days. Ask for a longer one and the call
        still succeeds, but `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. Set `since` and `until` to choose your own window,
        up to that cap. Leave both out for the last 24 hours.
      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:
            type: string
            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:
            type: string
            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'
        - name: execution_product
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/ExecutionProduct'
            description: Filter to workflows or hooks. Omit to include both.
            title: Execution Product
          description: Filter to workflows or hooks. Omit to include both.
      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, or the
            app still runs the older automations engine instead of workflows. 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'
        '429':
          description: >-
            Rate limit exceeded. The base limit is 30 requests per minute. See
            [Rate
            limits](/developers/references/apps-api/get-started/rate-limits) for
            the multiplier your plan gets.
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - PersonalAccessTokenAuth:
            - read_only
        - WorkspaceApiKeyAuth:
            - read_only
        - WorkspaceApiKeyBearerAuth:
            - read_only
components:
  schemas:
    ExecutionProduct:
      type: string
      enum:
        - workflows
        - hooks
      title: ExecutionProduct
    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 duration of the runs in the window, in milliseconds, including
            time spent in `wait` tasks.
          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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    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
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        Workspace API key, sent as `api_key: <key>`. Each operation that accepts
        one lists what the key needs: a permission, `read_only` or
        `full_access`, like a personal access token, or a scope. A key without
        the scope gets 403 `workspace_api_key_scope_required`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

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