Automate Your Daily Tasks with n8n: A Practical Guide for Developers
Manual tasks waste developer time — especially when they’re simple, repetitive, and time-sensitive. Whether it's sending reports, triggering daily backups, or syncing data between services, these can (and should) be automated.
In this guide, we’ll walk you through how to automate daily workflows using n8n — the open-source Zapier alternative — and give you a starter JSON you can plug directly into your setup.
🔧 What is n8n?
n8n is an extendable, workflow automation tool that gives you full control over your logic. It can connect over 300+ services, lets you write custom code, and can be hosted anywhere (even on a Raspberry Pi).
At OnlyTools.in, we use n8n to automate daily tasks for our backend APIs, client dashboards, and internal tools — without hitting monthly limits like Zapier or Make.
🧩 Why Automate Daily Tasks?
Here are just a few examples of what daily automations can handle for you:
- Send daily summary emails (e.g., new signups, API usage, sales reports)
- Clean up test databases or temporary files at midnight
- Ping endpoints for uptime or latency and log results
- Sync Airtable, Notion, or Google Sheets to your internal PostgreSQL DB
- Generate daily backups and upload to S3 or Google Drive
If you find yourself doing the same thing more than twice a week — automate it.
🚀 Getting Started with n8n
Step 1: Self-Host n8n with Docker Compose (Production Setup)
If you're serious about using n8n daily, we highly recommend self-hosting it with Docker Compose instead of the quick docker run
command. Here's how to set up a reliable and secure production instance with:
- Persistent storage
- PostgreSQL for workflow storage
- Basic authentication
- Automatic HTTPS via reverse proxy (optional)
🧱 Folder Structure
First, create a folder for your n8n setup:
mkdir -p ~/n8n-docker && cd ~/n8n-docker
Create the following files inside:
n8n-docker/
├── docker-compose.yml
├── .env
└── init-data/
🧾 .env File (Configurable)
# .env # Auth N8N_BASIC_AUTH_ACTIVE=true N8N_BASIC_AUTH_USER=admin N8N_BASIC_AUTH_PASSWORD=securepassword # DB DB_POSTGRESDB_DATABASE=n8n DB_POSTGRESDB_USERNAME=n8n DB_POSTGRESDB_PASSWORD=n8npassword # Host config N8N_HOST=n8n.yourdomain.com N8N_PORT=5678 WEBHOOK_URL=https://n8n.yourdomain.com/ # Timezone GENERIC_TIMEZONE=Asia/Kolkata # Optional file storage path N8N_PERSONALIZATION_ENABLED=true
📦 docker-compose.yml
version: '3.8' services: postgres: image: postgres:15 restart: unless-stopped environment: POSTGRES_USER: ${DB_POSTGRESDB_USERNAME} POSTGRES_PASSWORD: ${DB_POSTGRESDB_PASSWORD} POSTGRES_DB: ${DB_POSTGRESDB_DATABASE} volumes: - pgdata:/var/lib/postgresql/data n8n: image: n8nio/n8n:latest restart: unless-stopped ports: - "5678:5678" environment: - DB_TYPE=postgresdb - DB_POSTGRESDB_HOST=postgres - DB_POSTGRESDB_PORT=5432 - DB_POSTGRESDB_DATABASE=${DB_POSTGRESDB_DATABASE} - DB_POSTGRESDB_USER=${DB_POSTGRESDB_USERNAME} - DB_POSTGRESDB_PASSWORD=${DB_POSTGRESDB_PASSWORD} - N8N_BASIC_AUTH_ACTIVE=${N8N_BASIC_AUTH_ACTIVE} - N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER} - N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD} - N8N_HOST=${N8N_HOST} - N8N_PORT=${N8N_PORT} - WEBHOOK_URL=${WEBHOOK_URL} - GENERIC_TIMEZONE=${GENERIC_TIMEZONE} - N8N_PERSONALIZATION_ENABLED=${N8N_PERSONALIZATION_ENABLED} volumes: - n8n_data:/home/node/.n8n depends_on: - postgres volumes: pgdata: n8n_data:
🚀 Start n8n
Run the container stack:
docker compose up -d
Access n8n at:
http://<your-server-ip>:5678
Login using the credentials from your .env
file.
🔒 Optional: Secure with HTTPS (Reverse Proxy)
If you want to expose your n8n instance securely on the internet, use a reverse proxy like NGINX or Caddy with SSL certificates (via Let’s Encrypt).
You can also use Cloudflare Tunnel or Tailscale Funnel to avoid opening public ports at all.
We’ll publish a full walkthrough on this in a future post at OnlyTools.in.
✅ You're Ready
You now have a persistent, secure, production-grade n8n setup. All your workflows and credentials will be saved in PostgreSQL and mounted volumes.
From here, you can import the daily automation example, build webhook-based flows, or connect n8n to your stack using credentials and the HTTP node.
🛠 Example: Send a Daily API Report to Your Email
Let’s say you want to fetch data from a public API every morning, format it, and email yourself a summary. Here’s a simple flow to do just that.
🔄 Workflow Overview
- Trigger: Cron node to run every day at 8:00 AM
- HTTP Request: Pull JSON data from a sample API (e.g., cat facts)
- Function Node: Transform JSON into a readable format
- Email Node: Send formatted data to your inbox
🧪 Copy & Paste Starter Workflow (n8n JSON)
You can import this directly into your n8n instance.
{ "nodes": [ { "parameters": { "mode": "everyDay", "hour": 8, "minute": 0 }, "name": "Daily Trigger", "type": "n8n-nodes-base.cron", "typeVersion": 1, "position": [200, 300] }, { "parameters": { "url": "https://catfact.ninja/fact", "responseFormat": "json" }, "name": "Fetch API Data", "type": "n8n-nodes-base.httpRequest", "typeVersion": 1, "position": [400, 300] }, { "parameters": { "functionCode": "return [\n {\n json: {\n subject: \"Your Daily Cat Fact 🐱\",\n body: `Did you know?\n\n${items[0].json.fact}`\n }\n }\n];" }, "name": "Format Email", "type": "n8n-nodes-base.function", "typeVersion": 1, "position": [600, 300] }, { "parameters": { "fromEmail": "your@email.com", "toEmail": "recipient@example.com", "subject": "={{$json[\"subject\"]}}", "text": "={{$json[\"body\"]}}" }, "name": "Send Email", "type": "n8n-nodes-base.emailSend", "typeVersion": 1, "position": [800, 300], "credentials": { "smtp": { "id": "your-smtp-credential-id" } } } ], "connections": { "Daily Trigger": { "main": [ [ { "node": "Fetch API Data", "type": "main", "index": 0 } ] ] }, "Fetch API Data": { "main": [ [ { "node": "Format Email", "type": "main", "index": 0 } ] ] }, "Format Email": { "main": [ [ { "node": "Send Email", "type": "main", "index": 0 } ] ] } } }
📌 Note: You’ll need to add your own SMTP credentials under n8n Settings → Credentials. Use services like Gmail SMTP, SendGrid, or your transactional mail provider.
💡 Real-World Use Cases from OnlyTools.in
- Daily Backup Automation: PostgreSQL DB → S3 with timestamped filenames
- Uptime Monitor: Ping API every 5 min → send alert on failure
- Sales Summary: WooCommerce/Shopify → Email → Notion page update
- Lead Tracker: Parse new email leads → add to Google Sheet and Airtable
n8n is ideal when you want full control, conditional logic, branching, and no vendor limits.
🧠 Developer Tips for Better Automation
- Use Function Nodes to transform or enrich your data
- Avoid hardcoding secrets — use env vars or Credential Manager
- Enable Logging and Webhook History in production setups
- Create reusable workflows and trigger them with the Execute Workflow node
- Self-host behind a proxy like NGINX or Caddy with SSL + basic auth
🤖 Run it 24/7 — Self-Hosted Deployment
Production deployment requires:
- Docker Compose
- PostgreSQL
- Secure credentials
- Optional: Redis, Watchtower (for updates), NGINX + SSL
We recommend deploying on a small VPS (like Hetzner, Contabo, or DigitalOcean). Use Tailscale or Cloudflare Tunnel if you don’t want to expose public ports.
⚙️ Final Thoughts
If you’re building software or APIs, automation should be part of your dev toolbox. With n8n, you can build flexible, self-hosted, powerful workflows that scale with your needs — without monthly pricing walls.
At OnlyTools.in, we help engineering teams and product founders automate everything from CI pipelines to client reporting. If you want help setting up your first n8n server or designing complex workflows, reach out — we’ve got you covered.
🙌 Stay Updated
If you found this helpful, subscribe to our newsletter and get more no-fluff tutorials on open-source automation, APIs, and developer tooling.