24h, 720h, or 2160h, with a minimum of one day.
Longer retention grows the Temporal PostgreSQL database in proportion to the history you keep, so size that database before you raise the setting.
Docker Compose
Set the retention period in your.env file, then recreate the Temporal service.
TEMPORAL__CLUSTER_NAMESPACE, which is default unless you changed it.
AWS ECS Fargate
Set thetemporal_default_namespace_retention Terraform variable and apply.
temporal_db_allocated_storage in the same apply if the Temporal database needs more room for the longer history.
For an existing deployment, run the Temporal CLI from inside the VPC, because the Temporal service is only reachable on the private subnets.
Run a one-off ECS task with the temporalio/admin-tools image on the same subnets and security groups as the temporal service, with TEMPORAL_ADDRESS set to temporal-service:7233, then run:
Kubernetes
Set the retention period on the namespace the chart creates.temporal-setup post-install hook creates the namespace with this retention. It does not change retention on a namespace that already exists.
For an existing deployment, update the namespace from the admin tools pod:
tracecat with your release name and namespace if they differ.
S3 archival
Archival copies closed workflow event histories and visibility records to S3 so they outlive the retention period. This keeps history available for compliance and audits while your retention period stays short enough to keep the Temporal database small. Archived history is available through the Temporal CLI and Temporal Web UI, not through Tracecat workflow logs. Archival is available on the Kubernetes deployment only, because Temporal does not support archival when running through Docker. Temporal treats archival as an experimental feature.1
Create the bucket and grant access
Create an S3 bucket for archival, then grant the Temporal server pods
s3:PutObject, s3:GetObject, and s3:ListBucket on it.
On EKS, create a service account for Temporal and annotate it with the IAM role ARN.2
Enable archival on the Temporal cluster
Enable the
s3store provider at the cluster level and set the namespace archival URIs.enableRead: true lets the Temporal CLI and Web UI read archived history.3
Apply the values
temporal-setup hook enables archival on the Tracecat namespace and sets the URIs.
A namespace archival URI is immutable once archival is enabled, so pick the bucket and prefix before the first upgrade.4
Verify archival
Config.HistoryArchivalState and Config.VisibilityArchivalState report Enabled with the URIs you set.
Temporal archives a closed workflow asynchronously, up to five minutes after it closes, so run a workflow and wait before checking the bucket.Related pages
- See Docker Compose for the full single-host deployment, including the
.envfile this page edits. - See AWS ECS Fargate for the Terraform variables and apply workflow.
- See Kubernetes for the Helm values structure and upgrade commands.