Back up n8n workflows to google drive while preserving folder structure
n8n login API1
get subfolder(s) structure
Merge
Search if folder already exists
googleDrive
if folder not found => create it
Attach the parentFolder if any
if parentFolder empty
Create folder under the parentFolder
googleDrive
Split Out3
splitOut
Merge1
Merge2
wf_id + wf_name
root folder : backup_n8n
Merge3
Merge6
Aggregate3
aggregate
Split Out1
splitOut
Remove Duplicates
removeDuplicates
rename fields
rename fields1
rename main_root_folder fields
Create folder under the static "backup_n8n" folder
googleDrive
rename fields2
rename fields3
get directParentFolderName
Split root vs subfolders
Merge4
Remove Duplicates1
removeDuplicates
rename fields4
rename fields5
rename fields6
If there parentFolder.isEmpty()
Remove Duplicates2
removeDuplicates
Merge5
rename fields7
Upload file to its folder
googleDrive
root folder : backup_n8n1
If parentFolder is null
If resource == "folder"
Define & assign folder's fullPath value
get all workflows
extract each workflow
splitOut
Create backup folder "n8n_backup_folder_structure_ddMMyyyy_HHmmss"
googleDrive
Sort to get root folders first
sort
define full_path length
One run per folder
noOp
get all workflows1
keep only workflows not archived
filter
keep only workflows not archived1
filter
add wf_folder_name
remove the [] wrapper to re-create imported wf later
n8n-auth for n8n API
Convert workflow to JSON file
noOp
Upload file to gdrive main root folder
googleDrive
n8n instance/project access details
create n8n table "folders"
create n8n table "workflows"
"folders" table columns list
"workflows" table columns list
get projectId
add columns to "folders" table
add columns to "workflows" table
get all folders2
noOp
add backup_folder google_id to "folders"
noOp
Add data about folder : google_folder_id1
noOp
get parent_google_folderid value
noOp
get all folders1
noOp
parentFolder
noOp
Upsert row(s)4
noOp
Upsert row(s)5
noOp
Get row(s)3
noOp
get main root folder details1
noOp
get related folder details1
noOp
add workflow file and folder google IDs2
noOp
add workflow file and folder google IDs
noOp
Add data about folder : google_folder_id
noOp
exclude field "id"
Purge data in "folders"
noOp
Insert data into table "folders"
noOp
Get all folders
noOp
Insert "full_path" value for each folder
noOp
Match workflow with folder details
noOp
Insert workflow details into "workflows" table
noOp
Get the parentFolderName if it exists
noOp
get parentFolderId if it exists
Get each workflow JSON data
GET each workflow JSON data
Aggregate
aggregate
Insert one row in "folders" for the main_root_backup_folder
noOp
get n8n table "id"
Split Out
splitOut
get n8n table "id"1
Split Out2
splitOut
Filter on "folders" table
filter
Filter on "workflows" table
filter
Purge data in "workflows"
noOp
Loop Over Items
noOp
one item per workflow at main_root_folder
Create gsheet "workflows_folders_backup_details"
googleSheets
Move file to backup drive folder
googleDrive
folders details
noOp
workflows details
noOp
Get "main_root_folder_google_folder_id"
noOp
Copy data to sheet "workflows"
googleSheets
Copy data to sheet "folders"
googleSheets
n8n login API2
create n8n table "folders_restore_backup"
"folders_restore_backup" table columns list
add columns to "folders_restore_backup" table
Filter on "folders_restore_backup" table
filter
Purge data in "folders_restore_backup"
noOp
Insert data into table "folders_restore_backup"
noOp
fullPath length1
Filter
filter
Aggregate1
aggregate
Attach the parentFolder if any1
if parentFolder empty1
One run per folder1
noOp
Get the parentFolderName if it exists2
noOp
get parentFolderId if it exists1
Get the parentFolderName if it exists3
noOp
Merge7
create n8n folder3
Upsert row(s)3
noOp
create n8n folder4
add "active" key to JSON : mandatory1
create main backup n8n folder
Create workflow JSON file into backup n8n folder
Get row(s) in sheet
googleSheets
exclude "main_root_backup_folder"
filter
Search for the backup folder in Drive
googleDrive
Get related gsheet "workflows_folders_backup_details"
googleDrive
Order by full_path length ASC
sort
Get all n8n folders from the backup
googleSheets
Get workflows details
googleSheets
Get folders_restore_backup details
noOp
Download JSON wf files
googleDrive
Extract JSON from files
noOp
exclude some fields before create workflow
rename fields8
n8n-auth for n8n API1
n8n instance/project access details1
get projectId1
get n8n table "id"2
Split Out4
splitOut
rename fields9
rename fields10
rename fields11
Upsert row(s)
noOp
Merge8
Remove Duplicates3
removeDuplicates
Aggregate4
aggregate
Restore workflows trigger
Backup workflows scheduler
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.