# WorkspaceBuilder.build(_:on:)

- **Module:** WorkspaceBuilder
- **Package:** TmuxWorkspace
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/254f8b2be7eb60cacc3ffcb3ea8e456784f582df/Sources/TmuxWorkspace/WorkspaceBuilder.swift#L18
- **Page:** https://libtmux.org/en/swift/latest/workspace/reference/workspacebuilder-build(_-on-)/

```
WorkspaceBuilder.build(_:on:)(workspace: Workspace, on: Server) -> Session
```

Creates the workspace's session and returns it.

Fails rather than adopting an existing session of the same name: two
callers building the same workspace should not silently share one.
A failure after creation removes that exact session. If cleanup also
fails, ``WorkspaceBuilderError/rollbackFailed(original:cleanup:)``
reports both errors.

## Raises

- `WorkspaceBuilderError`
