Actions19
- Monitoring Actions
- Lifecycle Actions
- Hygiene Actions
- Portability Actions
- Analysis Actions
Lifecycle → Apply Retention
AI-generatedSummary
Apply a retention policy to remove episodes from the selected group, either by age or by keeping only the most recent episodes.
Inputs
- Backend — Storage backend: Embedded (Graphology) by default, or Neo4j (Remote).
- Custom Storage Path — For the embedded backend, an optional directory for graph data files. Leave empty to use n8n's default storage directory.
- Group ID (required) — The group or session ID whose episodes to process.
- Retention Type — Choose Keep for N Days to delete episodes older than the retention value, or Keep Last N Episodes to retain only the most recent number of episodes. Defaults to Keep for N Days.
- Retention Value — The number of days to keep or the maximum number of episodes to retain. Defaults to 30 and must be at least 1.
Output shape
A list of n8n items containing the storage backend's retention result.
The supplied source pack shows the lifecycle dispatcher and storage methods only at signature level, so the exact result fields and deletion details are not visible.
Examples
Example 1: Remove episodes older than 30 days
Set Group ID to the target group, Retention Type to Keep for N Days, and Retention Value to 30.
Example 2: Keep only the 10 most recent episodes
Set Group ID to the target group, Retention Type to Keep Last N Episodes, and Retention Value to 10.
