Skip to main content

environment_history

Creates, updates, deletes, gets or lists an environment_history resource.

Overview​

Nameenvironment_history
TypeResource
Idrailway.environments.environment_history

Fields​

The following fields are returned by SELECT queries:

One row per ProjectHistoryEntry. One settled change in an environment: a system event or a terminal operation (patch, deploy, …).

NameDatatypeDescription
idstring
workflow_idstring
actionstring
activity_payloadobjectMinimal payload for activity feed list rendering. Same trimming as Event.activityPayload.
actorobjectProjectOperationActor object
changesobject
created_atstring (date-time)When the change settled.
objectstring
operation_kindstring'' for a plain event; e.g. 'patch', 'deploy' for operations.
outcomestring'' for a plain event; 'applied' or 'failed' for operations.
parent_refstring
payloadobject
service_idsarray
severitystring (CRITICAL, INFO, NOTICE, WARNING)
sourcestring

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectenvironment_idactions, objects, outcomes, service_idsSettled history for an environment (system events + terminal operations), newest first. Cursor-paginated. Backed by the Railway GraphQL query environmentHistory.

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
actionsstringGraphQL list literal, for example ["a", "b"].
objectsstringGraphQL list literal, for example ["a", "b"].
outcomesstringAny of '', 'applied', 'failed'. GraphQL list literal, for example ["a", "b"].
service_idsstringGraphQL list literal, for example ["a", "b"].

SELECT examples​

Settled history for an environment (system events + terminal operations), newest first. Cursor-paginated. Backed by the Railway GraphQL query environmentHistory.

SELECT
id,
workflow_id,
action,
activity_payload,
actor,
changes,
created_at,
object,
operation_kind,
outcome,
parent_ref,
payload,
service_ids,
severity,
source
FROM railway.environments.environment_history
WHERE environment_id = '{{ environment_id }}' -- required
AND actions = '{{ actions }}'
AND objects = '{{ objects }}'
AND outcomes = '{{ outcomes }}'
AND service_ids = '{{ service_ids }}'
;