<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rogerio Maciel</title>
    <description>The latest articles on DEV Community by Rogerio Maciel (@rogerio_maciel_ebdfaa587e).</description>
    <link>https://dev.to/rogerio_maciel_ebdfaa587e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4246612%2F5fa769e1-06f7-4e8b-b78e-57a4f2d419a1.jpg</url>
      <title>DEV Community: Rogerio Maciel</title>
      <link>https://dev.to/rogerio_maciel_ebdfaa587e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rogerio_maciel_ebdfaa587e"/>
    <language>en</language>
    <item>
      <title>Compiling n8n Workflow JSONs into Standalone Fastify/TypeScript Microservices (Open-Source + Client-Side Playground)</title>
      <dc:creator>Rogerio Maciel</dc:creator>
      <pubDate>Sun, 15 Nov 2026 22:12:24 +0000</pubDate>
      <link>https://dev.to/rogerio_maciel_ebdfaa587e/compiling-n8n-workflow-jsons-into-standalone-fastifytypescript-microservices-open-source--2nd3</link>
      <guid>https://dev.to/rogerio_maciel_ebdfaa587e/compiling-n8n-workflow-jsons-into-standalone-fastifytypescript-microservices-open-source--2nd3</guid>
      <description>&lt;p&gt;n8n is fantastic for prototyping and visual orchestration. You can wire up webhooks, databases, and LLM calls in minutes.&lt;/p&gt;

&lt;p&gt;The pain starts when a workflow grows into critical production infrastructure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;High-concurrency webhooks&lt;/strong&gt; hit runtime overhead and container memory limits (~250MB+ per worker).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subworkflows&lt;/strong&gt; pay HTTP/DB round-trip overhead instead of running in-process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Engineering workflows&lt;/strong&gt; struggle with diffing 2,000-line JSON exports in Git, running unit tests, and enforcing strict TypeScript contracts.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Try it live (100% client-side in your browser — zero data leaves your machine):&lt;/strong&gt; &lt;a href="https://www.rogeriomaciel.com.br/en/n8n-to-fastify/" rel="noopener noreferrer"&gt;rogeriomaciel.com.br/en/n8n-to-fastify&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source code (MIT):&lt;/strong&gt; &lt;a href="https://github.com/rogeriomaciel/n8n-to-fastify" rel="noopener noreferrer"&gt;github.com/rogeriomaciel/n8n-to-fastify&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

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

&lt;h3&gt;
  
  
  Currently supported nodes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Triggers &amp;amp; Responses:&lt;/strong&gt; &lt;code&gt;Webhook&lt;/code&gt;, &lt;code&gt;Respond to Webhook&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flow &amp;amp; Logic:&lt;/strong&gt; &lt;code&gt;IF / Filter&lt;/code&gt;, &lt;code&gt;Switch&lt;/code&gt;, &lt;code&gt;Merge&lt;/code&gt;, &lt;code&gt;Split Out&lt;/code&gt;, &lt;code&gt;Aggregate&lt;/code&gt;, &lt;code&gt;Wait&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data &amp;amp; Code:&lt;/strong&gt; &lt;code&gt;Set / Edit Fields&lt;/code&gt;, &lt;code&gt;Code / Function&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrations:&lt;/strong&gt; &lt;code&gt;HTTP Request&lt;/code&gt;, &lt;code&gt;PostgreSQL&lt;/code&gt;, &lt;code&gt;OpenAI / Gemini&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subworkflows:&lt;/strong&gt; &lt;code&gt;Execute Workflow&lt;/code&gt; compiled to an in-memory &lt;code&gt;WorkflowRegistry&lt;/code&gt; (zero network round-trip between subworkflows)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Benchmark (Bun + Fastify)
&lt;/h2&gt;

&lt;p&gt;On a compiled Lead Intake + Subworkflow validation pipeline (&lt;code&gt;bun run benchmark&lt;/code&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compilation time:&lt;/strong&gt; &lt;code&gt;2.77 ms&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Throughput:&lt;/strong&gt; &lt;code&gt;1,885 req/s&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Average latency:&lt;/strong&gt; &lt;code&gt;0.530 ms&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;p95 latency:&lt;/strong&gt; &lt;code&gt;0.742 ms&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Honest Limitations
&lt;/h2&gt;

&lt;p&gt;It does &lt;strong&gt;not&lt;/strong&gt; cover all 400+ n8n community nodes yet. When the compiler encounters an unsupported node, it generates a typed &lt;code&gt;TODO&lt;/code&gt; stub in the output TypeScript so you can drop in your own SDK or handler cleanly. Credentials are mapped to environment variables (&lt;code&gt;process.env&lt;/code&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  Try it &amp;amp; Break it
&lt;/h2&gt;

&lt;p&gt;Paste any exported n8n workflow JSON into the &lt;a href="https://www.rogeriomaciel.com.br/en/n8n-to-fastify/" rel="noopener noreferrer"&gt;in-browser playground&lt;/a&gt; or clone the CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/rogeriomaciel/n8n-to-fastify
&lt;span class="nb"&gt;cd&lt;/span&gt; n8n-to-fastify
bun install
bun &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a real-world workflow from your stack breaks on a specific node or expression (&lt;code&gt;$json&lt;/code&gt;, &lt;code&gt;$('Node')&lt;/code&gt;, etc.), open an issue on &lt;a href="https://github.com/rogeriomaciel/n8n-to-fastify" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; — and if you find the approach useful, a &lt;strong&gt;Star&lt;/strong&gt; helps a lot!&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyxec4vnx0w128e3rp7id.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyxec4vnx0w128e3rp7id.jpg" alt=" " width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>n8n</category>
      <category>typescript</category>
      <category>node</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
