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

# Temporal

Self-hosted [Temporal](https://temporal.io) — a durable workflow engine — at [temporal.augustin.ai](https://temporal.augustin.ai). It's the **durable runtime layer** for the [agent platform](/ai-management): the piece that lets long-running agents survive crashes, retry failed steps with backoff, and schedule themselves. Workers run agent code; Temporal persists every step so a restart resumes exactly where it left off.

## Deployment

A deliberately minimal install — three containers, \~1GB — ported from upstream's `docker-compose-postgres.yml` to a Swarm stack pinned to debian-1.

| Container             | Image                          | Role                                                                                    |
| --------------------- | ------------------------------ | --------------------------------------------------------------------------------------- |
| `temporal_temporal`   | `temporalio/auto-setup:1.29.1` | All-in-one server (frontend + matching + history + worker in one process), gRPC `:7233` |
| `temporal_postgresql` | `postgres:16-alpine`           | Persistence **and** visibility store                                                    |
| `temporal_ui`         | `temporalio/ui:2.34.0`         | Web UI `:8080`, fronted by Traefik                                                      |

Two choices keep this out of the enterprise-cluster weeds:

* **PostgreSQL, not Cassandra** (`DB=postgres12`). The default auto-setup uses Cassandra, which is overkill here.
* **No Elasticsearch** (`ENABLE_ES=false`). Postgres handles visibility (the searchable workflow index) at homelab scale — Elasticsearch would roughly triple the footprint for nothing.

There's no service split (separate frontend/matching/history/worker deployments) and no replicas. That's the over-engineered path; a single `auto-setup` process is the right altitude for one homelab.

## Networking

The server and UI join the shared `swarm` overlay; the server and Postgres also share a private `temporal-net` overlay. Agent workers connect to the gRPC frontend at **`temporal:7233`** over the `swarm` overlay — any stack on it can dial through (verified from the Mastra container). The UI talks to the same frontend internally and is exposed at `temporal.augustin.ai` via Traefik, with `TEMPORAL_CORS_ORIGINS` set so browser API calls are accepted.

`temporal-net` is intentionally **not** `--attachable`, so ad-hoc CLI containers must attach to `swarm` instead.

## Management

The `temporal` CLI ships inside the server image — no standalone admin-tools container runs (keeping it to three). Exec into the running task:

```bash theme={null}
CID=$(docker ps --filter name=temporal_temporal. -q | head -1)
docker exec "$CID" temporal operator cluster health  --address temporal:7233
docker exec "$CID" temporal operator namespace list  --address temporal:7233
```

The `default` namespace is created automatically on first boot. Postgres credentials live in `temporal/.env`.

## Status

Up and serving — frontend `SERVING`, UI loads, `default` namespace registered. The next step is pointing agent workers (Mastra, the coding frameworks) at `temporal:7233` and building the first durable agent workflow.
