cd /news/developer-tools/compiling-n8n-workflow-jsons-into-st… · home › topics › developer-tools › article
[ARTICLE · art-170148] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Compiling n8n Workflow JSONs into Standalone Fastify/TypeScript Microservices (Open-Source + Client-Side Playground)

A developer released n8n-to-fastify, an open-source ahead-of-time compiler that converts exported n8n workflow JSON into standalone Fastify and TypeScript microservices, resolving the workflow DAG, node dependencies and n8n expressions into idiomatic TypeScript modules rather than interpreting nodes at runtime. On a compiled Lead Intake plus subworkflow validation pipeline, the generated service handled 1,885 requests per second at 2.77 ms average latency, with 0.530 ms and 0.742 ms reported for the subworkflow path. The tool covers a subset of n8n's 400-plus community nodes, emitting typed TODO stubs for unsupported ones, maps credentials to environment variables, and is available via CLI and an in-browser playground.

by read1 min views1 publishedNov 15, 2026

n8n is fantastic for prototyping and visual orchestration. You can wire up webhooks, databases, and LLM calls in minutes.

The pain starts when a workflow grows into critical production infrastructure:

To solve this without rewriting everything by hand, I built n8n-to-fastify — an Ahead-of-Time (AOT) compiler that converts exported n8n workflow JSONs into standalone Fastify + TypeScript microservices.

Instead of interpreting JSON nodes dynamically at runtime, n8n-to-fastify parses the workflow DAG, resolves node dependencies and n8n expressions, and emits clean, idiomatic TypeScript modules (workflow.ts + routes/index.ts).

Webhook, Respond to Webhook IF / Filter, Switch, Merge, Split Out, Aggregate, Wait Set / Edit Fields, Code / Function HTTP Request, PostgreSQL, OpenAI / Gemini Execute Workflow compiled to an in-memory WorkflowRegistry (zero network round-trip between subworkflows) On a compiled Lead Intake + Subworkflow validation pipeline (bun run benchmark):

2.77 ms 1,885 req/s 0.530 ms 0.742 ms It does not cover all 400+ n8n community nodes yet. When the compiler encounters an unsupported node, it generates a typed TODO stub in the output TypeScript so you can drop in your own SDK or handler cleanly. Credentials are mapped to environment variables (process.env).

Paste any exported n8n workflow JSON into the in-browser playground or clone the CLI:

git clone https://github.com/rogeriomaciel/n8n-to-fastify
cd n8n-to-fastify
bun install
bun test

If a real-world workflow from your stack breaks on a specific node or expression ($json, $('Node'), etc.), open an issue on GitHub — and if you find the approach useful, a Star helps a lot!

── more in #developer-tools 4 stories · sorted by recency
── more on @n8n 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/compiling-n8n-workfl…] indexed:0 read:1min 2026-11-15 · —