Automated n8n Execution Cleanup
detail.loadingPreview
This workflow automatically cleans up old n8n workflow executions. It schedules a daily check to identify and delete executions older than 10 days, keeping your n8n instance lean and efficient.
About This Workflow
Streamline your n8n instance management with this automated workflow designed for efficient execution cleanup. Triggered by a schedule, this workflow intelligently identifies and removes n8n executions that are older than 10 days. By periodically clearing out historical execution data, you can maintain optimal performance, reduce storage overhead, and ensure your n8n environment remains organized and responsive. This is an essential tool for anyone managing multiple workflows or a high volume of executions.
Key Features
- Automated Cleanup: Regularly removes old n8n workflow executions without manual intervention.
- Customizable Retention: Configurable to delete executions older than a specified period (default 10 days).
- Scheduled Operation: Runs automatically at a specified time each day.
- Conditional Logic: Employs an 'If' node to ensure only relevant executions are targeted for deletion.
- Manual Test Option: Allows for immediate testing of the workflow's functionality.
How To Use
- Schedule Trigger: Configure the 'Schedule Trigger' node to set the desired daily execution time (e.g., 4:44 AM).
- n8n List Execution: This node fetches all available n8n executions. Ensure your n8n API credentials are correctly set up.
- If Node: The 'If' node checks if an execution's
startedAttimestamp is older than 10 days. The condition={{ $json.startedAt }}compares against={{ new Date(Date.now() - 10 * 24 * 60 * 60 * 1000).toISOString(); }}. - Delete Execution: If the condition in the 'If' node is met (execution is older than 10 days), this node will delete the specified n8n execution using its ID (
={{ $json.id }}). Ensure n8n API credentials are set. - No Operation, do nothing: If the condition in the 'If' node is not met, this node acts as a placeholder, performing no action.
- Manual Trigger: The 'When clicking ‘Test workflow’' node allows you to manually trigger the workflow for testing purposes. This node also initiates the 'n8n list execution' node.
Apps Used
Workflow JSON
{
"id": "f16416a2-d933-4c4a-b054-a71c62fc5bcb",
"name": "Automated n8n Execution Cleanup",
"nodes": 5,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: f16416a2-d933...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.