Archival & Audit
What Archival Achieves
- Storage hygiene. Conversation and message records accumulate quickly. Archival keeps the live data set focused on the recent past.
- Compliance. Many organisations have policies requiring data to be deleted after a fixed period. Archival operationalises that policy.
- Auditability. Aggregate counts and per-period CSV exports remain after the underlying records are deleted, so you can prove what happened without keeping every individual record.
What Gets Archived
The monthly run deletes the records below when they exceed their retention window. Each step happens in sequence; failure at one step doesn’t cascade into the others.
| Object | What’s deleted |
|---|---|
| Messages | Individual user and assistant turns within conversations. |
| Conversations | Conversation records (after their messages have been deleted). |
| Credit Transactions | Per-interaction credit-consumption records. |
| Scheduled Actions | Only those in terminal states — Executed, Cancelled, Failed, Skipped. Pending and active actions are never deleted by archival. |
The associated Archival Log is the audit record that survives. Incident Logs and Credit Periods are not archived — they’re retained as the long-term audit substrate.
Retention Hierarchy
Each record’s retention is determined by the agent that owns it, with a clear precedence:
-
Skip Archival
Agents with the Skip Archival checkbox set on the Agent Definition are never archived. Their conversations, messages and credit transactions stay forever (or until manually deleted).
-
Per-agent retention
If an agent has its own Archival Retention Days field set, that value applies. Minimum allowed value: 60 days — set a lower number and REDA AI raises it to 60. That floor is load-bearing for credit accounting: archiving a period's ledger would make its consumed-credits total re-compute short.
-
Global default
Otherwise the Archival Retention Days Platform Setting applies. Default: 180 days. Set to 0 to disable archival entirely.
Records older than the applicable retention window are eligible for deletion in the next run. Records younger than the window are skipped.
Schedule
- The archival job runs automatically at 2:00 AM on the 1st of each month, under the scheduled-job name
REDAAI_Archival_Monthly. - Each run processes all records that exceeded retention since the previous run.
- If the global retention is set to 0, the job is treated as disabled and exits immediately. The schedule remains in place; flipping the setting back to a positive value re-enables archival on the next scheduled run.
The schedule is set up automatically when the package is installed and is visible in Setup › Scheduled Jobs.
The Six Steps of an Archival Run
Each monthly run is a chain of discrete batches so the work fits within Salesforce’s asynchronous limits. Steps execute in this order:
| # | Step | What happens |
|---|---|---|
| 1 | Snapshot | Aggregate the records that will be deleted — counts, credit and token totals. Generate the per-step CSVs and attach them to a new Archival Log record. |
| 2 | Messages | Delete eligible Message records. |
| 3 | Conversations | Delete eligible Conversation records. |
| 4 | Credit Transactions | Delete eligible Credit Transaction records. |
| 5 | Scheduled Actions | Delete eligible Scheduled Action records (terminal states only). |
| 6 | Finalize | Update the Archival Log’s status to Completed. If any earlier step failed, status reflects that and details are captured on the log. |
What the Archival Log Captures
For every monthly run, an Archival Log record is created with aggregate totals and CSV attachments. The record holds:
- Archival Date and Period Key for the run
- The retention window in effect when the run executed
- Status (Completed, Failed, In Progress)
- Counts: Conversations Archived, Messages Archived, Transactions Archived
- Aggregate totals: Total Credits, Total Input Tokens, Total Output Tokens, Total Cache Creation Tokens, Total Cache Read Tokens
- The Credit Period the run covered (lookup)
- Error details when the run did not complete cleanly
All CSVs are written during step 1 (Snapshot), before a single record is deleted, so the evidence exists even if a later step fails. Three files are attached to the Archival Log:
Archived_Conversations.csvArchived_Messages.csvArchived_Transactions.csv
Scheduled Actions are deleted without a CSV — step 5 removes them, but no snapshot file is produced for them. If you need a record of expiring scheduled actions, export them before the run.
Each file is capped at 50,000 rows. Deletion is not capped, so a run larger than that deletes more than the CSV records. When this happens REDA AI writes a note such as “Messages CSV truncated at 50000 rows” to Error Details on the Archival Log — check that field before treating a CSV as the complete list.
For the field-by-field reference and how to read individual archival logs, see AI Archival Logs.
Tamper-Proof Audit Records
Three categories of records form the platform’s audit substrate and are protected from update or delete:
- Archival Logs — once created, cannot be edited or deleted by users. The CSV attachments are similarly immutable.
- Incident Logs — the Apex incident record from any failure. See AI Incident Logs.
- Credit Periods — the monthly credit-consumption summaries that underpin licence-usage reporting.
These protections apply through the platform’s record-protection layer; even users with broad object permissions cannot bypass them through the UI or standard APIs. Auditors can therefore rely on the values being authoritative.
Configuring Archival
Globally
Set Archival Retention Days in Platform Settings. Choose a value of at least 60 days. Set to 0 to disable archival entirely. See Platform Settings Reference.
Per agent
- To exempt an agent entirely, tick Skip Archival on the Agent Definition.
- To override the global retention for one agent, set its Archival Retention Days field. Minimum: 60 days.
- Per-agent retention covers that agent’s conversations, messages and credit transactions. Scheduled Actions are not linked to an agent, so they are always aged against the global setting, whatever any agent overrides say.
Audit retention
The Archival Log records and their CSV attachments are not themselves archived. They persist indefinitely so the audit history is preserved. Plan your file-storage usage accordingly — large orgs with many monthly runs accumulate CSV storage over time.
Monitoring Archival Runs
- Setup › Scheduled Jobs — confirm the job is scheduled and check its Last Fired and Next Fire times.
- Setup › Apex Jobs — the most recent batch executions appear here, with row counts and any errors.
- Archival Logs tab — the canonical record of each monthly run’s outcome.
- Incident Log — failures inside the archival batch are logged here for admin investigation.
Best Practices
Pick a retention that matches policy, not convenience. The default 180 days is a starting point. If your compliance policy requires shorter retention, lower the value globally. If certain agents need different retention, override per agent.
Use Skip Archival sparingly. An agent with archival skipped accumulates conversations forever. Reserve the flag for agents where every conversation has long-term business value (e.g. compliance-relevant approvals).
Watch the audit-log file storage. CSV attachments accumulate. Periodically review file storage utilisation and adjust per-agent retention if the audit footprint grows beyond what your org can comfortably store.
Don’t hand-edit archival output. The audit records are protected for a reason. If a run produced incorrect data, address the underlying cause and let the next run produce a clean record — don’t try to retroactively change the prior log.
Verify after major changes. If you change retention values or add Skip Archival flags, watch the next run’s Archival Log to confirm the platform behaved as you expected.
Frequently Asked Questions
Yes. Set Archival Retention Days to 0 in Platform Settings. The scheduled job remains in place but exits immediately when it fires. Flip the value back to a positive number to re-enable.
The detail is in the CSV attached to the relevant Archival Log. Aggregate totals are on the log itself. Individual records cannot be restored automatically — archival is a deletion, not a soft-delete.
No. Incident Logs are part of the long-term audit substrate, alongside Credit Periods and Archival Logs themselves. They persist indefinitely.
The schedule fires monthly. There is no standard admin button to trigger an off-schedule run. If you need an immediate archival pass, contact REDA AI Support.
The Archival Log’s status reflects the failure and Error Details holds the reason. The Incident Log captures the underlying exception. The next monthly run will retry the work for any records still beyond retention.
So that auditors and reviewers can rely on them as authoritative. If users could edit Archival Logs or Incident Logs after the fact, the audit trail would lose its integrity. The protection applies even to admin users.
The flag applies on the next archival run, not retroactively. Records older than the retention window that were already archived are gone. Going forward, conversations and messages on the flagged agent will be preserved.
Yes. Set per-agent Archival Retention Days on the Agent Definition. Different agents can use different values; the global default applies only to agents that don’t override.
Next Steps
Read AI Archival Logs for the field-level reference of individual archival records, or Platform Settings Reference for the global retention setting.