Block 1 - Schedule Trigger
- Type / Role
- n8n-nodes-base.scheduleTrigger - scheduleTrigger
- Config choices
- Version 1.2
This workflow is provided as-is. Please review and test before using in production.
Make your n8n instance faster, cleaner, and more efficient by deleting old workflow executions — while keeping only the most recent ones you actually need. Whether you're using n8n Cloud or self ho...
n8n-nodes-base.scheduletrigger, n8n-nodes-base.n8n, n8n-nodes-base.code, n8n-nodes-base.stickynote, n8n-nodes-base.set
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Arlin Perez.
Original n8n.io sourceMake your n8n instance faster, cleaner, and more efficient by deleting old workflow executions — while keeping only the most recent ones you actually need. Whether you're using n8n Cloud or self-hosted, this lightweight workflow helps reduce database/storage usage and improves UI responsiveness, using only official n8n nodes.
Automatically clean up old executions in your n8n instance using only official nodes — no external database queries required. Whether you're on the Cloud version or running self-hosted, this workflow helps you optimize performance and keep your instance tidy by maintaining only the most recent executions per workflow.
Ideal for users managing dozens or hundreds of workflows, this solution reduces storage usage and improves the responsiveness of the n8n UI, especially in environments where execution logs can accumulate quickly.
✅ What It Does
🔑 Create a Personal API Key in your n8n instance: Go to Settings → API Keys → Create a new key
🔧 Create a new n8n API Credential (used by both nodes): In your n8n credentials panel:
Name: anything you like (e.g., “Internal API Access”)
API Key: paste the Personal API Key you just created
Base URL: your full n8n instance URL with the /api/v1 path, e.g. https://your-n8n-instance.com/api/v1
✅ Use this credential in both:
The Get Many Executions node (to fetch recent executions)
The Delete Many Executions node (to remove outdated executions)
🧩 In the “Set Executions to Keep” node:
Edit the variable executionsToKeep and set the number of most recent executions to retain per workflow (e.g. 10)
Tip: Set it to 0 to delete all executions
📦 Note: The “Get Many Executions” node will retrieve up to 250 executions per run — this is the maximum allowed by the n8n API.
🧠 No further setup is required — the filtering and grouping logic is handled inside the Code Node automatically.
🕒 Schedule Trigger → Set to run daily, weekly, etc.
📥 Get Many Executions → Fetches past executions via n8n API
🛠️ Set Executions to Keep → Set how many recent ones to keep
🧠 Code Node → Filters out executions to delete per workflow
🗑️ Delete Executions → Deletes outdated executions
Reduce clutter and improve performance in your n8n instance
Maintain execution logs only when they’re useful
Avoid bloating your storage or database with obsolete data
Compatible with both n8n Cloud and self-hosted setups
Uses only official, supported n8n nodes — no SQL, no extra setup
🔒 This workflow modifies and deletes execution data. Always review and test it first on a staging instance or on a limited set of workflows before using it in production.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Automated execution cleanup system with n8n API and custom retention rules |
|---|---|
| Complexity | intermediate |
| Nodes | 12 |
| Categories | DevOps |
| Author | Arlin Perez |
| Published | 02 Aug 2025 |
Use the JSON export at /data/workflows/6833/6833.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
Make your n8n instance faster, cleaner, and more efficient by deleting old workflow executions — while keeping only the most recent ones you actually need. Whether you're using n8n Cloud or self ho...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.