◉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-10-10
Figma MCP or Stitch MCP: Choosing by Whether the Screen Already Exists
When you turn a screen into code, which MCP should Antigravity talk to: Figma or Stitch? One question settles it: does the correct screen already exist? Here is the rule I use, a switching routine, and a small script for the days I can't decide.
⬡ Integrations2026-10-07
The Image Model Shuts Down on October 29 — Find Every Call in Your Agent Setup and Cut Over with a Way Back
The Gemini API deprecations table lists a shutdown date of October 29 for the image model gemini-3.1-flash-image. Here is how I locate every call scattered across configs and code, match them to a ledger, and fix a cutover date and a fallback in advance — with scripts that run.