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

# Get execution metrics

> Return aggregate execution metrics — total count, counts by status, average duration, and the last execution time. Can be scoped by `flowId`, `triggerId`, and a `from`/`to` time range.



## OpenAPI

````yaml /api-reference/workflows.yaml get /executions/metrics
openapi: 3.1.0
info:
  title: Workflows
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
security:
  - bearerAuth: []
paths:
  /executions/metrics:
    get:
      tags:
        - Executions
      summary: Get execution metrics
      description: >-
        Return aggregate execution metrics — total count, counts by status,
        average duration, and the last execution time. Can be scoped by
        `flowId`, `triggerId`, and a `from`/`to` time range.
      operationId: getExecutionMetrics
      parameters:
        - schema:
            type: string
            format: uuid
          required: false
          name: flowId
          in: query
        - schema:
            type: string
            format: uuid
          required: false
          name: triggerId
          in: query
        - schema:
            type:
              - string
              - 'null'
          required: false
          name: from
          in: query
        - schema:
            type:
              - string
              - 'null'
          required: false
          name: to
          in: query
      responses:
        '200':
          description: Execution metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ExecutionMetrics'
                required:
                  - data
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.workflows.executions.getMetrics();

            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.workflows.executions.get_metrics()
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Workflows.Executions.GetMetrics(context.TODO(), mobileruncloud.WorkflowExecutionGetMetricsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:executions get-metrics \
              --api-key 'My API Key'
components:
  schemas:
    ExecutionMetrics:
      type: object
      properties:
        total:
          type: integer
        byStatus:
          type: object
          properties:
            pending:
              type: integer
            running:
              type: integer
            success:
              type: integer
            failed:
              type: integer
            cancelled:
              type: integer
            skipped:
              type: integer
            invalid:
              type: integer
          required:
            - pending
            - running
            - success
            - failed
            - cancelled
            - skipped
            - invalid
        avgDurationMs:
          type:
            - number
            - 'null'
        lastExecutionAt:
          type:
            - string
            - 'null'
      required:
        - total
        - byStatus
        - avgDurationMs
        - lastExecutionAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header

````