Skip to main content
Retention policies automate data lifecycle management by removing data that has exceeded a specified age. You can configure retention policies directly from the dataset details page using the Retention tab.
This guide covers the UI-based configuration. You can also manage retention policies programmatically through the Upsert Retention Policies API or the TypeScript SDK.

Prerequisites

  • A dataset you own or have write access to
  • The dataset must be on an active data plane

Understanding policy classes

Before configuring a policy, choose the right policy class for your use case. The available classes depend on your data plane:
Policy classWhat it deletesAvailable on
Row TTLIndividual rows whose event timestamp exceeds the intervalSnowflake data planes
Snapshot TTLOld ingestion snapshots based on snapshot ageAWS data planes
Table TTLThe entire dataset when table age exceeds the intervalBoth
For a detailed explanation of each policy class, see Dataset retention policies.
Deletions on Snowflake-based data planes are immediate with no grace period. AWS-based data planes apply a default 30-day grace period before permanent deletion.

Adding a retention policy

1

Navigate to the dataset

Go to My Data > Datasets and select the dataset you want to configure.
2

Open the Retention tab

Select the Retention tab on the dataset details page. If no policies are configured, you see an empty state with a prompt to add your first policy.
3

Start a new policy

Click the New Policy + button. You can either:
  • Click the button directly to open the manual configuration drawer
  • Click the dropdown arrow to choose between Ask Rosetta (AI-assisted) or Configure manually
4

Configure the policy

In the configuration drawer, set the following:Policy class — Select the type of retention policy. The available options depend on your data plane.Interval — Choose a preset duration (30, 90, 180, or 365 days) or enter a custom ISO 8601 duration such as P60D for 60 days.Class-specific settings:
Event time clock — Select the Rosetta Stone attribute that maps to a timestamp column in your dataset. The dropdown shows all timestamptz attributes mapped on the dataset. If you don’t specify one, the system defaults to nio_last_modified.
Status — Toggle the policy on or off. Policies are enabled by default.
5

Save the policy

Click Add Policy to save. The policy appears in the retention policies table.

Using Ask Rosetta to generate a policy

Instead of configuring a policy manually, you can describe what you want in plain language and let Rosetta generate the configuration for you.
1

Open Ask Rosetta

From the Retention tab, click the dropdown arrow on the New Policy + button and select Ask Rosetta.
2

Describe your policy

Enter a plain-language description of the retention behavior you want. For example:
Delete individual rows older than 90 days based on when the event occurred. Use the event_timestamp attribute as the clock. Keep the policy enabled.
You can also click Use this prompt to start with the sample prompt provided.
3

Generate and review

Click Generate Policy. Rosetta converts your description into a structured policy configuration and opens the configuration drawer with the values pre-filled. Review the settings and adjust if needed.
4

Save the policy

Click Add Policy to save the generated configuration.
If you prefer to configure manually instead, click the Manual button in the Ask Rosetta dialog to switch to the manual configuration drawer.

Editing a retention policy

To modify an existing policy, click the actions menu (three dots) on the policy row and select Edit. The configuration drawer opens in edit mode with the current settings pre-populated. You cannot change the policy class when editing — to switch policy classes, delete the existing policy and create a new one.

Enabling or disabling a policy

You can toggle a policy on or off without deleting it:
  • From the table — Click the toggle switch next to the policy class badge
  • From the actions menu — Click the actions menu and select Enable or Disable
Disabled policies remain in the configuration but are not evaluated during retention runs.

Deleting a retention policy

Click the actions menu on the policy row and select Delete. Confirm the deletion in the dialog that appears. This removes the policy configuration entirely — it does not undo any deletions that have already occurred.

Dataset retention policies

Understand how retention policies work and when to use each policy class

Data planes

Learn where your data physically resides and how it affects retention behavior

EXPIRE clause

Set retention on materialized views using NQL

Upsert Retention Policies API

Manage retention policies programmatically