Backup and Delete Workflows to Google Drive with n8n API and Form Trigger
π Description: Effortlessly delete unused or inactive workflows from your n8n instance while automatically backing them up as .json files into your Google Drive. Keep your instance clean, fast, and organized β no more clutter slowing you down. This workflow is ideal for users managing large self-hosted n8n setups, or anyone who wants to maintain optimal performance while preserving full workflow backups.
β What it does: Accepts a full n8n Workflow URL via a form Retrieves workflow info automatically Converts the workflowβs full JSON definition into a file Uploads that file to Google Drive Deletes the workflow safely using the official n8n API Sends a Telegram notification confirming backup and deletion
βοΈ How it works: π Form β Collects the full workflow URL from the user π n8n Node (Get Workflow) β Uses the URL to fetch workflow details π¦ Code Node ("JSON to File") β Converts the workflow JSON into a properly formatted .json file with UTF-8 encoding, ready to be uploaded to Google Drive. βοΈ Google Drive Upload β Uploads the .json backup file to your selected Drive folder ποΈ n8n Node (Delete Workflow) β Deletes the workflow from your instance using its ID π¬ Telegram Notification β Notifies you that the workflow was backed up and deleted, showing title, ID, and date
π Requirements: Google Drive connected to your n8n account Telegram Bot connected to n8n An n8n instance with API access (self-hosted or Cloud) Your n8n API Key (Create one in the settings)
π οΈ How to Set Up: β Add your Google Drive credentials β Add your Telegram Bot credentials
π§Ύ In the βJSON to Fileβ Code node, no additional setup is required β it automatically converts the workflow JSON into a downloadable .json file using the correct encoding and filename format.
βοΈ In the Google Drive node: Binary Property: data Folder ID: your target folder in Google Drive
π Create a new credential for the n8n node using: API Key: your personal n8n API key Base URL: your full n8n instance API path (e.g. https://your-n8n-instance.com/api/v1) βοΈ Use this credential in both the Get Workflow and Delete Workflow n8n nodes
π¬ In the Telegram node, use this message template: ποΈ Workflow "{{ $json.name }}" (ID: {{ $json.id }}) was backed up to Google Drive and deleted from n8n. π {{ $now }}
π Important: This workflow backs up the entire workflow data to Google Drive. Please be careful with the permissions of your Google Drive folder and avoid sharing it publicly, as the backups may contain sensitive information. Ensuring proper security and access control is essential to protect your data.
π Activate the workflow and you're ready to safely back up and remove workflows from your n8n instance
Related Templates
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
Send structured logs to BetterStack from any workflow using HTTP Request
Send structured logs to BetterStack from any workflow using HTTP Request Who is this for? This workflow is perfect for...
Automate Daily Keyword Research with Google Sheets, Suggest API & Custom Search
Who's it for This workflow is perfect for SEO specialists, marketers, bloggers, and content creators who want to automa...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments