Skip to main content
GET
Get a setup run, optionally waiting for it to finish

Authorizations

Authorization
string
header
required

A Recursion API key, created in the console under API keys.

Path Parameters

environment_id
string<uuid>
required

Environment id (UUID).

setup_run_id
string<uuid>
required

Setup run id as returned by createEnvironmentSetupRun or the environment's setup_verification.active_setup_run_id.

Query Parameters

wait_seconds
integer

Block up to this many seconds for the run to reach succeeded, failed, or cancelled before responding. The server caps the wait at 5 seconds; larger values are accepted and clamped. 0 (the default) returns immediately and is recommended through the public API: sleep two seconds client-side and repeat to avoid timeouts on long-held requests.

Required range: 0 <= x <= 60

Response

One execution of an environment's setup script on fresh compute: provision, GPU check, script, profile, image capture, cleanup. Read status until terminal, then hint, failed_line, and stderr_tail; the full log is a separate call.

One execution of an environment's setup script on fresh compute: provision, GPU check, script, profile, image capture, cleanup. Read status until terminal, then hint, failed_line, and stderr_tail; the full log is a separate call.

created_at
string<date-time>
required

When the run was requested.

environment_id
string
required

Environment whose setup ran.

kind
string
required

manual (requested through the API to verify the environment) or session (performed while provisioning a session).

organization_id
string
required

Organization that owns the environment.

setup_run_id
string
required

Server-assigned id of the run.

status
string
required

queued, provisioning, running, succeeded, failed, or cancelled. Poll until one of the last three; getEnvironmentSetupRun accepts wait_seconds to do that server-side.

compute_id
string

Provider id of the compute the run used. Released when the run ends.

compute_profile
object

What the compute turned out to be: vCPUs, memory, GPUs, Docker state, image tools. Recorded after setup passed.

duration_ms
integer<int64>

Wall-clock duration in milliseconds, provisioning included.

exit_code
integer

Exit code of the setup script when it ran. 124 means the timeout elapsed.

failed_command
string

The failing line's command as written, unexpanded.

failed_line
integer<int64>

1-based line in the setup script whose command exited non-zero. 0 when unknown.

failure_code
string

Machine-readable failure class when the run did not succeed: environment_setup_failed, sandbox_capacity_unavailable, sandbox_gpu_not_ready, sandbox_provision_timeout, and so on. Same vocabulary as session failures.

fingerprint
string

Hash of the environment configuration the run executed.

finished_at
string<date-time>

When the run reached a terminal status.

gpu_readiness
object

GPU readiness report for accelerator environments.

hint
string

Likely fix when the failure cause is recognised.

hint_code
string

Stable identifier of the recognised failure cause.

image
string

Runner image the compute booted.

imageCapture
object

Capture failure recorded without changing the setup script verdict.

Example:
imageId
string

Agent Service image id being captured.

log_bytes
integer<int64>

Bytes of log persisted for the run.

log_lines
integer<int64>

Lines of log persisted for the run. The last line's seq equals this; pass it as after to tail.

log_truncated
boolean

True when the script produced more output than the run keeps (4 MiB); the head and the stderr tail are retained.

message
string

One-sentence description of the outcome.

next_action
object

The call that acts on this result: re-run setup after fixing the script, or fetch the log.

Example:
phase
string

Current or final phase: provision, gpu_check, setup, profile, commit, cleanup.

providerEventCursor
integer<int64>

Last Agent Service setup event sequence persisted into this run's log.

providerRunId
string

Durable Agent Service run id executing the setup script.

requested_by_user_id
string

User who requested a manual run.

session_id
string

Session the run provisioned, for kind session.

setupImage
object

Immutable image published by this run when capture succeeded.

Example:
started_at
string<date-time>

When provisioning began.

stderr_tail
string

Last lines of stderr, redacted and bounded to 2 KiB.