arazzo: 1.0.1
info:
title: Runloop Provision Devbox and Run a Command
summary: Create a devbox, wait for it to reach running, then execute a shell command asynchronously and wait for completion.
description: >-
The core Runloop devbox loop. The workflow creates a fresh devbox, polls the
devbox lifecycle until it transitions to the running state, launches a shell
command asynchronously on the devbox, and then waits for that execution to
complete before returning its stdout, stderr, and exit status. Every step
spells out its request inline so the flow can be read and executed without
opening the underlying OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-4210.20
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-4210.20
capability_name: Environment Management
spec: runloop-ai-devbox-api-openapi.yml
confidence: 0.7
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: devboxApi
url: ../openapi/runloop-ai-devbox-api-openapi.yml
type: openapi
workflows:
- workflowId: provision-and-run-command
summary: Boot a devbox and run a command on it once it is ready.
description: >-
Creates a devbox, blocks on the devbox reaching the running state, then runs
a command asynchronously and waits for the execution to finish.
inputs:
type: object
required:
- apiToken
- command
properties:
apiToken:
type: string
description: Runloop API bearer token.
name:
type: string
description: Optional friendly name for the devbox.
blueprintId:
type: string
description: Optional blueprint id to base the devbox on.
command:
type: string
description: The shell command to execute on the devbox.
commandId:
type: string
description: A client supplied UUIDv7 command id for idempotency and tracking.
steps:
- stepId: createDevbox
description: Create a devbox; it begins booting in the provisioning state.
operationId: createDevbox
parameters:
- name: Authorization
in: header
value: Bearer $inputs.apiToken
requestBody:
contentType: application/json
payload:
name: $inputs.name
blueprint_id: $inputs.blueprintId
successCriteria:
- condition: $statusCode == 200
outputs:
devboxId: $response.body#/id
initialStatus: $response.body#/status
- stepId: waitUntilRunning
description: >-
Poll the devbox lifecycle until it reports the running status, branching
back to retry while it is still provisioning or initializing.
operationId: waitForDevboxStatus
parameters:
- name: Authorization
in: header
value: Bearer $inputs.apiToken
- name: id
in: path
value: $steps.createDevbox.outputs.devboxId
requestBody:
contentType: application/json
payload:
statuses:
- running
timeout_seconds: 30
successCriteria:
- condition: $statusCode == 200
outputs:
status: $response.body#/status
onSuccess:
- name: ready
type: goto
stepId: runCommand
criteria:
- condition: $response.body#/status == 'running'
- name: stillBooting
type: goto
stepId: waitUntilRunning
criteria:
- condition: $response.body#/status == 'provisioning' || $response.body#/status == 'initializing' || $response.body#/status == 'resuming'
- stepId: runCommand
description: Launch the supplied command asynchronously on the running devbox.
operationId: execAsyncCommand
parameters:
- name: Authorization
in: header
value: Bearer $inputs.apiToken
- name: id
in: path
value: $steps.createDevbox.outputs.devboxId
requestBody:
contentType: application/json
payload:
command: $inputs.command
successCriteria:
- condition: $statusCode == 200
outputs:
executionId: $response.body#/execution_id
execStatus: $response.body#/status
- stepId: waitForCompletion
description: Wait for the asynchronous execution to reach the completed status.
operationId: waitForCommandCompletion
parameters:
- name: Authorization
in: header
value: Bearer $inputs.apiToken
- name: devbox_id
in: path
value: $steps.createDevbox.outputs.devboxId
- name: execution_id
in: path
value: $steps.runCommand.outputs.executionId
requestBody:
contentType: application/json
payload:
statuses:
- completed
timeout_seconds: 25
successCriteria:
- condition: $statusCode == 200
outputs:
finalStatus: $response.body#/status
stdout: $response.body#/stdout
stderr: $response.body#/stderr
exitStatus: $response.body#/exit_status
outputs:
devboxId: $steps.createDevbox.outputs.devboxId
executionId: $steps.runCommand.outputs.executionId
stdout: $steps.waitForCompletion.outputs.stdout
exitStatus: $steps.waitForCompletion.outputs.exitStatus
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.