Back Up a File Before Permanently Deleting It
A 4-step recipe with Google Drive. We can help you get access.
Recipe · 4 steps
Back Up a File Before Permanently Deleting It
with Google Drive
Archive a copy of a file, verify it, then permanently delete the original.
- Read the file's metadata to confirm it exists and capture its name and size before anything destructive is attempted.
- Copy the file into the archive folder under the supplied archive name. This copy is the only recoverable artifact once the original is deleted.
- Read the archived copy back and confirm it is present, untrashed, and filed in the archive folder. This step is the gate on the delete — if the backup cannot be read here, the original must not be destroyed.
- Permanently delete the original file. This bypasses the trash and cannot be undone, which is why it runs only after the archived copy has been read back successfully.
What you'll need to have ready
- fileId: The ID of the file to archive and then permanently delete.
- archiveFolderId: The ID of the folder the backup copy should be created in.
- archiveName: The name to give the archived copy (e.g. "2026-07-17 - Q3 Report (archived)").
For your developer
Arazzo workflow google-drive:backup-and-delete-file, 4 operations: getFile → copyFile → getFile → deleteFile. Specs on APIs.io.