Skip to main content

Auto-cleanup of 对象存储 files older than 2 weeks (+ Telegram notifications)

Workflow preview

Workflow preview
100%
Auto-cleanup of 对象存储 files older than 2 weeks (+ Telegram notifications) preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow automatically connects to a 对象存储 bucket (via S3 compatible API), filters out files older than 14 days, deletes them, and then sends a Telegram notification for each deletion. It runs ...

Best for

  • File Management automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.s3, n8n-nodes-base.code, n8n-nodes-base.telegram, n8n-nodes-base.scheduletrigger, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mobder.

Original n8n.io source

1.1 Workflow description

Title
Auto-cleanup of 对象存储 files older than 2 weeks (+ Telegram notifications)
Workflow name
Auto-cleanup of 对象存储 files older than 2 weeks (+ Telegram notifications)

This workflow automatically connects to a 对象存储 bucket (via S3-compatible API), filters out files older than 14 days, deletes them, and then sends a Telegram notification for each deletion. It runs on a daily schedule.

🕘 Schedule Trigger Executes the workflow once a day at a specified hour (e.g., 9 AM).

📦 S3 Node – List Files Retrieves all objects from a specific folder (prefix) in a 对象存储 bucket using the S3 API.

🔎 Code Node – Filter Files Older Than 2 Weeks Filters the retrieved files by comparing their LastModified timestamps to the current date. Files older than 14 days (2 weeks) are selected for deletion.

🗑️ S3 Node – Delete File Deletes each filtered file from the R2 bucket.

📨 Telegram Node – Notify Deletion Sends a Telegram message with the name of the deleted file to a specified chat ID. The message includes:

1.2 Logical Blocks

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.

2. Block-by-Block Analysis

Block 1 - S3

Type / Role
n8n-nodes-base.s3 - s3
Config choices
Version 1

Block 2 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - S31

Type / Role
n8n-nodes-base.s3 - s3
Config choices
Version 1

Block 4 - Telegram

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 5 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Auto-cleanup of 对象存储 files older than 2 weeks (+ Telegram notifications)
Complexity intermediate
Nodes 10
Categories File Management
Author Mobder
Published 27 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4418/4418.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

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.

Frequently asked questions

What does Auto-cleanup of 对象存储 files older than 2 weeks (+ Telegram notifications) do?

This workflow automatically connects to a 对象存储 bucket (via S3 compatible API), filters out files older than 14 days, deletes them, and then sends a Telegram notification for each deletion. It runs ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

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 File Management use case.