// free agents / n8n-error-alert-and-backup

🚨 n8n error alert + nightly backup

“Tell me on Discord the moment any n8n workflow fails, and back up all my workflows to git every night.”

Free, no sign-up. MIT licence. Python standard library only, so there's nothing to pip install.

What it does

Two safety nets for self-hosted n8n. Alerts: an error workflow posts the workflow name, failing node, error message and a link to Discord (or the Python script checks for failed executions and alerts Discord or email). Backup: every night all workflows are exported through the n8n API; the Python version commits them to a git repo and pushes it to GitHub or anywhere else.

What you need

5-minute setup

Python

  1. Install Python 3.9+ and unzip the download.
  2. Try it with no accounts: python3 n8n_backup_and_alert.py backup --dry-run
  3. Copy .env.example to .env and fill it in.
  4. Run: set -a; . ./.env; set +a; python3 n8n_backup_and_alert.py (Windows steps in the README).

n8n (no code)

  1. Workflows, then Import from file, then n8n-error-alert-and-backup.n8n.json.
  2. Follow the yellow “Read me” note (credentials or webhook).
  3. Test workflow, then switch it to Active.

Run it on a schedule

Backup every night at 02:00 (add a second line with `check` instead of `backup`, every 10 minutes, for failure alerts) with cron:

0 2 * * * cd /path/to/n8n-error-alert-and-backup && set -a && . ./.env && set +a && python3 n8n_backup_and_alert.py backup >> run.log 2>&1

On Windows use Task Scheduler. With n8n, the Schedule node does it for you.

Settings

VariableWhat it does
N8N_URL / N8N_API_KEYe.g. http://localhost:5678 and your API key
BACKUP_DIRGit folder for the backups, default ./n8n-backup (add a remote to push)
DISCORD_WEBHOOK_URLAlerts to Discord
SMTP_HOST / SMTP_USER / SMTP_PASSWORD / EMAIL_TOOptional: alerts by email

What we tested

Honest limits

Related guides

Want one built for your task?

Describe it in one sentence. We build it, test it and email it to you, usually within 24h. Free while we're in beta.

We'll only email you about your agent and TaskToAgent.