# WorkspaceBuilder.build(_:on:)

- **Module:** WorkspaceBuilder
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/TmuxWorkspace/WorkspaceBuilder.swift#L17
- **Page:** https://libtmux.org/reference/swift/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`
