> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ubiquex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# workspace block

> Orchestrate multiple stacks in dependency order.

The `workspace` block defines a multi-stack orchestration manifest. Used with `ubx workspace plan` and `ubx workspace apply` to deploy stacks in topological order.

## Syntax

```hcl theme={null}
workspace "name" {
  stack "stack_name" {
    path       = "./stacks/networking"
    depends_on = ["other_stack"]
  }
}
```

## Example

```hcl theme={null}
workspace "platform" {
  stack "networking" {
    path = "./stacks/networking"
  }

  stack "eks" {
    path       = "./stacks/eks"
    depends_on = ["networking"]
  }

  stack "apps" {
    path       = "./stacks/apps"
    depends_on = ["networking", "eks"]
  }
}
```

## Commands

```bash theme={null}
ubx workspace plan platform    # preview all stacks in order
ubx workspace apply platform   # deploy all stacks in order
```

## Stack Fields

| Field        | Required | Description                                |
| ------------ | -------- | ------------------------------------------ |
| `path`       | yes      | Relative path to the stack directory       |
| `depends_on` | no       | List of stack names that must deploy first |

## Topological Sort

ubx performs a topological sort on `depends_on` before deploying. Circular dependencies are detected and reported as compile errors:

```
✗  workspace "platform": circular dependency detected: eks → apps → eks
```

## No TypeScript Emitted

`workspace` blocks are orchestration-only — no TypeScript is emitted.
