π Compress and archive old Google Drive PDFs to AWS S3 cold storage with Slack reports
β‘ 3 views Β· π File Management
Description
Consolidate and compress project archives for cost-optimized cloud storage
π― Description
Optimize your cloud storage costs by using this automation to intelligently compress and migrate aging project documentation. This workflow allows you to achieve a professional data lifecycle policy by identifying βstaleβ files in active storage, applying high-ratio PDF compression, and migrating them to cold storage while maintaining a searchable audit trail.
A critical technical feature of this template is the Luxon-based lifecycle logic. By utilizing {{ $now.minus({ months: 6 }).toISODate() }}, the workflow dynamically filters for files that havenβt been modified in over half a year. It then generates a unique archive path using {{ $now.toFormat('yyyy/MM_MMM') }}, ensuring your cold storage bucket remains perfectly indexed by year and month without any manual folder creation or renaming.
β¨ How to achieve automated storage optimization
You can achieve an enterprise-grade archiving system by using the available tools to:
- Monitor and age-gate β Use the Google Drive node to list project files and a Code node to compare file metadata against a 6-month βhot storageβ threshold.
- Compress and verify β Pass identified files through the HTML to PDF compression engine to reduce file size by up to 80% while maintaining document readability.
- Migrate to cold storage β Stream the compressed binary directly to AWS S3 (or a dedicated archive folder), using dynamic naming conventions for organized retrieval.
- Log and notify β Automatically alert the IT team via Slack upon batch completion, providing a report on the specific files migrated and the storage path used.
π‘ Key features
- Intelligent cost reduction β Automatically targets large, old files for compression, significantly reducing long-term βCold Storageβ billing.
- Dynamic indexing β Uses Luxon to build a chronological folder structure in the cloud, making multi-year archives easy to navigate.
- Integrity assurance β The workflow ensures files meet specific age and type criteria before moving them, preventing accidental archival of active documents.
π¦ What you will need
- Google Drive β Your βHotβ storage where active project files are kept.
- HTML to PDF Node β Used here for the PDF compression and optimization engine.
- AWS S3 β Your destination βColdβ storage for long-term archiving.
- Slack β For automated reporting on storage optimization status.
Ready to optimize your cloud storage? Import this template, connect your credentials, and start saving on long-term data costs today.
π Nodes Used
Slack, Google Drive, S3, Schedule Trigger
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File