# Signal Archiving

> Source: https://docs.trailspark.ai/docs/signal-archiving

## Retention Policy

Each plan defines a `signalRetentionPeriod` (in days). When signals exceed this age, they become eligible for archiving. The default retention period is 30 days if no plan is configured.

Retention is measured from the signal's creation date.

## Archiving Lifecycle

```
Active (in database) → Retention period expires → Archived to S3 → Deleted from database
```

The archiving service runs automatically in batches:

1. **Staging signals** (`signal_staging` table): Processed signals older than the retention period are archived to S3 and deleted from the database.
2. **Mapped signals** (`signals` table): Follow the same retention-based archival.
3. **Lead archiving**: Leads with no remaining active signals and no recent activity may also be archived.

Signals permanently deleted from S3 after 365 days (default `PERMANENT_DELETE_DAYS`).

## What Archiving Affects

**Removed:**
- Archived signals no longer appear in Signal Explorer
- Statistics update to reflect active signals only
- Full payload and processing metadata are removed from the database

**Preserved:**
- Lead and account records remain intact
- Signal contributions to scores are retained
- Historical evaluation data is unaffected
- Leads are not archived unless they have no recent activity and no active signals

## Archived Signal Retrieval

Archived signals can be retrieved programmatically via the backend retrieval service. The service supports:

- Searching by organization, date range, and source table
- Temporary rehydration back into the database (with configurable TTL, default 24 hours)

> [!NOTE]
> Rehydrated signals count against your plan's raw signal limits.

## Next Steps

- [Signal Explorer](/docs/signal-explorer)
- [Understanding Signals](/docs/signals-overview)