sandbox_template_builds
Creates, updates, deletes, gets or lists a sandbox_template_builds resource.
Overview​
| Name | sandbox_template_builds |
| Type | Resource |
| Id | railway.agents.sandbox_template_builds |
Fields​
The following fields are returned by SELECT queries:
- get
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.
| Name | Datatype | Description |
|---|---|---|
id | string | The template's resolved-content hash. |
environment_id | string | |
status | string | (BUILDING, FAILED, PENDING, READY) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | environment_id, id | 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. | |
create | insert | environment_id | Build 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.
| Name | Datatype | Description |
|---|---|---|
environment_id | string | |
id | string |
SELECT examples​
- get
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​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: sandbox_template_builds
props:
- name: environment_id
value: "{{ environment_id }}"
- name: instructions
value:
- "{{ instructions }}"
description: |
Build a template by running these shell instructions on the base image. Mutually exclusive with name.
- name: name
value: "{{ name }}"
description: |
Boot from a saved checkpoint with this name (one captured from a sandbox). Mutually exclusive with instructions.
- name: region
value: "{{ region }}"
description: |
Placement region for the build sandbox. The resulting checkpoint lives in this region, and sandboxes created from the template boot there. Defaults to the platform default; only the cold build consults it (a built template's own region wins).
- name: variables
value: "{{ variables }}"
description: |
Environment variables available to the template's build instructions. Values may contain Railway variable references (e.g. ${{shared.FOO}}, ${{ServiceName.BAR}}), resolved at build time.