ibm-quantum · Arazzo Workflow

IBM Quantum Audit Workloads and Drill Into Job

Version 1.0.0

List recent job-mode workloads from analytics, then pull the full job record and metrics for the most recent one.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub ArazzoWorkflows

Provider

ibm-quantum

Workflows

audit-workloads-and-drill-into-job
List job-mode workloads and inspect the most recent job's record and metrics.
Lists recent job workloads from analytics and drills into the newest one via the jobs API for full details and metrics.
3 steps inputs: accessToken, apiVersion, backend, serviceCrn outputs: jobStatus, latestWorkloadId, totalCount, usage
1
listWorkloads
find_instance_workloads
List the most recent job-mode workloads for the instance, sorted newest first, so the first workload's id is the latest job id.
2
getJobRecord
get_job
Read the full job record for the most recent workload using its id against the jobs API.
3
getJobMetrics
get_job_metrics_jid
Retrieve the execution metrics for the same job, such as QPU time and timestamps.

Source API Descriptions

Arazzo Workflow Specification

ibm-quantum-audit-workloads-and-drill-into-job-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: IBM Quantum Audit Workloads and Drill Into Job
  summary: List recent job-mode workloads from analytics, then pull the full job record and metrics for the most recent one.
  description: >-
    A cross-API reporting flow. The workflow lists the instance's recent
    workloads in job mode from the analytics API, then takes the most recent
    workload id — which is the job id — and uses the jobs API to read that job's
    full record and execution metrics. This bridges the high-level analytics
    listing with the detailed per-job views. Each request inlines its bearer
    token, Service-CRN, and IBM-API-Version headers so the flow can be read and
    executed without opening the underlying OpenAPI descriptions.
  version: 1.0.0
sourceDescriptions:
- name: analyticsApi
  url: ../openapi/ibm-quantum-runtime-analytics-openapi.yml
  type: openapi
- name: jobsApi
  url: ../openapi/ibm-quantum-runtime-jobs-openapi.yml
  type: openapi
workflows:
- workflowId: audit-workloads-and-drill-into-job
  summary: List job-mode workloads and inspect the most recent job's record and metrics.
  description: >-
    Lists recent job workloads from analytics and drills into the newest one via
    the jobs API for full details and metrics.
  inputs:
    type: object
    required:
    - accessToken
    - serviceCrn
    - apiVersion
    properties:
      accessToken:
        type: string
        description: IBM Cloud IAM bearer token used in the Authorization header.
      serviceCrn:
        type: string
        description: IBM Cloud Service CRN identifying the Qiskit Runtime instance.
      apiVersion:
        type: string
        description: API version date sent in the IBM-API-Version header (e.g. 2026-03-15).
      backend:
        type: string
        description: Optional backend name to filter workloads by.
  steps:
  - stepId: listWorkloads
    description: >-
      List the most recent job-mode workloads for the instance, sorted newest
      first, so the first workload's id is the latest job id.
    operationId: find_instance_workloads
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: Service-CRN
      in: header
      value: $inputs.serviceCrn
    - name: IBM-API-Version
      in: header
      value: $inputs.apiVersion
    - name: user
      in: query
      value: me
    - name: mode
      in: query
      value: job
    - name: sort
      in: query
      value: -createdAt
    - name: backend
      in: query
      value: $inputs.backend
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      totalCount: $response.body#/total_count
      latestWorkloadId: $response.body#/workloads/0/id
  - stepId: getJobRecord
    description: >-
      Read the full job record for the most recent workload using its id against
      the jobs API.
    operationId: get_job
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: Service-CRN
      in: header
      value: $inputs.serviceCrn
    - name: IBM-API-Version
      in: header
      value: $inputs.apiVersion
    - name: id
      in: path
      value: $steps.listWorkloads.outputs.latestWorkloadId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      jobStatus: $response.body#/status
      jobBackend: $response.body#/backend
  - stepId: getJobMetrics
    description: >-
      Retrieve the execution metrics for the same job, such as QPU time and
      timestamps.
    operationId: get_job_metrics_jid
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: Service-CRN
      in: header
      value: $inputs.serviceCrn
    - name: IBM-API-Version
      in: header
      value: $inputs.apiVersion
    - name: id
      in: path
      value: $steps.listWorkloads.outputs.latestWorkloadId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      usage: $response.body#/usage
      timestamps: $response.body#/timestamps
  outputs:
    totalCount: $steps.listWorkloads.outputs.totalCount
    latestWorkloadId: $steps.listWorkloads.outputs.latestWorkloadId
    jobStatus: $steps.getJobRecord.outputs.jobStatus
    usage: $steps.getJobMetrics.outputs.usage