Skip to content

Environment Tree

Environments are organized in a parent-child hierarchy, forming a tree structure rooted at the master environment. This tree is useful for visualizing lineage, understanding which environments were branched from where, and planning merge strategies.

Environment tree structure and status lifecycle


Each environment node contains the following information:

  • Name: The environment identifier (e.g., master, staging, feature-auth).
  • Status: The current lifecycle state (active, branching, merging, error, archived).
  • Parent: The environment this branch was created from.
  • Branch Mode: Whether the branch was created as full (schema + data) or system (schema only).
  • Branched At: The timestamp when this environment was created.
  • Children: A list of environments that were branched from this one.

query EnvironmentTree($projectId: String!) {
environmentTree(projectId: $projectId) {
success
message
tree {
environment {
id
name
status
parentName
branchMode
branchedAt
}
children {
environment {
id
name
status
parentName
branchMode
branchedAt
}
children {
environment {
id
name
status
}
}
}
}
}
}

To retrieve a flat list of all environments (without tree nesting):

query GetProjectEnvironments($projectId: String!) {
projectEnvironments(projectId: $projectId) {
success
message
environments {
id
name
parentId
parentName
branchMode
branchedAt
status
createdAt
updatedAt
}
}
}

StatusDescription
activeThe environment is fully operational and available for use
branchingThe environment is being created (database cloning in progress)
mergingA merge operation is being applied to this environment
errorAn operation failed; the environment may be in an inconsistent state
archivedThe environment has been soft-deleted but its data is preserved