Skip to main content

sandbox_template_builds

Creates, updates, deletes, gets or lists a sandbox_template_builds resource.

Overview​

Namesandbox_template_builds
TypeResource
Idrailway.agents.sandbox_template_builds

Fields​

The following fields are returned by SELECT queries:

One SandboxTemplateBuild row. The state of a template build, derived from its workflow and the existence of its checkpoint. READY means the checkpoint exists and can be booted.

NameDatatypeDescription
idstringThe template's resolved-content hash.
environment_idstring
statusstring (BUILDING, FAILED, PENDING, READY)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectenvironment_id, idGet a template's build state by id (the recipe content hash). READY once its checkpoint exists; BUILDING/FAILED reflect the build workflow. Backed by the Railway GraphQL query sandboxTemplateBuild.
createinsertenvironment_idBuild a sandbox template into a bootable checkpoint. Backed by the Railway GraphQL mutation sandboxTemplateBuild.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
environment_idstring
idstring

SELECT examples​

Get a template's build state by id (the recipe content hash). READY once its checkpoint exists; BUILDING/FAILED reflect the build workflow. Backed by the Railway GraphQL query sandboxTemplateBuild.

SELECT
id,
environment_id,
status
FROM railway.agents.sandbox_template_builds
WHERE environment_id = '{{ environment_id }}' -- required
AND id = '{{ id }}' -- required
;

INSERT examples​

Build a sandbox template into a bootable checkpoint. Backed by the Railway GraphQL mutation sandboxTemplateBuild.

INSERT INTO railway.agents.sandbox_template_builds (
environment_id,
instructions,
name,
region,
variables
)
SELECT
'{{ environment_id }}' /* required */,
'{{ instructions }}',
'{{ name }}',
'{{ region }}',
'{{ variables }}'
RETURNING
id,
environment_id,
status
;