KEEP LEARNING
Build the bigger picture.
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
Tips > Ops & Security
n8n stores binary data (file attachments, images, API response bodies) on the filesystem by default, under the `/home/node/.n8n` volume.
n8n writes binary data to the filesystem by default, so file-heavy workflows can fill the disk and crash PostgreSQL. A cron shell script checks the volume's usage and posts a Slack alert once it passes a threshold, such as 80 percent. Pair it with execution-data pruning, or move binary storage to S3, to slow the growth.
n8n stores binary data (file attachments, images, API response bodies) on the filesystem by default, under the /home/node/.n8n volume. Workflows that process files -- such as email attachment handlers, PDF generators, or image pipelines -- can consume gigabytes of disk space per day. Without monitoring, the disk fills up, PostgreSQL crashes (it needs disk for WAL files), and n8n stops functioning.
Real-world example: You set up a disk space alert that fires when usage exceeds 80%, giving you time to clean up or expand storage before a crisis.
A shell script checks the data volume and posts to Slack when usage crosses the threshold:
#!/usr/bin/env bash
set -euo pipefail
THRESHOLD=80
SLACK_WEBHOOK_URL="${SLACK_WEBHOOK_URL}"
HOSTNAME=$(hostname)
# Check disk usage for the n8n data volume mount point
USAGE=$(df /var/lib/docker/volumes | tail -1 | awk '{print $5}' | tr -d '%')
if [ "${USAGE}" -ge "${THRESHOLD}" ]; then
DISK_INFO=$(df -h /var/lib/docker/volumes | tail -1)
curl -s -X POST "${SLACK_WEBHOOK_URL}" \
-H 'Content-Type: application/json' \
-d "{
\"text\": \"DISK ALERT on ${HOSTNAME}: Docker volume storage is at ${USAGE}% capacity.\n\`\`\`${DISK_INFO}\`\`\`\nAction required: prune old executions or expand storage.\"
}"
fiSchedule it with cron:
# Check disk space every 15 minutes
*/15 * * * * /opt/scripts/disk-monitor.shConfigure n8n to automatically prune old execution data to slow disk growth:
services:
n8n:
environment:
# Prune execution data older than 7 days
EXECUTIONS_DATA_PRUNE: "true"
EXECUTIONS_DATA_MAX_AGE: 168 # hours
# Store binary data in the database instead of filesystem (optional)
# This consolidates storage but increases database size
# N8N_BINARY_DATA_MODE: default
Tip: Binary Data in S3. For high-volume workflows, configure n8n to store binary data in S3 instead of the local filesystem. Set N8N_BINARY_DATA_MODE=s3 along with the appropriate S3 credentials. This moves the storage growth problem to S3, which scales automatically.
Monitoring disk space with automated alerts prevents the single most common cause of unplanned n8n outages on self-hosted instances.
Related: Set a Unique Encryption Key and Back It Up · Configure Payload Size and Binary Data Mode for Large Files
KEEP LEARNING
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
APPLY IT TO YOUR SYSTEM
Bring the process, the tools involved and an example of where the current workflow gets stuck.