Optimize your self-hosted n8n instance performance by automatically deleting old execution history. This essential n8n workflow uses the internal n8n node to manage database size.
Download this n8n workflow template and start using it instantly.
For users running self-hosted instances of n8n, the execution history database can grow rapidly, potentially impacting overall performance and consuming unnecessary storage. This critical n8n workflow provides a set-and-forget solution for database hygiene. By leveraging the powerful internal n8n node, this automation lists all historical runs and deletes any record older than 10 days. This essential cleanup ensures system stability and keeps your resource consumption optimized. Deploying this n8n template is a key step toward sustainable, long-term n8n operation.
This administrative n8n workflow operates on a scheduled basis, ensuring continuous maintenance without manual intervention.
Schedule Trigger, set to run daily (e.g., at 4:44 AM). A manual n8n trigger is also available for testing purposes.n8n list execution n8n node connects to the instance's API to retrieve a comprehensive list of all past workflow executions (resource: execution). It utilizes the 'Return All' option to process the entire history.If n8n node evaluates each execution record individually. It checks if the execution's start time ($json.startedAt) is chronologically 'before' a dynamically calculated date—specifically, 10 days ago. This is the core logic of the retention policy.delete execution n8n node. This node uses the execution ID ($json.id) derived from the incoming item to delete the specific historical record.No Operation, do nothing n8n node, ensuring recent history is preserved. This continuous, automated cycle keeps your n8n execution log optimized.To deploy this n8n workflow template and begin pruning old data, follow these steps:
n8n list execution and delete execution nodes.Schedule Trigger to your desired maintenance time, and then activate the n8n workflow.Resource to execution and enabling Return All.startedAt is before Date.now() - 10 days. This condition controls which records are targeted for deletion.If statement returns True, this n8n node takes the incoming execution ID ({{ $json.id }}) and performs a delete operation on the execution resource, removing the old log entry permanently.Use this powerful n8n workflow to automatically fetch your latest YouTube video, generate engaging posts using OpenAI, enforce character limits, and publish directly to X (Twitter).

Streamline your content pipeline with this n8n workflow. Automatically monitor Google Drive for new images, optimize them using TinyPNG, and save the compressed files back to the cloud.

Deploy this powerful n8n workflow to automatically generate personalized training certificates with unique IDs and instantly deliver them to recipients using Gmail. Perfect for educational platforms.

Use this powerful n8n workflow to automate daily stock market updates. Fetch the Nikkei 225 closing price and distribute formatted notifications efficiently using the LINE Messaging API.

Use this essential n8n workflow to automatically monitor your self-hosted n8n instance version against the latest official release using an n8n trigger and conditional logic.

Use this powerful n8n workflow to automatically scrape and search senior job listings on LinkedIn and X, aggregating all valid results into a single, organized Notion database daily. Customize keywords and location easily.









































