Templates / Back up databases and files to Box with Mailgun email notifications

Back up databases and files to Box with Mailgun email notifications

Needs changes

by vinci-king-01 ✓ · 96 views · created 2026-02-08 · DevOps

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: Convert to/from binary data. 1 breaking item(s) found. Static check, last run 2026-10-19.

What to replace before upgrading

Removed in 3.0Replace with
Convert to/from binary data
Prepare File for Box
Convert to File or Extract from File

Nodes used (9)

BoxMailgun

What it does

Scheduled Backup Automation – Mailgun & Box This workflow automatically schedules, packages, and uploads backups of your databases, files, or configuration exports to Box cloud storage, then sends a completion email via Mailgun. It is ideal for small-to-medium businesses or solo developers who want hands-off, verifiable backups without writing custom scripts. Pre-conditions/Requirements Prerequisites - n8n instance (self-hosted or n8n.cloud) - Box account with a folder dedicated to backups - Mailgun account & verified domain - Access to the target database/server you intend to back up - Basic knowledge of environment variables to store secrets Required Credentials - Box OAuth2 – For uploading the backup file(s) - Mailgun API Key – For sending backup status notifications - (Optional) Database Credentials – Only if the backup includes a DB dump triggered from inside n8n Specific Setup Requirements | Variable | Example | Purpose | |-------------------------|------------------------------------------|---------------------------------------| | BOXFOLDERID | 1234567890 | ID of the Box folder that stores backups | | MAILGUNDOMAIN | mg.example.com | Mailgun domain used for sending email | | MAILGUNFROM | Backups <backup@mg.example.com> | “From” address in status emails | | NOTIFYEMAIL | admin@example.com | Recipient of backup status emails | How it works This workflow automatically schedules, packages, and uploads backups of your databases, files, or configuration exports to Box cloud storage, then sends a completion email via Mailgun. It is ideal for small-to-medium businesses or solo developers who want hands-off, verifiable backups without writing custom scripts. Key Steps: - Webhook (Scheduler Trigger): Triggers the workflow on a CRON schedule or external call. - Code (DB/File Dump): Executes bash or Node.js commands to create a tar/zip or SQL dump. - Move Binary Data: Converts the created file into n8n binary format. - Set: Attaches metadata (timestamp, file name). - Split In Batches (optional): Splits multiple backup files for sequential uploads. - Box Node: Uploads each backup file into the specified Box folder. - HTTP Request (Verify Upload): Calls Box API to confirm upload success. - If: Branches on success vs failure. - Mailgun Node: Sends confirmation or error report email. - Sticky Notes: Provide inline documentation inside the workflow canvas. Set up steps Setup Time: 15-20 minutes 1. Clone or import the workflow JSON into your n8n instance. 2. Create credentials: - Box OAuth2: paste Client ID, Client Secret, perform OAuth handshake. - Mailgun API: add Private API key and domain. 3. Update environment variables (BOXFOLDERID, MAILGUNDOMAIN, etc.) or edit the relevant Set node. 4. Modify the Code node to run your specific backup command, e.g.: bash pgdump -U $DBUSER -h $DBHOST $DBNAME > /tmp/dbbackup.sql tar -czf /tmp/fullbackup{{new Date().toISOString()}}.tar.gz /etc/nginx /var/www /tmp/dbbackup.sql 5. Set the CRON schedule inside the Webhook node (or replace with a Cron node) to your desired frequency (daily, weekly, etc.). 6. Execute once manually to verify the Box upload and email notification. 7. Enable the workflow. Node Descriptions Core Workflow Nodes: - Webhook / Cron – Acts as the time-based trigger for backups. - Code – Creates the actual backup archive (tar, zip, SQL dump). - Move Binary Data – Moves the generated file into binary property. - Set – Adds filename and timestamp metadata for Box. - Split In Batches – Handles multiple files when necessary. - Box – Uploads the backup file to Box. - HTTP Request – Optional re-check to ensure the file exists in Box. - If – Routes the flow based on success or error. - Mailgun – Sends success/failure notifications. - Sticky Note – Explains credential handling and customization points. Data Flow: 1. Webhook/Cron → Code → Move Binary Data → Set → Split In Batches → Box → HTTP Request → If → Mailgun Customization Examples Add Retention Policy (Auto-delete old backu

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.