← All N8N workflows
Automation & utilitiesCodeFilterGoogle DriveIfItem Lists

get Google Drive folders

Configured with Filter, Google Drive, Item Lists, Move Binary Data, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TransformMove Binary DataMove Binary DataRoutingIGNORE FILESFilterFiles / mediaCreate n8n_backupsGoogle DriveFiles / mediaCreate n8n_oldGoogle DriveFiles / mediaGET CURRENT FOLDERGoogle DriveCodeCodeCodeRoutingIf n8n_oldIfRoutingIf1 n8n_backupsIfFiles / mediaGET CURRENT FOLDERCREATESGoogle DriveTransformMerge mensageMergeFiles / mediaGET CURRENT BACKUPS1Google DriveFiles / mediaMOVE INTO OLD FOLDERGoogle DriveFiles / mediaUPLOAD WORKFLOWSGoogle DriveTransformItem ListsItem ListsRoutingSplit In Batches2Loop Over ItemsRoutingSplit In BatchesLoop Over ItemsIntegrationn8nN8NFiles / mediaLIST OLD BACKUPSGoogle DriveFiles / mediaDELETE OLD BACKUPGoogle DriveTransformItem Lists oldItem ListsRoutingSplit In Batches oldLoop Over ItemsTriggerSchedule TriggerSchedule TriggerTriggerSchedule Trigger1Schedule Trigger

Node categories in this workflow

  • Transform
  • Routing
  • Files / media
  • Code
  • Integration
  • Trigger

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Move Binary DataTransformMove Binary DataSee node parameters
IGNORE FILESRoutingFilterSee node parameters
Create n8n_backupsFiles / mediaGoogle Drivefolder
Create n8n_oldFiles / mediaGoogle Drivefolder
GET CURRENT FOLDERFiles / mediaGoogle DrivefileFolder
CodeCodeCodeSee node parameters
If n8n_oldRoutingIfSee node parameters
If1 n8n_backupsRoutingIfSee node parameters
GET CURRENT FOLDER CREATESFiles / mediaGoogle DrivefileFolder
Merge mensageTransformMergeSee node parameters
GET CURRENT BACKUPS1Files / mediaGoogle DrivefileFolder
MOVE INTO OLD FOLDERFiles / mediaGoogle Drivemove
UPLOAD WORKFLOWSFiles / mediaGoogle DriveSee node parameters
Item ListsTransformItem ListsSee node parameters
Split In Batches2RoutingLoop Over ItemsSee node parameters
Split In BatchesRoutingLoop Over ItemsSee node parameters
n8nIntegrationN8NSee node parameters
LIST OLD BACKUPSFiles / mediaGoogle DrivefileFolder
DELETE OLD BACKUPFiles / mediaGoogle DrivedeleteFile
Item Lists oldTransformItem ListsSee node parameters
Split In Batches oldRoutingLoop Over ItemsSee node parameters
Schedule TriggerTriggerSchedule TriggerSee node parameters
Schedule Trigger1TriggerSchedule TriggerSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googleDriveOAuth2Api
  • n8nApi

Workflow notes

Sticky Note

MOVE CURRENT BACKUPS TO OLD FOLDER

Sticky Note2

PURGE BACKUPS OLDER THEN 30 DAYS

Ignore any other folders other than: n8n_backups

Ignore any other folders other than: n8n_backups

(it is important that you created this folder)
Contact me

Contact me

By Mail. Send Mail

Since the folder does not exist, it creates a new one.

Since the folder does not exist, it creates a new one.

n8n_backups n8n_old

Description

Description

This template creates a nightly backup of all n8n workflows and saves them to a GitHub folder. Each night, the previous night's backups are moved to an “n8n_old” folder and renamed with the corresponding date.

Backups older than a specified age are automatically deleted (this feature is active for 30 days, you can remove it if you don't want the backups to be deleted).

Prerequisites

  • Google Drive account and credentials Get from the following link. Link
  • n8n version 1.67.1 or higher
  • N8n api key Guide from the following link. Link
  • A destination folder for backups: “n8n_old” “n8n_backups” (if it doesn't exist, create it)

Configuration

Update all Google Drive nodes with your credentials. Edit the Schedule Trigger node with the desired time to run the backup. If you want to automatically purge old backups.

Edit the “PURGE DAYS” node to specify the age of the backups you want to delete. Enable the “PURGE DAYS” node and the 3 subsequent nodes. Enable the workflow to run on the specified schedule.

Bug fixes v3:

Bug fixes v3:

  • Fixed move section now detects more than 13 files and moves them to n8n_old folder
  • Changed file filtering
  • In the next version "Split In Batches" will be changed to "Loop Over Items"
Sticky Note1

BACKUP ALL CURRENT WORKFLOWS limit 100 (Change)

get Google Drive folders

get Google Drive folders

Purpose and structure

This folder contains the get Google Drive folders workflow. Its executable nodes use code, filter, googleDrive, if, itemLists, merge, moveBinaryData, n8n, scheduleTrigger, splitInBatches. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Schedule Trigger, Schedule Trigger1

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/0605_Code_Itemlists_Create_Scheduled.json MIT; preserve source notices.

Canvas section labels

These name areas of the original canvas; they do not include explanatory instructions.

  • get Google Drive folders
  • Does a folder exist?, if it does not exist it creates it

More in Automation & utilities