n8n With Anthropic Claude, Self-Hosted Workflow Automation
n8n on a small Linux box with Claude Sonnet 4.6 nodes, the install I run for personal automations

n8n is the open-source workflow automation tool I use as my Zapier and Make replacement. Self-hosted on the ThinkCentre, wired to Claude Sonnet 4.6 via the Anthropic node, it runs my personal automations: email triage, content rewrites, scheduled summarisations. The setup is direct-install (no Docker), survives reboots, and costs nothing past the Anthropic API calls. This is the install I run.
What you'll build
n8n self-hosted on a Linux box via npm, accessible from your LAN, with the Anthropic Claude node configured for AI-augmented workflows. Roughly 30 minutes including a sample workflow.
Caption: n8n workflow editor with Claude Sonnet calling, summarising, and routing.
Prerequisites
- A Linux box (Ubuntu 22.04+, Debian 12+, Fedora 39+) with at least 4GB RAM
- Node 20+ and npm
- An Anthropic API key with credits
- A LAN you can reach the box from
- Optional: a domain pointed at the box if you want public access
If you want public access, run a named Cloudflare tunnel rather than opening a port. The CLAUDE.md rule applies.
Step 1, install n8n via npm
sudo npm install -g n8n
n8n --version

The npm install puts the n8n binary in /usr/bin/n8n and stores data in ~/.n8n/. That directory holds your workflows, credentials, and SQLite DB.
Step 2, run n8n once to verify
n8n start

n8n binds to localhost:5678 by default. Open http://localhost:5678 in a browser. The first launch asks you to register an admin account; do that with a strong password.
Step 3, set up systemd for auto-start
Create the unit file for production use:
sudo nano /etc/systemd/system/n8n.service
[Unit]
Description=n8n
After=network.target
[Service]
Type=simple
User=aditya
Environment="N8N_HOST=0.0.0.0"
Environment="N8N_PORT=5678"
Environment="N8N_PROTOCOL=http"
Environment="WEBHOOK_URL=http://thinkcentre.local:5678/"
ExecStart=/usr/bin/n8n start
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable n8n
sudo systemctl start n8n

The service auto-starts on boot. journalctl -u n8n -f for live logs.
Step 4, configure the Anthropic credential
In n8n, go to Credentials → Create. Pick "Anthropic API". Paste your key. Save.

n8n stores credentials encrypted at rest in ~/.n8n/database.sqlite. The encryption key lives in ~/.n8n/config; back it up if you back up workflows.
Step 5, build a sample workflow
Create a new workflow. Add nodes:
- Manual Trigger
- HTTP Request (fetch the latest article from your RSS feed)
- Anthropic Claude (summarise)
- Email or Slack output
Connect them. The Claude node config:
Model: claude-sonnet-4-6
System Prompt: "Summarise the article in three bullets, English only, no fluff."
User Prompt: "{{ $json.body }}"

Click Test. The workflow runs end-to-end; the summary appears in the Claude node's output panel.
First run
A real workflow I run on a schedule:
Cron Trigger (every 6h)
→ HTTP Request (fetch papersadda RSS)
→ Filter (only new articles since last run)
→ Anthropic Claude (write a 100-word digest)
→ Send Email (to me)

Total cost: a few rupees of Anthropic API per run. Versus a Zapier subscription with similar capability ($30/mo for the AI tier), the self-hosted path pays back in under two months.
What broke for me
Two specifics. First, my n8n SQLite DB silently grew to 800MB after a month of frequent runs because n8n keeps execution history. The fix was setting EXECUTIONS_DATA_PRUNE=true and EXECUTIONS_DATA_MAX_AGE=72 (hours) in the systemd environment. After a restart, the DB pruned to 50MB and stayed there.
Second, the Anthropic node by default uses Opus 4.6 in some workflow templates I imported. My API spend was 3x what I expected on a workflow that runs every 6 hours. The fix was auditing every Claude node in the workflow, switching to Sonnet 4.6 explicitly. Sonnet is cheaper and quality is fine for summarisation.
What it costs
| Item | Cost |
|---|---|
| n8n self-hosted | Free (Sustainable Use Licence) |
| Anthropic Sonnet 4.6 | $3/M input + $15/M output |
| Hardware (existing box) | Rs 0 |
| Electricity (always-on) | ~Rs 200/mo |
For a 6-hourly workflow with a 1-page article in and a 200-word digest out, my actual Anthropic spend is roughly Rs 50/mo. Versus Zapier AI plan at Rs 2,400/mo, the math is decisive.
When NOT to use this
Skip self-hosted n8n if your workflow needs change daily and the SaaS-fluidity is worth more than Rs 25,000/year savings. Zapier's polish and one-click integrations are still ahead for the casual user.
Skip if you do not have an always-on box. n8n on a laptop that sleeps loses scheduled triggers; cloud n8n or Zapier is the right fit there.
If you drive your automations from a terminal agent rather than a visual canvas, the equivalent move is to build a custom MCP server in Python so Claude Code itself can trigger the same actions as typed tools.
Indian operator angle
For Indian content factories and small marketing teams, n8n self-hosted is the cleanest path to AI-augmented workflows at startup-friendly cost. A typical six-workflow setup (RSS digest, content rewrite, social schedule, lead enrichment, email triage, calendar invite) costs under Rs 1,000/mo all-in versus Rs 8,000-15,000/mo on equivalent SaaS.
For payment, n8n's Sustainable Use Licence allows commercial use for internal automations; the only restriction is competing with n8n Cloud as a paid service. For a typical Indian SaaS using n8n internally, no licence cost applies.
Related
More Automation

Programmatic PDF Table Extraction and OCR with Adobe PDF Services REST: The Auth, the Extract Call, and Parsing the Output
I wired Adobe PDF Services REST into my stack as a local tool and pointed it at the scanned invoices and merged-header statements that pdfplumber turned into soup. Here is the exact auth flow, the extract call, and the structuredData.json parsing I run in production, with the real latency and free-tier limits.

I Gave My AI Agent Eyes and Hands on Native Linux Apps With AT-SPI2
I was tired of my agent missing buttons because a window shifted a few pixels. So I pointed it at the AT-SPI2 accessibility tree instead, the same data a screen reader consumes, and had it act by element name and role. This walks through driving a GTK dialog and a native Save dialog, then reading the value back to prove the action actually landed.

Reboot-Proof Cloudflare Named Tunnels: The systemd Setup I Run in Production
I expose every self-hosted app on my home box through a Cloudflare named tunnel, kept alive by a systemd unit that has survived every reboot for weeks. This is the real login-to-systemd flow, the config file, the unit, and why a named tunnel beats a quick tunnel for anything you mean to keep.