Forgecroft Docs
Guides / Workspaces

Dependencies & Promotion

Define relationships between workspaces and promote changes through environments.

Workspace dependencies let you model relationships between infrastructure components and automate promotion through environments.

Dependency Types

TypeDescription
afterThis workspace should run after the dependency (default)
referencesThis workspace references resources from the dependency
softInformal dependency, no ordering guarantee

Adding Dependencies

POST /workspaces/{id}/dependencies
{
  "depends_on_id": "workspace-uuid",
  "dependency_type": "after",
  "auto_promote": false
}

Auto-Promote

When auto_promote is true, a successful apply on the upstream workspace automatically triggers a plan on the downstream workspace with trigger type promotion.

This is how Stacks create promotion graphs: when you define dev.promote_to = ["staging"], Forgecroft creates a dependency edge with auto_promote: true.

Auto-promote and auto-apply: If the downstream workspace has auto_apply: true, the promoted plan will automatically apply after governance passes. This enables fully automated promotion chains (e.g., apply in dev → auto-plan staging → auto-apply staging → auto-plan prod).

PR-triggered applies do not cascade. Auto-promote only fires for non-PR applies. This prevents pull request workflows from accidentally promoting changes through the graph.

Listing Dependencies

View what a workspace depends on:

GET /workspaces/{id}/dependencies

View what depends on a workspace (downstream consumers):

GET /workspaces/{id}/dependents

Manual Promotion

Trigger plans for all downstream workspaces:

POST /workspaces/{id}/promote

Optionally promote only specific downstreams:

POST /workspaces/{id}/promote
{ "workspace_ids": ["workspace-uuid"] }

Promotion creates queued plan runs with trigger: "promotion". Each downstream workspace is checked for trigger permission — workspaces where you lack trigger access are silently skipped.

Removing Dependencies

DELETE /workspaces/{id}/dependencies/{dependsOnId}

Use Cases

Environment Promotion

networking-dev → networking-staging → networking-prod

After applying networking changes in dev, promote to staging for validation, then to production.

Resource Dependencies

database → api → frontend

The API workspace depends on the database workspace. The frontend workspace depends on the API workspace.

Stacks

When you create a stack with promote_to, Forgecroft automatically creates the dependency graph. See the Stacks guide for details.