Workflow Backup and Deletion Automation - n8n Workflow

Use this powerful n8n workflow to automatically backup and delete inactive n8n templates. Clean your instance, save backups to Google Drive, and manage your n8n nodes efficiently.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

n8n administrators managing self-hosted or large n8n instances.
Users who frequently retire old n8n templates but require archival copies.
Anyone needing a centralized, documented process for managing the lifecycle of an n8n workflow.
DevOps teams utilizing n8n for system management and needing cleanup automation.

Overview

Managing a large collection of n8n workflows can lead to clutter, potentially impacting performance and increasing administrative overhead. This robust n8n workflow template solves this problem by providing a secure and automated process for retiring workflows. When triggered, the automation ensures that the complete JSON definition of the target n8n workflow is backed up to Google Drive before it is permanently deleted from the n8n instance using the official n8n API.

This system transforms workflow management from a manual, error-prone task into a streamlined, automated process. Every step, from the initial n8n trigger to the final deletion, is tracked and confirmed with a Telegram notification, ensuring data preservation and maximizing the efficiency of your n8n environment. This is a critical tool for maintaining a clean and optimized n8n setup.

How it Works

This automation is initiated by an easily accessible form, making it simple for any user to retire an old n8n workflow.


  1. Trigger via Form Submission: The n8n workflow starts with an 'On form submission' n8n trigger. The user submits the full URL of the n8n workflow they wish to archive and delete.

  2. Retrieve Workflow Details: The 'Get a Workflow' n8n node utilizes the n8n API (via an API Key credential) to fetch the entire configuration and data of the specified n8n workflow using its ID, which is extracted from the submitted URL.

  3. JSON to File Conversion: A pivotal Code n8n node processes the retrieved workflow JSON. It converts the raw JSON data into a properly formatted, dynamically named binary .json file, ready for cloud storage.

  4. Google Drive Backup: The 'Upload Workflow' Google Drive n8n node takes the binary file and uploads it to a pre-defined backup folder in Google Drive. This completes the essential backup phase of the n8n workflow.

  5. Safe Deletion: The 'Delete a Workflow' n8n node then executes the deletion command against the n8n API, permanently removing the specified n8n workflow from the instance using its ID.

  6. Confirmation: Finally, the Telegram n8n node sends a confirmation message, detailing the name and ID of the n8n workflow that was successfully backed up and deleted, providing the user with peace of mind.

Installation Guide

To deploy and utilize this n8n workflow template, follow these steps:


  1. Import the JSON: Copy the provided n8n workflow JSON into your n8n instance via the 'Workflows' > 'New' > 'Import from JSON' option.

  2. n8n API Credentials Setup: You must configure an API Key credential for the n8n nodes ('Get a Workflow' and 'Delete a Workflow'). This credential requires your personal n8n API Key and your instance's Base URL (e.g., https://your-n8n-instance.com/api/v1). This is crucial for controlling the n8n workflow lifecycle.

  3. Google Drive Setup: Configure your Google Drive credentials (preferably using a Service Account) and update the 'Upload Workflow' n8n node to point to your specific target folder ID where the backup files should be stored.

  4. Telegram Configuration: Set up your Telegram Bot credentials and input your chatId in the 'Send a text message' n8n node to receive notifications.

  5. Activate: Once all credentials are set up, activate the n8n workflow. Access the URL provided by the initial 'On form submission' n8n trigger to start using the automation.

Node Details

On form submission (n8n trigger):
Function: Serves as the interactive n8n trigger, collecting the necessary input (the full workflow URL) from the user.
Key Configuration: Configured to accept a single text field labeled 'Paste the full workflow URL below.'
Get a Workflow (n8n node):
Function: Communicates with the n8n API to retrieve the full JSON schema of the specified n8n workflow before deletion.
Key Configuration: Operation set to Get; Workflow ID is dynamically set using the URL input from the form.
JSON to File (Code n8n node):
Function: Converts the raw JSON data of the n8n workflow into a binary buffer with the MIME type application/json, preparing it for file storage. It dynamically creates a safe filename.
Key Configuration: Uses JavaScript to stringify the workflow JSON and prepare binary data.
Upload Workflow (Google Drive n8n node):
Function: Executes the backup action by uploading the binary workflow file to the designated Google Drive folder.
Key Configuration: Uses binary property data; Folder ID is a static ID referencing the backup location.
Delete a Workflow (n8n node):
Function: Performs the destructive action, securely deleting the specified n8n workflow from the instance via the API.
Key Configuration: Operation set to Delete; Workflow ID is referenced from the data gathered by the 'Get a Workflow' n8n node.
Send a text message (Telegram n8n node):
Function: Provides confirmation and audit trail by notifying the administrator about the completed backup and deletion of the n8n workflow.
Key Configuration: Dynamically includes the workflow name and ID in the success message.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

👋 Hi! I'm Arlin - a QA Engineer with 2 years of experience and a background in Dart & Flutter for mobile app development. ⚙️ I'm passionate about automation and love building efficient workflows using n8n. 📬 Reach out for any help with custom workflows

Featured*