Skip to main content

Automated Workflow Backup System with Google Drive, Gmail and Discord Alerts'

Workflow preview

Workflow preview
100%
Automated Workflow Backup System with Google Drive, Gmail and Discord Alerts' preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

How it works This workflow automates the backup of all your n8n workflows to a specified Google Drive folder. It operates in two main phases: 1. Orchestration (Scheduled Task): The workflow is init...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.n8n, n8n-nodes-base.googledrive, n8n-nodes-base.splitinbatches, n8n-nodes-base.if, n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.limit

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by HoChien Chang.

Original n8n.io source

1.1 Workflow description

Title
Automated Workflow Backup System with Google Drive, Gmail and Discord Alerts'
Workflow name
Automated Workflow Backup System with Google Drive, Gmail and Discord Alerts'

How it works

This workflow automates the backup of all your n8n workflows to a specified Google Drive folder. It operates in two main phases:

  1. Orchestration (Scheduled Task):

    • The workflow is initiated by a Schedule Trigger (e.g., daily at 1:30 AM by default).
    • It then uses an n8n API Node to fetch a list of all existing workflows in your n8n instance.
    • A Loop Over Items node processes each fetched workflow individually.
    • For every workflow in the list, an Execute Workflow node calls the "worker" part of this same workflow, passing the individual workflow's data.
  2. Individual Workflow Backup (Worker Task):

    • This part is triggered by the When Executed by Another Workflow node (called by the orchestrator part).
    • It first retrieves the passed workflow data.
    • A Parameters node defines the target Google Drive directory.
    • The Get Google Drive File Data node searches the specified Google Drive folder to see if a backup file for the current workflow (named as WorkflowName_WorkflowID.json) already exists.
    • An IF Node (ifDriveEmpty) checks the result:
      • If a backup file exists, the workflow data is converted to a binary JSON file using a Code Node, and then the existing file on Google Drive is updated (Backup to Google Drive2).
      • If a backup file does not exist, the workflow data is first formatted as JSON, converted to a binary JSON file using another Code Node, and then uploaded as a new file to Google Drive (Backup to Google Drive4).
    • If any Google Drive upload/update operation fails, a Failure Email is sent.

After the loop in the orchestration phase completes (all workflows processed), a Limit node ensures only one signal proceeds to send a Success Email and a Discord message indicating the overall backup process was completed.

Setup

  1. Clone Workflow: Clone this workflow into your n8n environment.
  2. Credentials:
    • n8n API: In the "Get all n8n Workflows" node, select or create n8n API credentials. This allows the workflow to list all your other workflows.
    • Google Drive: In the "getDriveFileData", "Backup to Google Drive2", and "Backup to Google Drive4" nodes, select or create your Google Drive OAuth2 API credentials.
    • Gmail: In the "successEmail" and "failureEmail" nodes, select or create your Gmail credentials.
    • Discord (Optional): If you wish to use Discord notifications, configure your Discord Bot API credentials in the "Discord" node.
  3. Configuration:
    • Schedule: Open the "Schedule Trigger" node and adjust the trigger interval (e.g., time of day) as needed.
    • Google Drive Folder: Open the "Parameters" node (connected after "Workflow Data"). Edit the directory value to the full URL of the Google Drive folder where you want to store your backups (e.g., https://drive.google.com/drive/folders/YOUR_FOLDER_ID).
    • Email Recipients: Open the "successEmail" and "failureEmail" nodes and update the "Send To" field with your desired recipient email address(es).
    • Discord Channel (Optional): If using Discord, open the "Discord" node and set the "Channel ID" for notifications.
    • Sub-Workflow ID: The "Execute Workflow" node is pre-configured to call this workflow itself using its ID. If you import this workflow and its ID changes, you may need to update the workflowId in the "Execute Workflow" node to the new ID of this imported workflow. However, n8n usually handles this if it's self-referential within the same imported workflow.

How to use

  1. Activate: After completing the setup steps, activate the workflow. It will automatically run according to the defined schedule.
  2. Manual Execution: You can also manually trigger the workflow by clicking the "Execute Workflow" play button on the "Schedule Trigger" node to perform an immediate backup of all workflows.
  3. Check Backups: Your n8n workflows will be saved as .json files (named WorkflowName_WorkflowID.json) in the Google Drive folder you specified in the "Parameters" node.
  4. Notifications: You will receive an email (and optionally a Discord message) upon successful completion of the entire backup process, or individual failure emails if a specific workflow backup to Google Drive fails.

Author & Credits


1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Get all n8n Workflows

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 3 - Backup to Google Drive2

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 4 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 5 - Backup to Google Drive4

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 6 - ifDriveEmpty

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 7 - firstWorkflowJson

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - JsonToFile

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - CodeJsonToFile1

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Limit

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 11 - Workflow Data

Type / Role
n8n-nodes-base.executionData - executionData
Config choices
Version 1

Block 12 - successEmail

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 13 - failureEmail

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 14 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - getDriveFileData

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 17 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 18 - Execute Workflow

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1.2

Block 19 - Parameters

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Discord

Type / Role
n8n-nodes-base.discord - discord
Config choices
Version 2

Block 23 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 29 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Automated Workflow Backup System with Google Drive, Gmail and Discord Alerts'
Complexity advanced
Nodes 29
Categories DevOps
Author HoChien Chang
Published 29 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3787/3787.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated Workflow Backup System with Google Drive, Gmail and Discord Alerts' do?

How it works This workflow automates the backup of all your n8n workflows to a specified Google Drive folder. It operates in two main phases: 1. Orchestration (Scheduled Task): The workflow is init...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.