ibm-quantum · Arazzo Workflow

IBM Quantum Pause Session and Confirm

Version 1.0.0

Read a session's state, toggle whether it accepts new jobs, and confirm the change.

1 workflow 1 source API 1 provider
View Spec View on GitHub ArazzoWorkflows

Provider

ibm-quantum

Workflows

pause-session-and-confirm
Toggle a session's accepting-jobs flag and confirm the new state.
Reads a session, updates its accepting-jobs flag, and reads it back to confirm.
3 steps inputs: acceptingJobs, accessToken, apiVersion, serviceCrn, sessionId outputs: finalAcceptingJobs, finalState
1
getSession
get_session
Read the session's current state and accepting-jobs flag before changing it.
2
updateSession
update_session
Update the session to start or stop accepting new jobs based on the supplied flag. A 204 confirms the update.
3
confirmSession
get_session
Re-read the session to confirm its accepting-jobs flag now matches the requested value.

Source API Descriptions

Arazzo Workflow Specification

ibm-quantum-pause-session-and-confirm-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: IBM Quantum Pause Session and Confirm
  summary: Read a session's state, toggle whether it accepts new jobs, and confirm the change.
  description: >-
    A session-control flow. The workflow reads a session's current state and
    accepting-jobs flag, updates the session to start or stop accepting new jobs
    based on the supplied flag, and re-reads the session to confirm the change
    took effect. 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: sessionsApi
  url: ../openapi/ibm-quantum-runtime-sessions-openapi.yml
  type: openapi
workflows:
- workflowId: pause-session-and-confirm
  summary: Toggle a session's accepting-jobs flag and confirm the new state.
  description: >-
    Reads a session, updates its accepting-jobs flag, and reads it back to
    confirm.
  inputs:
    type: object
    required:
    - accessToken
    - serviceCrn
    - apiVersion
    - sessionId
    - acceptingJobs
    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).
      sessionId:
        type: string
        description: Identifier of the session to inspect and update.
      acceptingJobs:
        type: boolean
        description: Whether the session should accept new jobs (true) or stop accepting them (false).
  steps:
  - stepId: getSession
    description: >-
      Read the session's current state and accepting-jobs flag before changing
      it.
    operationId: get_session
    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: $inputs.sessionId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      currentState: $response.body#/state
      currentAcceptingJobs: $response.body#/accepting_jobs
  - stepId: updateSession
    description: >-
      Update the session to start or stop accepting new jobs based on the
      supplied flag. A 204 confirms the update.
    operationId: update_session
    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: $inputs.sessionId
    requestBody:
      contentType: application/json
      payload:
        accepting_jobs: $inputs.acceptingJobs
    successCriteria:
    - condition: $statusCode == 204
  - stepId: confirmSession
    description: >-
      Re-read the session to confirm its accepting-jobs flag now matches the
      requested value.
    operationId: get_session
    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: $inputs.sessionId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      finalAcceptingJobs: $response.body#/accepting_jobs
      finalState: $response.body#/state
  outputs:
    finalAcceptingJobs: $steps.confirmSession.outputs.finalAcceptingJobs
    finalState: $steps.confirmSession.outputs.finalState