n8n
Workflow
Git Backup Of Workflows And Credentials
This n8n workflow backs up tasks and integrates with various services. Git Backup Of Workflows And Credentials - ready to import and run in your n8n instance.
n8n
workflow.json
About This Script
This n8n workflow backs up tasks and integrates with various services. Git Backup Of Workflows And Credentials - ready to import and run in your n8n instance.
Features:
- Scheduled automation with cron triggers
Source Code
{
"nodes": [
{
"name": "On clicking 'execute'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
250,
400
],
"parameters": [],
"typeVersion": 1,
"id": "6ba0bbc6-8f23-4190-92de-74a613e4da0c"
},
{
"name": "Export Workflows",
"type": "n8n-nodes-base.executeCommand",
"position": [
450,
300
],
"parameters": {
"command": "npx n8n export:workflow --backup --output repo/workflows/"
},
"typeVersion": 1,
"id": "6879a1ba-ba01-4606-9f3b-e83884e2056c"
},
{
"name": "Export Credentials",
"type": "n8n-nodes-base.executeCommand",
"position": [
600,
300
],
"parameters": {
"command": "npx n8n export:credentials --backup --output repo/credentials/"
},
"typeVersion": 1,
"id": "c13e9c9c-c97c-46d0-ab1f-fca45cd2e16f"
},
{
"name": "git add",
"type": "n8n-nodes-base.executeCommand",
"position": [
750,
300
],
"parameters": {
"command": "git -C repo add ."
},
"typeVersion": 1,
"id": "2121732b-9be6-4ddd-a9bc-ccde0c5d94c4"
},
{
"name": "git commit",
"type": "n8n-nodes-base.executeCommand",
"position": [
900,
300
],
"parameters": {
"command": "=git -C repo commit -m \"Auto backup ({{ new Date().toISOString() }})\""
},
"typeVersion": 1,
"id": "28ffa95d-eb86-45bc-baa8-d61f88015f0f"
},
{
"name": "git push",
"type": "n8n-nodes-base.executeCommand",
"position": [
1050,
300
],
"parameters": {
"command": "git -C repo push"
},
"typeVersion": 1,
"id": "29fb3b4f-2cec-4b27-81fe-eb3c746c36fc"
},
{
"name": "Cron",
"type": "n8n-nodes-base.cron",
"position": [
250,
200
],
"parameters": {
"triggerTimes": {
"item": [
{
"hour": 0
},
{
"hour": 12
},
{
"hour": 6
},
{
"hour": 18
}
]
}
},
"typeVersion": 1,
"id": "35871514-3315-4eea-b616-1073bb740ce7"
}
],
"connections": {
"Cron": {
"main": [
[
{
"node": "Export Workflows",
"type": "main",
"index": 0
}
]
]
},
"git add": {
"main": [
[
{
"node": "git commit",
"type": "main",
"index": 0
}
]
]
},
"git commit": {
"main": [
[
{
"node": "git push",
"type": "main",
"index": 0
}
]
]
},
"Export Workflows": {
"main": [
[
{
"node": "Export Credentials",
"type": "main",
"index": 0
}
]
]
},
"Export Credentials": {
"main": [
[
{
"node": "git add",
"type": "main",
"index": 0
}
]
]
},
"On clicking 'execute'": {
"main": [
[
{
"node": "Export Workflows",
"type": "main",
"index": 0
}
]
]
}
},
"n8n_version": "1.5.0"
}
Requirements
n8n instance, API credentials for connected services
Tags
#n8n
#automation
#workflow