workspace block is ubx’s answer: a declarative manifest of your multi-repo dependency graph. Declare the repos, their stacks, and which stack depends on which, and ubx workspace apply runs them in topological order — parallel where safe, sequential where required.
What you’ll learn
- How
workspacedeclares a multi-repo stack dependency graph - How
depends_onexpresses cross-repo dependencies - How
ubx workspace applyorchestrates the graph in topological order
Why this matters
workspace is documentation that runs. The dependency graph between your repositories is always implicit — workspace makes it explicit, machine-readable, and executable. A new team member can read the workspace manifest and immediately understand the full platform topology.The source code
How it works
ubx builds a topological sort of the stack graph
The workspace manifest declares stacks as nodes and
depends_on entries as directed edges. ubx builds a DAG and topologically sorts it: platform/networking and platform/eks run first (in parallel), then backend/api (depends on both), then backend/worker and frontend/web (in parallel, since both depend only on backend/api).Parallel stacks run concurrently
Stacks with no dependency relationship between them run concurrently.
platform/networking and platform/eks have no declared dependency on each other — ubx runs them in parallel. ubx workspace apply uses goroutines to execute independent stacks simultaneously, minimising total wall-clock time.workspace produces no generated Pulumi code
workspace blocks compile to zero TypeScript/Python/Go. They’re read by the ubx workspace subcommand, which clones each repository, resolves the dependency graph, and runs ubx apply on each stack in order. The workspace runner is separate from the per-stack compiler.The execution order
platform → backend/api → frontend/web — not the sum of all stacks.
Common mistakes
Run it
What you learned
workspace declares a multi-repo dependency graph — stacks with depends_on run after their prerequisitesIndependent stacks run in parallel; dependent stacks run sequentially
workspace produces no generated code — it’s read by the ubx workspace subcommand onlyNext steps
remote stack reference
Consume outputs between stacks in the workspace
workspace block reference
Full workspace block syntax and all options
Full runnable example: github.com/ubiquex/ubx-examples/36-workspace-multi-repo

