◉ANTIGRAVITY LABJP
Articles/Integrations
⬡ Integrations/2026-04-16Advanced

n8n × AI Agents — Self-Hosting Gotchas and Parsing the JSON That Comes Back Broken

Implementation notes from self-hosting n8n with AI agent nodes: which environment variables silently stopped working, how a missing encryption key leaves your credentials undecryptable, and a measured comparison of four ways to extract JSON from LLM responses across 13 failure shapes.

n8n3AI agents24workflow automationself-hostedDocker5Claude4Gemini9integrations21

✦ Premium Article

My Path to n8n Started With a Zapier Invoice

When I first tried to automate work across several services as an indie developer, the wall I hit was cost, not capability. Zapier's paid tiers start at $29/month, Make at $16/month. With three flows to run, neither one adds up.

That's when I found n8n (pronounced "en-eight-en"). It's open source, and self-hosted your only cost is the server. Once the AI nodes matured, it became the center of my automation setup.

Getting there was not frictionless. Several things simply did not work the way the copy-pasted configs promised. What follows are those sticking points and what I verified by hand.

Where n8n Diverges From Zapier and Make

n8n is a fair-code licensed automation tool with a visual builder and integrations for 400+ services. Here are the only comparison points that actually shaped my decision.

Dimensionn8n (self-hosted)ZapierMake
How cost growsServer cost only; flat with execution volumeTied to task countTied to operation count
Arbitrary codeJavaScript / Python inside nodesConstrainedConstrained
Where data livesYour serverVendorVendor
Operational burdenUpdates and backups are yoursNoneNone
Simple 2-step flowsSomewhat verboseFastestFast

To be honest about it: for a two-step automation, Zapier gets you there sooner. n8n earns its keep once branching, data transformation, and AI calls start tangling together. The corollary is that starting a self-hosted instance before you reach that point buys you the maintenance without the payoff.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Why the image name and BASIC_AUTH variables in widely copied docker-compose files no longer work on current n8n, and what to write instead
✦The 'credentials could not be decrypted' failure caused by an unpinned N8N_ENCRYPTION_KEY, plus a 30-line backup verifier that catches it before you need the restore
✦A measured comparison across 13 broken-JSON shapes: bare JSON.parse clears 4, brace-scanning with repair clears all 13 — with the extraction function to drop into a Code node
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Integrations2026-09-05
Pointing GOOGLE_GEMINI_BASE_URL at Your Own Gateway Does Not Change Who Holds the Key
I pointed the Antigravity CLI at a gateway of my own and recorded exactly which credentials travelled with it. Authorization is dropped across a cross-origin redirect, but the API key header survives every hop. Here is the measurement, and how I moved the key off my laptop.
⬡ Integrations2026-11-25
A Conversation Started in the Desktop App Won't Resume in agy: How I Hand Off Work Between Two Separate Stores
The Antigravity desktop app and the agy CLI save conversations in separate folders, so neither can list or resume what the other started. Where the new agy -r flag from 1.5.16 helps, what to put in a HANDOFF.md so you don't lose your place, and a shell script that writes it for you (checked against the Releases page and Issue #1773 as of November 2026).
⬡ Integrations2026-11-21
Moving Your Antigravity Setup from Zed to VS Code, JetBrains, or Xcode: The Three Places You Can't Just Copy
When you move an agy acp registration from Zed to VS Code, a JetBrains IDE, or Xcode, three things change: the config key, the command path, and authentication plus available models. Here is the diff from the official docs and a small script that converts your Zed settings.