arazzo: 1.0.1 info: title: IBM Quantum List Jobs and Inspect summary: List recent jobs, then pull the full details and execution metrics for the most recent one. description: >- A job-auditing flow. The workflow lists the jobs run under the instance, filtered and sorted by creation time, then drills into the most recently created job to read its full details and finally retrieves that job's execution metrics such as QPU time and timestamps. 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: jobsApi url: ../openapi/ibm-quantum-runtime-jobs-openapi.yml type: openapi workflows: - workflowId: list-jobs-and-inspect summary: List jobs and inspect the most recent job's details and metrics. description: >- Lists jobs sorted newest-first, reads the details of the first job, and fetches that job's execution 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 the job list by. limit: type: integer description: Maximum number of jobs to return (1-200). steps: - stepId: listJobs description: >- List the most recent jobs run under the instance, sorted by creation time descending so the newest job is first. operationId: list_jobs 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: backend in: query value: $inputs.backend - name: limit in: query value: $inputs.limit - name: sort in: query value: DESC successCriteria: - condition: $statusCode == 200 outputs: jobCount: $response.body#/count latestJobId: $response.body#/jobs/0/id - stepId: getJobDetails description: >- Read the full details of the most recently created job, including its status, backend, and program. 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.listJobs.outputs.latestJobId successCriteria: - condition: $statusCode == 200 outputs: jobStatus: $response.body#/status jobBackend: $response.body#/backend - stepId: getJobMetrics description: >- Retrieve the execution metrics for the 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.listJobs.outputs.latestJobId successCriteria: - condition: $statusCode == 200 outputs: timestamps: $response.body#/timestamps usage: $response.body#/usage outputs: jobCount: $steps.listJobs.outputs.jobCount latestJobId: $steps.listJobs.outputs.latestJobId jobStatus: $steps.getJobDetails.outputs.jobStatus timestamps: $steps.getJobMetrics.outputs.timestamps