AutomationFlowsWeb Scraping › Automated Hydra Database Backup

Automated Hydra Database Backup

Original n8n title: Hydra Database Backup

Hydra Database Backup. Uses ssh, httpRequest. Scheduled trigger; 9 nodes.

Cron / scheduled trigger★★★★☆ complexity9 nodesSshHTTP Request
Web Scraping Trigger: Cron / scheduled Nodes: 9 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Hydra Database Backup",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 2 * * *"
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Daily at 2 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "command": "docker exec hydra-postgres pg_dumpall -U hydra | gzip > /mnt/user/backups/postgres/pg_dump_$(date +%Y%m%d_%H%M%S).sql.gz && echo 'PostgreSQL backup complete'",
        "options": {
          "timeout": 300000
        }
      },
      "id": "backup-postgres",
      "name": "Backup PostgreSQL",
      "type": "n8n-nodes-base.ssh",
      "typeVersion": 1,
      "position": [
        220,
        -150
      ],
      "continueOnFail": true,
      "credentials": {
        "sshPassword": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "http://192.168.1.244:6333/snapshots",
        "method": "POST",
        "options": {
          "timeout": 120000
        }
      },
      "id": "backup-qdrant",
      "name": "Snapshot Qdrant",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        220,
        0
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "command": "docker exec hydra-redis redis-cli BGSAVE && sleep 5 && cp /mnt/user/appdata/redis/dump.rdb /mnt/user/backups/redis/redis_$(date +%Y%m%d_%H%M%S).rdb && echo 'Redis backup complete'",
        "options": {
          "timeout": 60000
        }
      },
      "id": "backup-redis",
      "name": "Backup Redis",
      "type": "n8n-nodes-base.ssh",
      "typeVersion": 1,
      "position": [
        220,
        150
      ],
      "continueOnFail": true,
      "credentials": {
        "sshPassword": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "command": "find /mnt/user/backups/postgres -name '*.sql.gz' -mtime +7 -delete; find /mnt/user/backups/redis -name '*.rdb' -mtime +7 -delete; echo 'Cleanup complete'",
        "options": {
          "timeout": 30000
        }
      },
      "id": "cleanup-old",
      "name": "Cleanup Old Backups",
      "type": "n8n-nodes-base.ssh",
      "typeVersion": 1,
      "position": [
        440,
        0
      ],
      "continueOnFail": true,
      "credentials": {
        "sshPassword": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const postgres = $('Backup PostgreSQL').first();\nconst qdrant = $('Snapshot Qdrant').first();\nconst redis = $('Backup Redis').first();\nconst cleanup = $('Cleanup Old Backups').first();\n\nconst results = {\n  timestamp: new Date().toISOString(),\n  postgresql: {\n    success: !postgres.error,\n    message: postgres.json?.stdout || postgres.error?.message || 'unknown'\n  },\n  qdrant: {\n    success: !qdrant.error,\n    snapshot_name: qdrant.json?.name || 'failed'\n  },\n  redis: {\n    success: !redis.error,\n    message: redis.json?.stdout || redis.error?.message || 'unknown'\n  },\n  cleanup: {\n    success: !cleanup.error,\n    message: cleanup.json?.stdout || cleanup.error?.message || 'unknown'\n  }\n};\n\nconst allSuccess = results.postgresql.success && results.qdrant.success && results.redis.success;\nresults.overall_status = allSuccess ? 'success' : 'partial_failure';\n\nreturn [{ json: results }];"
      },
      "id": "summarize",
      "name": "Summarize Results",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        660,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.overall_status }}",
              "operation": "notEquals",
              "value2": "success"
            }
          ]
        }
      },
      "id": "check-failure",
      "name": "Any Failures?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        880,
        0
      ]
    },
    {
      "parameters": {
        "url": "={{ $env.DISCORD_WEBHOOK_URL }}",
        "method": "POST",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "content",
              "value": "=\u274c **Hydra Backup Alert**\\n\\nDatabase backup completed with failures:\\n- PostgreSQL: {{ $json.postgresql.success ? '\u2705' : '\u274c' }}\\n- Qdrant: {{ $json.qdrant.success ? '\u2705' : '\u274c' }}\\n- Redis: {{ $json.redis.success ? '\u2705' : '\u274c' }}\\n\\nCheck logs for details."
            }
          ]
        },
        "options": {}
      },
      "id": "alert-failure",
      "name": "Alert Backup Failure",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        1100,
        -100
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "message",
              "value": "All database backups completed successfully"
            }
          ]
        }
      },
      "id": "log-success",
      "name": "Log Success",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        1100,
        100
      ]
    }
  ],
  "connections": {
    "Daily at 2 AM": {
      "main": [
        [
          {
            "node": "Backup PostgreSQL",
            "type": "main",
            "index": 0
          },
          {
            "node": "Snapshot Qdrant",
            "type": "main",
            "index": 0
          },
          {
            "node": "Backup Redis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup PostgreSQL": {
      "main": [
        [
          {
            "node": "Cleanup Old Backups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Snapshot Qdrant": {
      "main": [
        [
          {
            "node": "Cleanup Old Backups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup Redis": {
      "main": [
        [
          {
            "node": "Cleanup Old Backups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cleanup Old Backups": {
      "main": [
        [
          {
            "node": "Summarize Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Results": {
      "main": [
        [
          {
            "node": "Any Failures?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Any Failures?": {
      "main": [
        [
          {
            "node": "Alert Backup Failure",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false,
  "versionId": "1"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Hydra Database Backup. Uses ssh, httpRequest. Scheduled trigger; 9 nodes.

Source: https://github.com/Dirty13itch/hydra/blob/66c6456704def5d441d49aa654a6dbb6c1c02865/n8n-workflows/database-backup.json — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

N8N-Self-Updater. Uses ssh, emailSend, httpRequest. Scheduled trigger; 27 nodes.

Ssh, Email Send, HTTP Request
Web Scraping

&gt; An automated n8n workflow originally built for DigitalOcean-based n8n deployments, but fully compatible with any VPS or cloud hosting (e.g., AWS, Google Cloud, Hetzner, Linode, etc.) where n8n ru

Ssh, Email Send, HTTP Request
Web Scraping

This template is designed to automatically clean up old image tags in the Docker registry and perform garbage collection. List all images in the registry Preserve the last 10 tags for each image (late

HTTP Request, Email Send, Ssh
Web Scraping

W09 — Backup Verification. Uses ssh, httpRequest. Scheduled trigger; 7 nodes.

Ssh, HTTP Request
Web Scraping

This workflow automatically checks if the local n8n version is outdated and, if so, creates a file to signal an update is needed. Operating System: Ubuntu 24.04 n8n Installation: Docker container

HTTP Request, Ssh