Session Run and Close
A 3-step recipe with IBM Quantum. We can help you get access.
Recipe · 3 steps
Session Run and Close
with IBM Quantum
Create a session, run a job within it, and close it when done.
- Open a runtime session bound to the chosen backend and execution mode, and capture the new session id.
- Submit a primitive job that references the session id so it runs with the session's priority on the backend.
- Close the runtime session so it stops accepting new jobs; any running jobs run to completion.
What you'll need to have ready
- accessToken: IBM Cloud IAM bearer token used in the Authorization header.
- serviceCrn: IBM Cloud Service CRN identifying the Qiskit Runtime instance.
- apiVersion: API version date sent in the IBM-API-Version header (e.g. 2026-03-15).
- backend: Name of the backend the session will run on.
- mode: Execution mode for the session, either batch or dedicated.
- programId: ID of the primitive program to execute in the session.
- params: The primitive input params object.
For your developer
Arazzo workflow ibm-quantum:session-run-and-close, 3 operations: create_session → create_job → delete_session_close. Specs on APIs.io.