Skip to main content
Temporal supports archiving workflow histories and visibility records to external storage for compliance, auditing, and long-term retention.

Overview

Archival moves data from the active persistence store to cheaper, long-term storage:
  • History Archival - Complete workflow execution history
  • Visibility Archival - Workflow metadata for search and list
Archival happens automatically after workflow completion based on namespace configuration.

Supported Providers

Temporal includes built-in archival providers:
  • Filestore - Local or network filesystem
  • S3 - Amazon S3 and compatible services
  • Google Cloud Storage - GCS buckets

Global Configuration

Enable archival cluster-wide:
States:
  • enabled - Archival active, namespaces can enable
  • disabled - Archival unavailable
  • paused - Temporarily suspended
Options:
  • enableRead - Allow reading from archive

Filestore Provider

Configuration

URI Format

Best Practices

  1. Network Storage: Use NFS or similar for multi-node access
  2. Permissions: Ensure all Temporal workers can read/write
  3. Quotas: Monitor disk usage, implement rotation
  4. Backup: Regular backups of archive directory

Example Setup

S3 Provider

Configuration

URI Format

Authentication

Use IAM roles (recommended) or credentials:
IAM Policy:

S3 Bucket Configuration

Lifecycle policy (lifecycle.json):

Google Cloud Storage Provider

Configuration

URI Format

Authentication

Create service account:

GCS Bucket Configuration

Lifecycle policy (lifecycle.json):

Namespace Configuration

Configure archival per namespace:
Or update existing:
Namespace States:
  • enabled - Archive workflows in this namespace
  • disabled - Do not archive

Default Namespace Archival

Set defaults for new namespaces:

Reading Archived Data

History

Retrieve archived workflow history:
Temporal automatically checks archive if not in primary store.

Visibility

Query archived workflows:
Note: Visibility queries against archive may be slower than active store.

Archival Process

Archival occurs through system workflows:
  1. Workflow Completes - Workflow reaches final state
  2. Retention Period - Waits for namespace retention period
  3. Archival Task - System worker picks up archival task
  4. Upload History - History events uploaded to archive URI
  5. Upload Visibility - Visibility record uploaded
  6. Delete from DB - Primary store data deleted

Archival Workers

System workers handle archival:
Scale workers based on archival throughput:

Monitoring Archival

Metrics

Each emits:
  • Request count
  • Error count
  • Upload size
  • Latency

Alerts

Recommended alerts:
  1. Archival Failures
  2. High Archival Latency
  3. Queue Backlog

Archival Best Practices

1. Separate Archive URIs per Namespace

2. Configure Retention Appropriately

3. Test Archive Reads Regularly

4. Monitor Storage Costs

  • Use lifecycle policies to transition to cheaper storage
  • Archive only necessary namespaces
  • Set appropriate retention periods

5. Implement Archive Backup

Backup archive storage separately:

Troubleshooting

Archival Failures

Symptoms:
  • HistoryArchiver_errors metrics increasing
  • Workflows not archived after retention
Common Causes:
  1. Permissions - Missing S3/GCS write permissions
  2. URI Invalid - Incorrect bucket name or path
  3. Network - Cannot reach storage endpoint
  4. Quota - Storage quota exceeded
Solutions:

Cannot Read Archived Data

Symptoms:
  • workflow not found when querying old workflows
  • Archive reads fail
Solutions:
  1. Verify enableRead: true in global config
  2. Check archive URI matches namespace config
  3. Verify read permissions on storage
  4. Check worker can access storage endpoint

High Archival Latency

Symptoms:
  • Slow archival task processing
  • Large queue backlog
Solutions:
  1. Scale worker service horizontally
  2. Increase worker task processing concurrency
  3. Use faster storage tier
  4. Optimize network path to storage

Advanced Configuration

Custom Archiver Implementation

Implement custom archiver for proprietary storage:
Register in provider:

Archival Workflow Customization

Configure archival workflow via dynamic config:

See Also