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

# Get workflow/agent statistics

> Health, credit min/max/avg per run, tool and model breakdown, triggers, and recent logs for one workflow or agent.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/workflow/manager/{id}/statistics
openapi: 3.0.0
info:
  title: Flowra API (API Key Endpoints)
  description: >-
    **Flowra** is an AI-powered platform for building agents, workflows, and
    integrations.


    ### Capabilities

    - **Tools & Toolkits** – Define and group tools for agents and workflows.

    - **Workflows** – Orchestrate steps and automate processes.

    - **Triggers** – Schedule or event-based execution.

    - **Auth & Connections** – OAuth, API keys, and connected accounts.

    - **MCP** – Model Context Protocol server integration.

    - **Knowledge / RAG** – Add files and URLs for retrieval-augmented
    generation.


    ### Authentication

    Use the **x-api-key** header with a project API key to access endpoints that
    support API Key auth. Create and manage API keys in the dashboard under your
    project settings.


    Only endpoints that support API Key authentication via the @ApiKeyEnabled()
    decorator.


    Send x-api-key (required). On multi-tenant endpoints, optionally send
    x-username to act as an external user.
  version: '1.0'
  contact:
    name: Flowra
    url: https://flowra.dev
servers:
  - url: https://flowra.dev
    description: Flowra API
security: []
tags:
  - name: Users
    description: User profile
  - name: External Users
    description: End-user identities inside a project (x-username)
  - name: Auth Configs
    description: OAuth and API key configs for toolkits
  - name: Connected Accounts
    description: OAuth connected accounts and link creation
  - name: Toolkits
    description: List and search toolkits
  - name: Tools
    description: List, execute, and manage tools
  - name: Skills
    description: Browse, create, import, and install skills
  - name: Workflow & Agent
    description: Create, run, and inspect workflows and agents
  - name: Triggers
    description: Schedule and event-based trigger instances
  - name: Chat
    description: Threads and streaming agent runs
  - name: File
    description: Upload, list, and download files
  - name: Knowledge
    description: RAG knowledge collections
  - name: Table
    description: Collections and documents
  - name: Sandbox
    description: Ephemeral and durable code sandboxes
  - name: Browser
    description: Live browser sessions and view
  - name: LLM
    description: List AI models and generate completions
  - name: MCP
    description: MCP server management
  - name: usage
    description: Credit balance and usage ledger for the project API key
paths:
  /api/v1/workflow/manager/{id}/statistics:
    get:
      tags:
        - Workflow & Agent
      summary: Get workflow/agent statistics
      description: >-
        Health, credit min/max/avg per run, tool and model breakdown, triggers,
        and recent logs for one workflow or agent.
      operationId: WorkflowManagerController_getWorkflowStatistics
      parameters:
        - name: id
          required: true
          in: path
          description: Workflow (agent) ID
          schema:
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            type: string
        - name: from
          required: false
          in: query
          description: Start date (ISO 8601)
          schema:
            example: '2026-08-01T00:00:00.000Z'
            type: string
        - name: to
          required: false
          in: query
          description: End date (ISO 8601)
          schema:
            example: '2026-09-01T00:00:00.000Z'
            type: string
        - name: x-username
          in: header
          required: false
          description: >-
            External user (end user) to act as. Optional — if omitted, Flowra
            uses the project’s default external user. Send a stable username
            (e.g. customer_alice) only when you need another end-user context.
          schema:
            type: string
            default: (project default user)
          example: customer_alice
      responses:
        '200':
          description: Workflow statistics retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowStatisticsDtoSuccessResponse'
              example:
                success: true
                message: Operation completed successfully
                data:
                  workflow:
                    id: ''
                    name: ''
                    workflowType: static
                    isActive: true
                    lastExecutedAt: ''
                    lastProductionError:
                      timestamp: ''
                      errors:
                        - {}
                  health:
                    total: 0
                    completed: 0
                    failed: 0
                    timeout: 0
                    paused: 0
                    running: 0
                    successRate: 0
                    durationMinMs: 0
                    durationAvgMs: 0
                    durationMaxMs: 0
                    byMode:
                      test: 0
                      production: 0
                  credits:
                    totalCredits: 0
                    totalUsd: 0
                    byType:
                      ai_model: 0
                      tool: 0
                      sandbox: 0
                      browser: 0
                      workflow: 0
                      media: 0
                      connected_account: 0
                    minCreditsPerRun: 0
                    maxCreditsPerRun: 0
                    avgCreditsPerRun: 0
                    attributedRunCount: 0
                    unattributedCreditRows: 0
                  tools:
                    - toolSlug: ''
                      calls: 0
                      successful: 0
                      failed: 0
                      credits: 0
                      usdCost: 0
                  models:
                    - modelId: ''
                      calls: 0
                      credits: 0
                      totalTokens: 0
                  triggers:
                    - id: ''
                      toolSlug: ''
                      status: ''
                      isDisabled: true
                      statusReason: ''
                      updatedAt: ''
                      invocationCount: 0
                      invocationErrors: 0
                  recentExecutions:
                    - id: ''
                      status: ''
                      executionMode: ''
                      startedAt: ''
                      completedAt: ''
                      executionDurationMs: 0
                      credits: 0
                  recentCreditLogs:
                    - id: ''
                      type: ''
                      creditAmount: 0
                      delta: 0
                      entryType: debit
                      usdCost: 0
                      executionId: ''
                      metadata: {}
                      createdAt: ''
                  recentToolLogs:
                    - id: ''
                      toolSlug: ''
                      successful: true
                      error: ''
                      executionDurationMs: 0
                      executedAt: ''
                  from: ''
                  to: ''
      security:
        - x-api-key: []
        - x-api-key: []
          x-username: []
components:
  schemas:
    WorkflowStatisticsDtoSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Success status
          example: true
        message:
          type: string
          description: Success message
          example: Operation completed successfully
        data:
          type: object
          properties:
            workflow:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
                workflowType:
                  type: string
                  enum:
                    - static
                    - agent
                isActive:
                  type: boolean
                lastExecutedAt:
                  type: string
                  nullable: true
                lastProductionError:
                  type: object
                  properties:
                    timestamp:
                      type: string
                    errors:
                      type: array
                      items:
                        type: object
                  required:
                    - timestamp
                    - errors
              required:
                - id
                - name
                - workflowType
                - isActive
            health:
              type: object
              properties:
                total:
                  type: number
                completed:
                  type: number
                failed:
                  type: number
                timeout:
                  type: number
                paused:
                  type: number
                running:
                  type: number
                successRate:
                  type: number
                  nullable: true
                durationMinMs:
                  type: number
                  nullable: true
                durationAvgMs:
                  type: number
                  nullable: true
                durationMaxMs:
                  type: number
                  nullable: true
                byMode:
                  type: object
                  properties:
                    test:
                      type: number
                    production:
                      type: number
              required:
                - total
                - completed
                - failed
                - timeout
                - paused
                - running
                - successRate
                - durationMinMs
                - durationAvgMs
                - durationMaxMs
                - byMode
            credits:
              type: object
              properties:
                totalCredits:
                  type: number
                totalUsd:
                  type: number
                  nullable: true
                byType:
                  type: object
                  properties:
                    ai_model:
                      type: number
                    tool:
                      type: number
                    sandbox:
                      type: number
                    browser:
                      type: number
                    workflow:
                      type: number
                    media:
                      type: number
                    connected_account:
                      type: number
                minCreditsPerRun:
                  type: number
                  nullable: true
                maxCreditsPerRun:
                  type: number
                  nullable: true
                avgCreditsPerRun:
                  type: number
                  nullable: true
                attributedRunCount:
                  type: number
                unattributedCreditRows:
                  type: number
              required:
                - totalCredits
                - totalUsd
                - byType
                - minCreditsPerRun
                - maxCreditsPerRun
                - avgCreditsPerRun
                - attributedRunCount
                - unattributedCreditRows
            tools:
              type: array
              items:
                type: object
                properties:
                  toolSlug:
                    type: string
                  calls:
                    type: number
                  successful:
                    type: number
                  failed:
                    type: number
                  credits:
                    type: number
                  usdCost:
                    type: number
                    nullable: true
                required:
                  - toolSlug
                  - calls
                  - successful
                  - failed
                  - credits
                  - usdCost
            models:
              type: array
              items:
                type: object
                properties:
                  modelId:
                    type: string
                  calls:
                    type: number
                  credits:
                    type: number
                  totalTokens:
                    type: number
                required:
                  - modelId
                  - calls
                  - credits
                  - totalTokens
            triggers:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  toolSlug:
                    type: string
                  status:
                    type: string
                  isDisabled:
                    type: boolean
                  statusReason:
                    type: string
                    nullable: true
                  updatedAt:
                    type: string
                  invocationCount:
                    type: number
                  invocationErrors:
                    type: number
                required:
                  - id
                  - toolSlug
                  - status
                  - isDisabled
                  - updatedAt
                  - invocationCount
                  - invocationErrors
            recentExecutions:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                  executionMode:
                    type: string
                  startedAt:
                    type: string
                  completedAt:
                    type: string
                    nullable: true
                  executionDurationMs:
                    type: number
                    nullable: true
                  credits:
                    type: number
                required:
                  - id
                  - status
                  - executionMode
                  - startedAt
                  - credits
            recentCreditLogs:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                  creditAmount:
                    type: number
                  delta:
                    type: number
                    description: >-
                      Signed wallet change: negative when taken, positive when
                      returned
                  entryType:
                    type: string
                    enum:
                      - debit
                      - credit
                  usdCost:
                    type: number
                    nullable: true
                  executionId:
                    type: string
                    nullable: true
                  metadata:
                    type: object
                    nullable: true
                  createdAt:
                    type: string
                required:
                  - id
                  - type
                  - creditAmount
                  - delta
                  - entryType
                  - usdCost
                  - createdAt
            recentToolLogs:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  toolSlug:
                    type: string
                  successful:
                    type: boolean
                  error:
                    type: string
                    nullable: true
                  executionDurationMs:
                    type: number
                    nullable: true
                  executedAt:
                    type: string
                required:
                  - id
                  - toolSlug
                  - successful
                  - executedAt
            from:
              type: string
            to:
              type: string
          required:
            - workflow
            - health
            - credits
            - tools
            - models
            - triggers
            - recentExecutions
            - recentCreditLogs
            - recentToolLogs
          example:
            workflow:
              id: ''
              name: ''
              workflowType: static
              isActive: true
              lastExecutedAt: ''
              lastProductionError:
                timestamp: ''
                errors:
                  - {}
            health:
              total: 0
              completed: 0
              failed: 0
              timeout: 0
              paused: 0
              running: 0
              successRate: 0
              durationMinMs: 0
              durationAvgMs: 0
              durationMaxMs: 0
              byMode:
                test: 0
                production: 0
            credits:
              totalCredits: 0
              totalUsd: 0
              byType:
                ai_model: 0
                tool: 0
                sandbox: 0
                browser: 0
                workflow: 0
                media: 0
                connected_account: 0
              minCreditsPerRun: 0
              maxCreditsPerRun: 0
              avgCreditsPerRun: 0
              attributedRunCount: 0
              unattributedCreditRows: 0
            tools:
              - toolSlug: ''
                calls: 0
                successful: 0
                failed: 0
                credits: 0
                usdCost: 0
            models:
              - modelId: ''
                calls: 0
                credits: 0
                totalTokens: 0
            triggers:
              - id: ''
                toolSlug: ''
                status: ''
                isDisabled: true
                statusReason: ''
                updatedAt: ''
                invocationCount: 0
                invocationErrors: 0
            recentExecutions:
              - id: ''
                status: ''
                executionMode: ''
                startedAt: ''
                completedAt: ''
                executionDurationMs: 0
                credits: 0
            recentCreditLogs:
              - id: ''
                type: ''
                creditAmount: 0
                delta: 0
                entryType: debit
                usdCost: 0
                executionId: ''
                metadata: {}
                createdAt: ''
            recentToolLogs:
              - id: ''
                toolSlug: ''
                successful: true
                error: ''
                executionDurationMs: 0
                executedAt: ''
            from: ''
            to: ''
      required:
        - success
        - message
        - data
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Project API key. Create and manage keys in the dashboard under Project →
        API Keys. Send as header: x-api-key: <your-key>
    x-username:
      type: apiKey
      in: header
      name: x-username
      description: >-
        Optional. External user username. If omitted, Flowra uses the project’s
        default external user. Send as header: x-username: <username>

````

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