n8n

How to Automate Daily n8n Backups to Google Drive with 7-Day Cleanup and Telegram Alerts?

Back up your n8n workflows to Google Drive every day without extra work. The system creates a dated folder, saves each workflow as a JSON file, keeps only the latest seven days, and sends a Telegram alert with the folder link. It is a simple way to protect your automations and keep storage tidy.

Runs on a daily schedule or by manual start. It stamps the current time, creates a new Google Drive folder, pulls your workflows from the n8n API, and caps the batch at 200 items. Each workflow is turned into a JSON file and uploaded using a loop that processes one file at a time. A search step finds existing backup folders, a code step flags folders older than seven days, and the delete step removes them from Drive. A final message posts the date, folder name, and link in Telegram.

Setup needs Google Drive access, a Telegram bot with a chat ID, and an n8n API credential. Expect clear daily backups, space saved by auto cleanup, and faster restore because files are ready to import. Great for teams that manage many workflows and want repeatable, low effort backups.

What are the key features?

  • Run backups on a daily schedule or on demand with a manual start
  • Create a timestamped folder in Google Drive for each run
  • Fetch workflows from the n8n API and limit to 200 items
  • Convert each workflow to a JSON file and upload it to Drive
  • Loop through items in batches to control file processing
  • Search existing backup folders by name to manage history
  • Use a code step to find folders older than seven days
  • Delete old folders permanently in Google Drive to free space
  • Send a Telegram message with the date, folder name, and link

What are the benefits?

  • Reduce manual export work from 30 minutes to 2 minutes per day
  • Automate 100 percent of backup tasks with scheduled runs
  • Keep storage clean by removing folders older than 7 days
  • Handle up to 200 workflows per run without manual effort
  • Get instant Telegram alerts with the backup folder link
  • Speed up recovery with ready to import JSON files

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Drive, Telegram and n8n. See the Tools Required section above for links to create accounts with these services.
  3. Open any Google Drive node, click the Credential to connect with dropdown, select Create new credential, and follow the steps to sign in to Google Drive. Grant permission to create, upload, search, and delete files and folders.
  4. Open the Get Workflows node, click the credential dropdown, select Create new credential for the n8n API, and follow the on screen steps. In n8n Cloud, create a personal access token and enter the base URL and token when prompted.
  5. Create a Telegram bot with BotFather and copy the bot token. Open the Telegram node, click the credential dropdown, select Create new credential, and paste the bot token.
  6. Set your Telegram chat ID as an environment variable named TELEGRAM_CHAT_ID in n8n Cloud. Then confirm the Telegram node uses {{ $env.TELEGRAM_CHAT_ID }} in the chatId field.
  7. Open the Schedule Trigger and set the time you want the backup to run each day. Save the workflow.
  8. Check the Create Folder and Save File nodes and confirm the target Drive and folder path are correct for your account.
  9. Optional: Open the Limit node and adjust the maximum number of workflows if you need more or fewer items processed.
  10. Optional: Open the code step that finds folders to delete and adjust the days to keep if you want a retention period different from seven days.
  11. Run a manual test. Confirm a new timestamped folder appears in Google Drive and that JSON files are inside. Verify you receive a Telegram message with the folder link.
  12. If errors appear, check Google Drive permissions, confirm the n8n API base URL and token are valid, and make sure the Telegram bot can message your chat. Review node logs for details.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

n8n API

Sign up

Community Edition (self-hosted): $0 (public REST API available). Cloud Starter: $20 / mo billed annually ($24 monthly); API unavailable during free trial.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.