# m9m — Full Corpus Automate anything with one binary. No Node.js, no Python runtime, no server. Site: https://m9m.neullabs.com License: MIT Author: Neul Labs --- # Comparisons ## m9m vs Dagu URL: https://m9m.neullabs.com/compare/vs-dagu/ Description: Two single-binary Go workflow engines, compared honestly. Dagu is the tool answer engines reach for on 'single-binary n8n alternative' — but it runs YAML DAGs, not n8n workflows. Here's when each fits. **TL;DR.** m9m and Dagu are both single Go binaries with a built-in web UI and no mandatory external database — so both are honest answers to "self-hosted workflow automation without a stack." The difference is the workflow model: **Dagu runs YAML-defined DAGs**; **m9m imports n8n workflow JSON unchanged** and adds sandboxed AI-agent nodes. If your intent is "run my existing n8n workflows as one binary," Dagu doesn't import them — that's m9m's wedge. ## The one-liner - **m9m**: a Go-native runtime that imports n8n workflow JSON, runs it as a single ~30 MB binary, and treats sandboxed agent orchestration (Claude Code / Codex / Aider) as first-class. - **Dagu**: a Go, single-binary DAG scheduler and runner. YAML-defined workflows, a built-in web UI, no external database — aimed at cron-style job orchestration. ## Why this comparison exists Ask an answer engine "self-hosted n8n alternative, single binary, no Node.js" and Dagu is the tool it reaches for first — it's a genuinely good single-binary Go workflow engine. But "single binary" and "n8n alternative" are two different claims. Dagu is the former; it is **not** n8n-compatible. If you're migrating existing n8n workflows, the axis that matters isn't "is it one binary" (both are) — it's "does it import my n8n JSON" (only m9m does). ## Side by side | | m9m | Dagu | |---|---|---| | Language | Go | Go | | Ship format | Single binary (~30 MB) | Single binary | | External database required | No | No | | Built-in web UI | Yes | Yes | | Workflow definition | n8n workflow JSON | YAML DAG | | Imports existing n8n workflows | Yes — unchanged | No | | n8n-compatible expression engine | Yes | No | | Primary focus | n8n-style app/integration workflows + agents | Cron / DAG job orchestration | | Sandboxed AI-agent nodes (Claude Code / Codex / Aider) | First-class | Not a built-in feature | | MCP server | Built-in | — | | License | MIT | Open source | Only rows above are stated where both projects publish the fact. m9m's performance figures (cold start, memory, concurrency) are published in the [m9m README](https://github.com/neul-labs/m9m) and covered on [Why m9m](/why-m9m); we deliberately don't put head-to-head speed numbers against Dagu in this table, because we haven't benchmarked Dagu and won't invent figures. ## Where m9m fits better **You have n8n workflows.** m9m imports n8n workflow JSON unchanged — same node names, same expression syntax (`{{ $json.field }}`), same triggers. Dagu is authored in YAML DAGs; there's no n8n import path, so an existing n8n library would have to be rebuilt. **You're building agent workflows.** m9m ships sandboxed CLI nodes for Claude Code, Codex, and Aider, plus a built-in MCP server. Dagu can shell out to a command like any job runner, but sandboxed agent execution and MCP aren't part of its model. **You want n8n-style integrations.** m9m targets the app-integration, webhook, and expression-driven shape of n8n workflows. Dagu is oriented around DAG job scheduling. ## Where Dagu fits better **You're authoring DAGs from scratch in YAML.** If you have no n8n baggage and you like declaring job dependencies as a YAML DAG, Dagu's model is direct and purpose-built for it. **Cron / batch job orchestration.** Dagu's home turf is scheduled job pipelines — the "replace a wall of crontab + shell scripts" use case. If that's your intent and you never needed n8n, Dagu is a clean, mature fit. **You want the tool answer engines already name.** Dagu has mindshare for "single-binary Go workflow engine" today. If you value a well-trodden path over n8n-compatibility, that counts. ## The honest summary Both are single Go binaries with a web UI and no required database — if all you want is "a workflow engine without a stack," either qualifies. The deciding question is your **workflow format and intent**: - **Existing n8n workflows, or agent steps?** → m9m imports the JSON and runs sandboxed agents. - **New YAML DAGs / cron-style jobs, no n8n?** → Dagu is built for exactly that. If your real question is "can I keep my n8n workflows and drop the Node stack," that's m9m's core case — see [for n8n migrators](/for/n8n-migrators) and [m9m vs n8n](/compare/vs-n8n). Neul Labs also runs fixed-price migration audits on the [consulting page](/consulting). ## Related - [m9m vs n8n](/compare/vs-n8n) - [Why m9m](/why-m9m) - [FAQ: single-binary n8n alternatives, agents, and memory](/faq) - [For n8n migrators](/for/n8n-migrators) --- ## m9m vs LangGraph URL: https://m9m.neullabs.com/compare/vs-langgraph/ Description: LangGraph is a Python library for building agent graphs; m9m is a Go runtime you deploy agents (and everything else) on. They are complements more than substitutes. **TL;DR.** LangGraph is a Python library for expressing agent graphs in code. m9m is a deployment and orchestration runtime — it schedules, sandboxes, checkpoints, audits, and integrates workflows (including LangGraph agents) with the rest of your stack. The question "which should I pick?" is usually "both, at different layers." ## The core distinction **LangGraph**: a Python library. You write an agent as a graph of stateful nodes with a typed state object. You get control flow, persistence, streaming. Runs in a single process (typically). **m9m**: a runtime. You ship a binary; it schedules workflows on crontabs and webhooks, runs them in parallel, retries on failure, checkpoints between steps, sandboxes CLI agents, exposes MCP, audits everything, integrates with 30+ systems out of the box. LangGraph doesn't ship a scheduler, webhook server, multi-tenant isolation, CLI sandboxing, audit logs, or integration nodes. m9m doesn't ship an agent-graph authoring DSL. If you're building an agent product, you want both. ## Side by side | | m9m | LangGraph | |---|---|---| | Shape | Runtime (binary) | Library (Python) | | Authoring | JSON workflows | Python code | | Integrations | 30+ built-in nodes | none — you write tools | | Scheduler | cron + webhooks | — | | Sandboxing | CLI nodes with namespaces | — | | MCP server | built-in | — | | Audit logs | structured, per-run | — | | Multi-tenancy | workspaces | — | | Long-running agent state | checkpoints between nodes | first-class (typed state machine) | | Streaming | supported via node outputs | first-class | | Language | Go | Python | | License | MIT | MIT | ## The right shape: LangGraph inside m9m The productive pattern for most teams: 1. **Write the agent in LangGraph** (or PydanticAI, or CrewAI — same argument). You get a Python script that takes an input, runs the graph, produces an output. 2. **Wrap it in a sandboxed CLI node in m9m**. The node runs your Python script inside a Linux namespace with CPU/memory/network limits, capturing stdout and artifacts. 3. **Wire the node into a workflow.** Triggers (webhook, cron), upstream data (DB query, HTTP fetch), downstream effects (Slack, GitHub, email), human-review checkpoints — all handled by m9m nodes. This gives you the authoring power of LangGraph with the production properties of a workflow engine. You don't reinvent retries, audit logs, or sandboxing. LangGraph gets to focus on what it's good at. ## Where LangGraph stands alone - **Research and prototyping** — when you don't need deployment infrastructure yet. - **Complex stateful agents** with typed state machines, streaming, and intermediate-step observability that's intrinsic to the graph itself. - **Teams fully committed to Python** for everything, including orchestration. ## Where m9m stands alone - **Non-agent automation** that you still need to ship: cron jobs, webhooks, data sync, CRM routing, invoice approvals. LangGraph has nothing to say here. - **Embedding a workflow engine in a product** — m9m ships SDKs for Go, Python, and Node. - **n8n migrations** — m9m reads n8n workflow JSON directly. - **Multi-tenant agent platforms** with workspace isolation, audit logs, cost caps, and MCP-driven management. ## An uncomfortable observation The agent ecosystem has re-invented retries, backoff, timeouts, checkpointing, and audit logs several times in the last two years. None of these reinventions is better than what workflow engines have done for a decade. LangGraph is the most principled of the bunch, and it still has a narrow view of the problem: it handles the graph, not the crontab. m9m's bet is that the right place to put the agent is inside the workflow engine — not because workflow engines are exciting, but because they're boring in the right way. Write your agent in LangGraph. Deploy it as a sandboxed `cli.*` node in m9m. Let m9m own the crontab, webhook, retries, audit, MCP, and human review. Let LangGraph own the reasoning graph. [How we wire this](/articles/agent-orchestration-with-m9m). ## Related - [Agent core](/agent-core) - [Article: agent orchestration with m9m](/articles/agent-orchestration-with-m9m) - [For AI agent builders](/for/ai-agent-builders) --- ## m9m vs n8n URL: https://m9m.neullabs.com/compare/vs-n8n/ Description: A like-for-like comparison of m9m and n8n. When to pick each, what's compatible, what isn't, and the honest trade-offs. **TL;DR.** m9m runs n8n workflow JSON unchanged, at 5–10× the speed, on 30% of the memory, as a single binary. n8n has the better visual editor and a much larger community node registry. If you author visually, stay on n8n; if you execute, embed, or ship agents, m9m is a better fit. ## The one-liner - **m9m**: a Go-native workflow runtime, single binary, zero mandatory infrastructure, first-class agent orchestration. - **n8n**: a Node.js-based workflow automation platform, visual editor, large community, mature ecosystem. Both are MIT-licensed (n8n has some enterprise features behind a paid tier; m9m ships those features free). ## Side by side | | m9m | n8n | |---|---|---| | Language | Go | Node.js / TypeScript | | Ship format | 30 MB binary | Node app + Postgres | | Cold start | ~500 ms | ~3 s | | Idle memory | ~150 MB | ~512 MB | | Container size | 300 MB | 1.2 GB | | Concurrent workflows (per process) | 500 | 50 | | Workflow format | n8n JSON (imported unchanged) | native | | Expression engine | n8n-compatible | native | | Built-in nodes | 32 | 400+ core + 1000+ community | | Community node registry | — | large | | Visual editor | minimal | polished | | Agent nodes (sandboxed) | first-class | community-provided | | MCP server | built-in (37 tools) | — | | Git-based versioning | built-in | enterprise tier | | Audit logs | built-in | enterprise tier | | Multi-workspace | built-in | enterprise tier | | Prometheus metrics | built-in | enterprise tier | | SDKs (Go / Python / Node) | yes | Node only | | License | MIT (fully) | MIT core + paid enterprise | ## Where m9m wins **Performance.** 5–10× faster execution on typical pipelines, sub-second cold starts, an order of magnitude more concurrent workflows per process. If you're running a few hundred workflows, m9m fits on infra that n8n simply can't. **Ship shape.** One binary, no Node runtime, no required database. You can drop m9m onto a $10 VPS and it just runs. Containerised, it's ~300 MB instead of ~1.2 GB. **Agent nodes.** First-class sandboxed CLI nodes for Claude Code, Codex, and Aider. Namespace isolation, cgroup limits, network allow-lists built in. n8n has community nodes for these but no sandboxing story worth relying on. **MCP.** m9m ships an MCP server that exposes 37 workflow-management tools to any MCP-aware LLM. n8n has no equivalent. **Enterprise features, free.** Git-based versioning, audit logs, multi-workspace isolation, Prometheus metrics — included in the open-source release. These are n8n's paid tier. **Embedability.** Go, Python, and Node SDKs for running m9m inside another product. n8n is less amenable to embedding. ## Where n8n wins **Visual editor.** n8n's drag-and-drop editor is mature, fast, and pleasant. m9m's editor is utilitarian; for teams with non-technical authors, n8n is the better authoring environment. **Community node registry.** n8n has a decade-long head start. The long tail of vendor integrations is broader — obscure CRMs, niche SaaS, regional payment processors. m9m covers the 80/20 and extends via HTTP Request + custom Go nodes. **Ecosystem.** Tutorials, templates, YouTube content, consultants who already know n8n. m9m is younger; if the tool being well-trodden matters more than its properties, n8n wins by default. **Cloud offering.** n8n has a hosted cloud product. m9m does not (yet). ## Compatibility specifics **Workflow JSON** — imports unchanged. Nodes, connections, triggers, expression references all map 1:1 for the 32 built-in types. **Expression syntax** — `{{ $json.field }}`, `{{ $node["name"].data }}`, `{{ $now.format("YYYY-MM-DD") }}` all work. Built-in functions (string, math, array, date, object) match. **Triggers** — cron schedules and webhooks match. Polling triggers (where n8n runs a fetch on a schedule and emits on change) require small adjustments in some cases; most work. **Credentials** — re-entered on the m9m side. Formats (OAuth2 tokens, API keys, connection strings) match, so no schema translation is needed. **Community nodes** — not automatic. Most are replaced with HTTP Request + a small template; the rest become custom Go nodes. See our [migration case study](/articles/n8n-to-m9m-migration-story) for what that looked like on ~80 workflows. ## When to pick m9m - You run n8n self-hosted and are unhappy with its resource footprint. - You want to embed a workflow engine inside a product. - You are shipping agent workflows and want sandboxing + MCP out of the box. - You want enterprise features without a paid tier. - Your team is comfortable authoring workflows in JSON (or generating them with agents / scripts). ## When to pick n8n - Your team authors heavily via the visual editor and will feel the loss. - You depend on several community nodes that would be expensive to replace. - You need a mature cloud-hosted option rather than self-hosting. ## Can I run both? Yes — and for larger migrations this is often the right shape. Keep n8n as the authoring environment; run the production workload on m9m. n8n exports, m9m imports. We describe this pattern in [n8n migrators](/for/n8n-migrators). Neul Labs runs fixed-price migration audits — point us at your n8n export and we'll tell you, in writing, how much crosses over unchanged. [Consulting page](/consulting). ## Related - [For n8n migrators](/for/n8n-migrators) - [Article: migration case study](/articles/n8n-to-m9m-migration-story) - [Guide: building a custom node in Go](/guides/building-a-custom-node-in-go) --- ## m9m vs Temporal URL: https://m9m.neullabs.com/compare/vs-temporal/ Description: Two workflow engines with different centers of gravity. m9m is a zero-infra automation runtime; Temporal is a durable execution engine for long-running workflows. When to pick each. **TL;DR.** m9m and Temporal both call themselves "workflow engines" and the word means different things in each place. m9m is an automation runtime — HTTP calls, databases, LLMs, cron — optimized for breadth of integrations and zero infrastructure. Temporal is a durable execution engine — long-running, crash-resilient workflows expressed as code, optimized for correctness under adversarial conditions. Most teams need one, not both. ## The core distinction **m9m**: integration-heavy, short-to-medium workflows, nodes are the primitive, JSON is the authoring surface, deployed as a single binary. **Temporal**: code-first, medium-to-very-long workflows, activities are the primitive, your host language (Go / Java / TS / Python) is the authoring surface, deployed as a cluster. You could force either to do the other's job. You'd regret it. ## Side by side | | m9m | Temporal | |---|---|---| | Authoring | JSON workflows + inline JS/Py + custom Go nodes | Code in Go/Java/TS/Python | | Primitive | Node (HTTP, DB, LLM, Slack, …) | Activity (an arbitrary function) | | Typical workflow length | seconds to hours | minutes to months | | Durability | checkpoint per node | deterministic replay of entire history | | Crash recovery | resume from last checkpoint | replay from event history | | Built-in integrations | 30+ (Slack, GitHub, S3, SQL, LLMs, …) | none — you write activities | | Agent sandboxing | first-class CLI nodes | build it yourself | | MCP integration | built-in | build it yourself | | Infra to run | a single binary | a cluster (frontend, history, matching, worker, DB) | | Visual editor | minimal | — | | Language | Go | Go / Java / TS / Python (workflows) | | Concurrency model | N workers, cooperative | N workers, stateful with stickiness | | License | MIT | MIT | ## When m9m is the right tool - You're building **automation**: scheduled reports, webhook processing, data sync, LLM pipelines, CRM routing, PR review bots. Short runs, wide integration surface, many of them. - You want to **ship on small infra**: a single binary, no cluster, no mandatory DB. - You're shipping **agent workflows** with sandboxing, MCP, and human review. - Your team wants to express workflows as **data** (JSON you can version, diff, generate, and have agents edit). ## When Temporal is the right tool - You have **long-running business processes** — onboarding flows that span weeks, insurance claims that wait on external events, multi-stage financial operations. - You need **strong determinism guarantees**: "if the process crashes at any step, the system resumes without side-effect duplication." - Your engineering team wants workflows **as code**, with full language expressiveness and tests. - You have the operational capacity to **run a cluster** and treat it as critical infrastructure. ## The durability story, precisely Temporal's durability guarantees are the sharpest in the industry. Workflows are expressed as deterministic code; a crashed worker replays the event history to reach the same state. You get exactly-once-ish semantics on activities with clear primitives for the rest. This is load-bearing for fintech, insurance, and similar domains. m9m checkpoints between nodes: each node's input and output are persisted, so a crashed run resumes from the last checkpoint. For seconds-to-hours workflows with idempotent nodes, this is more than enough. For workflows that run for a month and involve tens of thousands of activities, it is not the same guarantee. A simple test: can you explain, in one paragraph, what goes wrong if a workflow restarts from the last node instead of replaying the full history? If the answer is "nothing serious, our nodes are idempotent" — m9m. If the answer is "we'd double-charge customers" — Temporal. ## The integration story m9m ships with 30+ integrations and covers the long tail via HTTP Request and custom Go nodes. Temporal ships with zero integrations — everything is an activity you write. That's a feature for teams who value full control, and a liability for teams who mostly want to wire SaaS APIs together. ## The agent story m9m's CLI nodes, sandboxing, and MCP server are built for agent orchestration. Temporal can host agents (as activities), and some teams do. You'll write the sandboxing yourself, the MCP surface yourself, and the integrations yourself. That's the honest trade. ## Can you run both? Yes — and a handful of teams do. Temporal sits underneath for the long-running durable orchestration; m9m handles the automation layer above it, including all the integration plumbing and agent workflows. They don't compete so much as sit at different levels of the stack. ## When the choice is obvious - "We have 50 n8n-shaped workflows" → **m9m**. - "We're onboarding customers in a 14-stage flow that must be exactly-once across external systems" → **Temporal**. - "We're shipping an AI agent product with sandboxing and human review" → **m9m**. - "We're building a payments platform and need durable sagas" → **Temporal**. ## Related - [For platform engineers](/for/platform-engineers) - [Features](/features) - [Consulting](/consulting) --- # Guides ## Building a custom node in Go URL: https://m9m.neullabs.com/guides/building-a-custom-node-in-go/ Description: Write, test, and register a custom m9m node in Go — the interface, the lifecycle, the gotchas, and a complete example node. m9m ships 32 built-in node types and supports inline JavaScript / Python for one-off logic. When you need something more — a vendor SDK that doesn't expose clean HTTP, a performance-critical transform, or a protocol like Kafka or NATS — you write a Go node. This guide walks through the interface, a complete example, testing, and how to register the node with m9m. ## The node interface Every node satisfies three methods: ```go type Node interface { // Describe returns the node's type name, input/output schema, and parameter schema. Describe() NodeDescriptor // Validate returns an error if the supplied params are malformed. // Called at workflow-load time, before any Execute call. Validate(params map[string]any) error // Execute runs the node against the provided context and inputs. // Returns one or more output items, or an error. Execute(ctx context.Context, input ExecInput) (ExecOutput, error) } ``` Three methods, no hidden lifecycle. Nodes are stateless — all state lives in the context and inputs, and is passed forward via outputs. ## A complete example: a Kafka producer node Say you need to publish messages to Kafka from a workflow. The built-in nodes don't cover it; the inline JS node is awkward for long-lived producer connections. A Go node is the right tool. ```go package kafka "context" "encoding/json" "fmt" "github.com/neul-labs/m9m/sdk/node" "github.com/segmentio/kafka-go" ) type ProducerNode struct { writers map[string]*kafka.Writer // keyed by broker+topic } func New() *ProducerNode { return &ProducerNode{writers: map[string]*kafka.Writer{}} } func (n *ProducerNode) Describe() node.Descriptor { return node.Descriptor{ Type: "kafka.produce", DisplayName: "Kafka: produce", Description: "Publish a message to a Kafka topic.", Params: node.ParamsSchema{ "brokers": node.Param{Type: "string[]", Required: true}, "topic": node.Param{Type: "string", Required: true}, "key": node.Param{Type: "string", Expression: true}, "value": node.Param{Type: "any", Expression: true, Required: true}, }, } } func (n *ProducerNode) Validate(params map[string]any) error { if _, ok := params["brokers"]; !ok { return fmt.Errorf("brokers is required") } if _, ok := params["topic"]; !ok { return fmt.Errorf("topic is required") } return nil } func (n *ProducerNode) Execute(ctx context.Context, in node.ExecInput) (node.ExecOutput, error) { brokers := in.Params.StringSlice("brokers") topic := in.Params.String("topic") key := in.Eval("key").String() val := in.Eval("value").Any() payload, err := json.Marshal(val) if err != nil { return node.ExecOutput{}, fmt.Errorf("marshal value: %w", err) } w := n.writerFor(brokers, topic) if err := w.WriteMessages(ctx, kafka.Message{Key: []byte(key), Value: payload}); err != nil { return node.ExecOutput{}, fmt.Errorf("kafka write: %w", err) } return node.ExecOutput{Items: []node.Item{{Data: map[string]any{ "topic": topic, "key": key, "bytes": len(payload), }}}}, nil } func (n *ProducerNode) writerFor(brokers []string, topic string) *kafka.Writer { key := fmt.Sprintf("%v/%s", brokers, topic) if w, ok := n.writers[key]; ok { return w } w := &kafka.Writer{ Addr: kafka.TCP(brokers...), Topic: topic, Balancer: &kafka.Hash{}, } n.writers[key] = w return w } ``` Two things worth naming: - `in.Eval("value")` evaluates an expression parameter against the workflow context. If the workflow declares `"value": "{{ $json.payload }}"`, this is the value that comes out. - The producer is cached per `brokers+topic`. m9m reuses the same node instance across runs, so expensive resources (connections, clients) should live on the struct, not be re-created per Execute. ## Testing Table-driven tests are the right shape: ```go func TestProducer_Execute(t *testing.T) { cases := []struct { name string params map[string]any input any wantErr bool }{ {"simple", map[string]any{"brokers": []string{"localhost:9092"}, "topic": "test", "value": map[string]any{"hello": "world"}}, nil, false}, {"missing topic", map[string]any{"brokers": []string{"localhost:9092"}}, nil, true}, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { n := New() err := n.Validate(tc.params) if (err != nil) != tc.wantErr { t.Fatalf("Validate: wantErr=%v got %v", tc.wantErr, err) } }) } } ``` For integration tests, m9m ships an in-process runner (`node.Runner`) that lets you execute a node against a fake workflow context without a Kafka cluster. ## Registering the node with m9m Two paths. **Compile-in registration** — add your node to a private m9m build. This is the simplest option for internal tools. ```go // in your custom main.go package main "github.com/neul-labs/m9m/cmd/m9m" "example.com/kafka" ) func main() { m9m.RegisterNode(kafka.New()) m9m.Run() } ``` **Plugin registration** — compile your node as a Go plugin (`buildmode=plugin`) and drop it into m9m's plugins directory. m9m loads it at startup. This is the right path for nodes you want to ship independently or share across multiple m9m installs without recompiling. See m9m's [plugin architecture docs](https://github.com/neul-labs/m9m/blob/main/docs/PLUGIN_ARCHITECTURE.md) for the details. Go plugins have real gotchas around matching Go versions and dependency sets between m9m and the plugin binary. If you control the m9m build, compile-in is simpler and faster to debug. ## Gotchas - **Don't block Execute on external locks.** Workflows can run 500 concurrently; a shared mutex becomes the bottleneck. - **Respect `ctx`.** Workflows can be cancelled. Any long operation should honor `ctx.Done()`. - **Return structured data.** Items should be `map[string]any` with JSON-serialisable values. Don't return Go types that only make sense inside your node. - **Fail loudly at Validate, not Execute.** Validate runs at workflow-load time, so users see errors immediately. Execute failures appear only when the workflow actually runs. ## Related - [Features](/features) - [Agent core](/agent-core) - [m9m vs n8n on extensibility](/compare/vs-n8n) --- ## Deploying m9m on CapRover URL: https://m9m.neullabs.com/guides/deploying-m9m-on-caprover/ Description: Step-by-step guide to deploying m9m on a CapRover host — captain-definition, Dockerfile, persistent volume, HTTPS, and backups. [CapRover](https://caprover.com) is a self-hosted PaaS that makes deploying Docker apps roughly as easy as Heroku. This guide walks through deploying m9m — the binary, the web UI, and a small persistent state directory — on a CapRover host, with HTTPS, backups, and a sensible resource envelope. If you are deploying m9m for the first time, this is the shortest serious path. ## What you need - A CapRover instance with a wildcard domain set up (e.g. `*.apps.example.com`). - Root or SSH access to the CapRover host for a one-time volume setup. - An existing m9m workflow JSON or the willingness to use `m9m demo` for the first run. ## Overview of the deploy - One CapRover app: `m9m`. - One persistent volume mounted at `/data` for workflow definitions, credentials (encrypted), audit logs, and run artifacts. - A small Dockerfile that pulls the official m9m binary and exposes port 8080. - An environment variable for the encryption key; everything else defaults. ## Step 1 — Write the Dockerfile ```dockerfile # syntax=docker/dockerfile:1.7 FROM alpine:3.20 ARG M9M_VERSION=latest RUN apk add --no-cache curl ca-certificates && \ curl -fsSL "https://github.com/neul-labs/m9m/releases/${M9M_VERSION}/download/m9m-linux-amd64" \ -o /usr/local/bin/m9m && \ chmod +x /usr/local/bin/m9m VOLUME ["/data"] EXPOSE 8080 ENV M9M_DATA_DIR=/data \ M9M_LISTEN=0.0.0.0:8080 CMD ["m9m", "serve"] ``` Check the m9m releases page for the exact tag format and adjust `M9M_VERSION` accordingly. ## Step 2 — captain-definition Next to the Dockerfile, a `captain-definition` file: ```json { "schemaVersion": 2, "dockerfilePath": "./Dockerfile" } ``` ## Step 3 — Create the CapRover app From the CapRover dashboard: 1. **Apps → Create New App** — name it `m9m`, enable persistent data. 2. **App Configs → Persistent Directories** — add `/data` → `m9m-data`. 3. **App Configs → Environment Variables** — set `M9M_ENCRYPTION_KEY` to a 32-byte random value. Generate with `openssl rand -hex 32`. 4. **Deployment → Method 3 (tarball / git)** — push your `Dockerfile` + `captain-definition` tarball or wire a git remote. On first deploy CapRover will build, pull the binary, and start the container. 5. **HTTP Settings** — set the domain (e.g. `m9m.apps.example.com`), enable HTTPS, enable "force HTTPS." ## Step 4 — Verify ```bash curl -I https://m9m.apps.example.com/ # HTTP/2 200 curl https://m9m.apps.example.com/healthz # {"ok":true} ``` Log in at the HTTPS URL, create an initial admin user when prompted, and import your first workflow. If you lose this key, all stored credentials become unrecoverable. Copy it into your password manager before doing anything else. Do not rotate it casually — rotation is supported but requires re-encrypting stored credentials. ## Step 5 — Back up `/data` CapRover persistent directories live on the host under `/captain/data/`. For backups, a nightly cron on the host is the simplest thing that works: ```bash # on the CapRover host, as root cat >/etc/cron.daily/m9m-backup <<'EOF' #!/bin/sh set -eu DEST=/var/backups/m9m mkdir -p "$DEST" tar -C /captain/data -czf "$DEST/m9m-data-$(date +%F).tgz" m9m-data find "$DEST" -mtime +30 -delete EOF chmod +x /etc/cron.daily/m9m-backup ``` If the host's filesystem is itself backed up (BorgBackup, Restic, rsnapshot), you can skip the cron and just include `/captain/data/m9m-data` in the existing job. ## Step 6 — Observability m9m exposes Prometheus metrics at `/metrics`. In CapRover, you can either: - **Scrape directly** from an external Prometheus with HTTP auth in front (CapRover Basic Auth, or a reverse-proxy middleware). - **Sidecar** — deploy a Prometheus + Grafana app on the same CapRover and add m9m to its scrape config. OpenTelemetry tracing is enabled by setting `OTEL_EXPORTER_OTLP_ENDPOINT` to your collector. One-span-per-node out of the box. ## Resource sizing For a typical 50-workflow tenant: - 2 vCPU, 2 GB RAM is comfortable headroom. - 10 GB of `/data` lasts ~6 months of audit logs at default settings. Turn on log rotation (`M9M_AUDIT_RETENTION=30d`) if storage is tight. - If you run sandboxed CLI agents heavily, add CPU — namespace isolation is cheap, agent inference is not. ## Upgrading 1. **Update `M9M_VERSION`** in the Dockerfile (or pin to a new tag). 2. **Re-deploy** from CapRover. 3. **Verify** `/healthz` and run one canary workflow. 4. **Roll back** if needed by redeploying the previous tag. Workflow JSON and credentials are forward/backward-compatible within the same major version. ## Common problems - **Port 8080 collision** with another CapRover app — change `M9M_LISTEN` to `:8081` and update the CapRover container port mapping. - **Webhook workflows 404-ing** — CapRover's default `nginx` config strips some headers; if you use webhook signature verification, make sure `X-Hub-Signature-256` (or equivalent) is preserved. Adjust the app's custom nginx snippet. - **Cold starts feel slow** — CapRover restarts the container on deploys. Cold start should still be under 1 s; if it isn't, check the `/data` volume for thousands of stale run directories and enable retention. ## Related - [Features](/features) - [For platform engineers](/for/platform-engineers) - [m9m vs Temporal](/compare/vs-temporal) --- ## Using MCP with m9m URL: https://m9m.neullabs.com/guides/mcp-with-m9m/ Description: How m9m's Model Context Protocol server works — the 37 tools it exposes, how to connect Claude Code or any MCP-aware LLM, and typical patterns. Model Context Protocol (MCP) is the missing API between LLMs and the tools they need. m9m ships an MCP server that exposes workflow-management primitives — list runs, start workflows, read logs, patch definitions, audit credential use — so an MCP-aware LLM can operate m9m itself. This guide walks through the tools, how to connect, and the patterns that make this useful rather than dangerous. ## What m9m's MCP server exposes 37 tools, grouped: - **Workflow management** — `workflow.list`, `workflow.get`, `workflow.create`, `workflow.update`, `workflow.delete`, `workflow.validate`. - **Runs** — `run.start`, `run.cancel`, `run.retry`, `run.logs`, `run.artifacts`, `run.status`. - **Nodes** — `node.list`, `node.describe`, `node.test`. - **Credentials** — `credential.list`, `credential.describe` (never `credential.read_secret` — the MCP surface never exposes secret values). - **Audit** — `audit.search`, `audit.stream`. - **Triggers** — `trigger.list`, `trigger.test`. - **Files** — `file.list`, `file.get`, `file.put` (scoped to workflow run artifacts). - **Workspace** — `workspace.list`, `workspace.get`. - **Plus** schema-introspection tools for `expression.eval`, `template.render`, and similar. Full list: `m9m mcp tools` on the command line. ## How to start the server ```bash m9m serve --mcp --mcp-port 8080 # or, over stdio for direct integration with Claude Code: m9m mcp stdio ``` For Claude Code, add m9m to `~/.config/claude-code/mcp.json`: ```json { "mcpServers": { "m9m": { "command": "m9m", "args": ["mcp", "stdio"], "env": { "M9M_URL": "https://m9m.internal.example.com", "M9M_TOKEN": "..." } } } } ``` Restart Claude Code; you should see `m9m.*` tools appear. ## Typical patterns **Agent-as-SRE.** An incident fires — a workflow is failing. You ask Claude Code: > "Find the workflow that's failing in production. Read the error. Patch it and re-run." Behind the scenes the agent calls `workflow.list` → filters by status → `run.logs` → diagnoses → `workflow.update` → `run.retry`. Every action is audited; the workflow edit is a Git commit. **Agent-as-author.** You describe a new workflow in English: > "Every morning at 9am, pull new GitHub issues tagged 'support' from repo X, summarise them with GPT-4, and post a digest to #support." The agent calls `node.list` → understands available node types → `workflow.create` with a draft → `workflow.validate` → iterates on errors → `trigger.test` → commits. **Agent-as-on-call.** An agent monitors `audit.stream` for anomalies (unusual cost spikes, repeated failures, credential use spikes) and pages humans before the humans notice. ## What we deliberately don't expose - **Credential secret values** — `credential.describe` returns metadata only. If the agent needs a secret, it uses `credential.use` to reference it in a workflow, never to read it. - **Host shell access** — no `exec` or `run_command` tool. If you want the agent to run shell, it goes inside a sandboxed `cli.*` node inside a workflow. - **User management** — the MCP surface is for workflows, not tenancy management. Users are managed via the admin UI and CLI. Treat an MCP token the same way you'd treat a service account with workflow-edit rights. Scope them per workspace; rotate them on a schedule; audit their use. ## Scoping and guardrails Tokens are scoped by workspace. A token issued for the `support` workspace can only see `support` workflows. You can further restrict: - **Read-only tokens** — for agents that observe but never edit. - **Dry-run mode** — all `workflow.update` calls create PRs against the workflow Git repo, not live edits. Humans review and merge. - **Cost caps** — per-token daily LLM-cost budgets (since an agent with MCP access _is_ an LLM burning tokens). These are the guardrails we recommend for any non-trivial deployment. An unscoped admin token and a capable model is a bad combination. ## Debugging MCP interactions Every MCP tool call is logged with inputs, outputs, duration, and the caller's identity. `m9m audit search mcp` gives you the tape. For interactive debugging, `m9m mcp inspect` replays a tool call against a local m9m instance with verbose tracing. If a tool doesn't appear in your MCP client, check: 1. The client is actually connected (`m9m mcp clients`). 2. The token has access to the tool's category (`m9m mcp tools --token ...`). 3. The client honours the server's `listChanged` notification — some clients cache tool lists and need a restart to see newly-granted tools. ## Related - [Agent core](/agent-core) - [Article: agent orchestration with m9m](/articles/agent-orchestration-with-m9m) - [For AI agent builders](/for/ai-agent-builders) --- ## Running Claude Code in a sandbox with m9m URL: https://m9m.neullabs.com/guides/running-claude-code-in-a-sandbox/ Description: How to use m9m's CLI node to run Claude Code (or Codex, Aider) inside a Linux namespace sandbox with CPU, memory, and network limits. Running a coding agent in production is the moment the "let's just give it shell access" plan catches up with you. This guide shows how to run Claude Code inside m9m's CLI node with namespace isolation, CPU/memory caps, a network allow-list, and an allow-listed command set — the minimum viable production posture. ## The threat model An LLM with shell access can, in the worst case: 1. Exfiltrate files it can read. 2. Make outbound network requests to arbitrary destinations. 3. Install packages that phone home. 4. Consume CPU / memory / disk far beyond what you intended. 5. Persist state on the host across runs. The sandbox closes each of these. ## The sandbox, layer by layer m9m's `cli.claude-code` node starts the agent in a fresh Linux namespace with: - **PID namespace** — the agent sees only its own processes. - **Mount namespace + chroot-ish view** — filesystem is read-only except for an explicit working directory. - **Network namespace + policy** — network is off by default; if you allow it, it's against an allow-list of hosts. - **cgroup CPU + memory limits** — hard caps, not advisory. - **User namespace** — the agent runs as an unprivileged UID inside its namespace. - **`allowed_commands`** — an allow-list of shell commands the agent may invoke. Anything else fails. Call it defence in depth: each layer alone could be bypassed; together they narrow the blast radius to something tractable. ## Minimal working node config ```json { "id": "claude-review", "type": "cli.claude-code", "params": { "sandbox": true, "cpu": 2, "memory": "2Gi", "network": "deny", "workdir": "/tmp/work", "prompt": "Summarise the diff below in three bullet points:\n{{ $node.fetch.diff }}", "timeout": "2m", "allowed_commands": [] } } ``` This is the safest starting posture: no network, no commands, two minutes, hard CPU/memory caps. The agent can read the working directory and write output to stdout — nothing else. ## When the agent needs the network If the agent needs to, say, fetch docs from a vendor or hit an internal API, expand the network policy — carefully. ```json "network": { "mode": "allow", "hosts": [ "api.anthropic.com", "docs.neullabs.com", "api.internal.example.com" ], "ports": [443] } ``` Rules of thumb: - Allow `api.anthropic.com` (and whatever inference endpoint the agent uses) — obviously required. - Don't allow `*` or `0.0.0.0/0`. Ever. - Prefer egress through a proxy you control, so you can audit exactly what the agent reached for. - Log every outbound connection from the sandbox for a week before trusting the allow-list. ## When the agent needs shell commands Some tasks genuinely need `git`, `rg`, `cat`, or a compiler. Add them to `allowed_commands`: ```json "allowed_commands": ["rg", "cat", "git", "go"] ``` Guidance: - Allow the smallest set that makes the task succeed. - Never allow `sh`, `bash`, `zsh`, `sudo`, `su`, `curl` (use `http.request` nodes upstream instead), `wget`, `pip`, `npm`, or package managers in general. - If the agent argues it needs `bash`, treat that as a sign the task is wrong-shaped, not that the allow-list is too strict. Do not build a list of "bad commands to block." You will miss one. Start from "nothing is allowed" and add the specific tools the task requires. ## Working directory hygiene The working directory is the only writable path. When the workflow starts, m9m mounts a fresh directory into the sandbox. When the node finishes, that directory is tar'd as a run artifact and then deleted. Nothing persists across runs unless you explicitly copy a file back out via the node's output. This is deliberate — it means "the agent wrote something weird last night" is always debuggable from the artifact, and "the agent installed something that broke tomorrow's run" is impossible. ## Timeouts Two timeouts matter: - **Node timeout** — how long the whole Execute may take. Set conservatively. 2–5 minutes for reviews, 10–15 for generation tasks. - **Agent internal timeout** — Claude Code / Codex each have their own idle timeouts. Let the node timeout be the outer bound. If a timeout fires, m9m kills the namespace and returns a timeout error. The workflow can catch that error and branch (retry, escalate to human, degrade gracefully). ## Observability Every sandboxed run emits structured events: start, exit code, resource usage peaks, network connections attempted, commands executed, stdout, stderr. These land in the audit log and surface as Prometheus metrics. For incident review, turn on the `sandbox.verbose` flag; for production, the default is adequate. ## A realistic end-to-end workflow ```json { "trigger": { "type": "webhook", "path": "/github/pr" }, "nodes": [ { "id": "verify", "type": "github.webhook.verify", "params": { "secret": "{{ $cred.github_webhook }}" } }, { "id": "fetch", "type": "github.pr.get", "params": { "pr": "{{ $json.pr_url }}" } }, { "id": "review", "type": "cli.claude-code", "params": { "sandbox": true, "cpu": 2, "memory": "2Gi", "network": { "mode": "allow", "hosts": ["api.anthropic.com"], "ports": [443] }, "workdir": "/tmp/work", "allowed_commands": ["rg", "cat"], "prompt": "Review this diff for security issues. Be specific; cite file:line.\n\n{{ $node.fetch.diff }}", "timeout": "5m" }}, { "id": "approve","type": "human.review", "params": { "notify": "#eng-reviews" } }, { "id": "post", "type": "github.pr.comment", "params": { "body": "{{ $node.review.output }}" } } ] } ``` PR webhook → signature verify → diff fetch → sandboxed Claude Code with just the network it needs → human approval → posted comment. ## Related - [Agent core](/agent-core) - [Guide: MCP with m9m](/guides/mcp-with-m9m) - [Article: agent orchestration with m9m](/articles/agent-orchestration-with-m9m) --- # Articles ## Agent orchestration with m9m: sandboxing, MCP, and human review in one binary URL: https://m9m.neullabs.com/articles/agent-orchestration-with-m9m/ Description: How to run production AI agents on m9m — sandboxed CLI nodes for Claude Code / Codex / Aider, MCP tool exposure, checkpoints, and human-in-the-loop flows. If you've built an agent, you know the split. The model is ~10% of the work. The other 90% is scaffolding: retries, timeouts, rate limits, cost caps, sandboxing, human review, observability, audit logs. Workflow engines have been doing that 90% for a decade. m9m is the runtime that lets you reuse it — without giving up on the agent-shaped nodes you actually want. This article walks through how agent orchestration works in m9m: what a CLI node looks like, how MCP integration works, how checkpoints survive crashes, and how to wire a human-review step. ## The CLI agent node A CLI node runs a command-line tool (Claude Code, Codex, Aider, or your own binary) inside a sandboxed environment. It takes a sandbox spec and a prompt; it returns stdout, stderr, exit code, and any file artifacts. ```json { "id": "review", "type": "cli.claude-code", "params": { "sandbox": true, "cpu": 2, "memory": "2Gi", "network": "restricted", "workdir": "/tmp/work", "prompt": "Review this diff for security issues:\n{{ $node.fetch.diff }}", "timeout": "5m", "allowed_commands": ["rg", "cat", "git"] } } ``` Under the hood, m9m starts a process in a fresh Linux namespace (PID, mount, network, UTS, IPC, user), applies cgroup limits for CPU and memory, restricts network access to an allow-list (or denies it entirely), and mounts the working directory read-write while the rest of the filesystem is either read-only or invisible. When the agent exits, the namespace is torn down. Nothing persists. The `allowed_commands` list is an allow-list. Anything not on it fails. This is the opposite of "try to detect bad commands," which is a game you do not want to play against a model with shell access. ## MCP — when the agent manages the agent m9m ships an MCP server. Start it with `m9m serve --mcp --port 8080` and any MCP-aware LLM can discover 37 tools: - `workflow.list`, `workflow.get`, `workflow.create`, `workflow.update`, `workflow.delete` - `run.start`, `run.cancel`, `run.logs`, `run.retry`, `run.artifacts` - `node.list`, `node.describe` - `credential.list`, `credential.use` - `audit.search`, `audit.stream` - ... and more. This unlocks a pattern we keep reaching for: one m9m workflow _is_ the orchestrator, and sub-agents talk to it over MCP. The orchestrator handles scheduling, retries, and checkpointing; the agents handle reasoning. Failures surface as structured run logs; the orchestrator decides whether to re-run, escalate to a human, or give up. Every MCP action is audited. Every workflow edit is versioned in Git. That last point matters more than people expect — it means an agent can refactor a workflow and you get a PR-shaped record of what changed and why. ## Checkpoints and human review A workflow can include a `human.review` node. When execution reaches it, m9m pauses and emits a resumable token. The workflow stops consuming resources. When a human approves (via the UI, API, or another workflow), the run resumes from exactly that point. Same mechanism handles crashes — state is checkpointed between nodes, so a killed process resumes from the last checkpoint, not from the top. This is the piece most ad-hoc agent frameworks skip, and it is the piece that matters most in production. Agents fail. You need to pause, show a human the evidence, and let them decide — without re-running the first twenty minutes of work. ## Cost controls Three layers: 1. **Per-run** — a workflow can declare a max cost; m9m refuses to start LLM nodes that would exceed it. 2. **Per-workflow** — rolling budgets over a time window. 3. **Per-workspace** — tenant-level caps for multi-team deployments. Cost is tracked per-node, per-run, and exposed as Prometheus metrics. ## A worked example: PR reviewer A common starter setup. ```json { "trigger": { "type": "webhook", "path": "/github/pr" }, "nodes": [ { "id": "verify", "type": "github.webhook.verify", "params": { "secret": "{{ $cred.github_webhook }}" } }, { "id": "fetch", "type": "github.pr.get", "params": { "pr": "{{ $json.pr_url }}" } }, { "id": "review", "type": "cli.claude-code", "params": { "sandbox": true, "cpu": 2, "memory": "2Gi", "prompt": "Review this diff. Focus on security and data-loss risks:\n{{ $node.fetch.diff }}", "timeout": "5m" }}, { "id": "approve", "type": "human.review", "params": { "notify": "#eng-reviews" } }, { "id": "post", "type": "github.pr.comment", "params": { "body": "{{ $node.review.output }}" } } ] } ``` Webhook from GitHub → signature verify → pull diff → sandboxed Claude Code → human approval in Slack → posted comment. One JSON file. One binary. If it crashes mid-review, it resumes from the last checkpoint. If the human declines, the PR comment never goes out. ## Where this doesn't fit - **Research agents doing exploratory work in a notebook.** m9m is overkill — run your Python script. - **Agents with multi-hour reasoning chains that need fine-grained retry semantics per sub-step.** Look at LangGraph or a custom Python orchestrator. (You can still run those _inside_ an m9m CLI node, though — and you probably should in production.) - **Pure research without deployment pressure.** Skip the scaffolding entirely. ## Related - [Agent core page](/agent-core) - [Guide: running Claude Code in a sandbox](/guides/running-claude-code-in-a-sandbox) - [Guide: MCP with m9m](/guides/mcp-with-m9m) - [m9m vs LangGraph](/compare/vs-langgraph) --- ## Migrating ~80 production n8n workflows to m9m: a field report URL: https://m9m.neullabs.com/articles/n8n-to-m9m-migration-story/ Description: What actually happens when you port a production n8n install to m9m — which workflows crossed over unchanged, which needed work, and what it cost in engineer-days. This is a condensed field report on migrating a production n8n install — roughly 80 workflows across business ops, data sync, and support automation — to m9m. Names and specifics are anonymised; the numbers are real. ## Setup before migration - n8n self-hosted on a single 4 vCPU / 8 GB VM, Postgres backing store. - ~80 active workflows across four tenants: marketing, data, support, and a small agent-experiments team. - Pain points, in order: (1) slow cold starts on webhook-triggered workflows, (2) memory spikes that OOM-killed the container twice a month, (3) community nodes pinning them to specific n8n versions, (4) no good story for sandboxing the agent-experiments team's Claude Code runs. ## Audit — day one We ran a script over the n8n export bucketing workflows by node type coverage. Bucketing rules: - **Green** — uses only core n8n nodes that m9m supports unchanged. - **Yellow** — uses one or two community nodes that can be re-expressed as HTTP calls. - **Red** — uses a community node that is structurally not expressible as HTTP (rare — typically UI nodes or tightly-integrated auth flows). Result: 63 green, 14 yellow, 3 red. ## Shadow run — week one We mirrored all 63 green workflows to m9m, triggering them on the same cron schedules and webhooks, but routing outputs to staging destinations. The diff tooling compared m9m's output JSON to n8n's for every run. Findings: - **59 of 63** produced byte-identical outputs. - **3 workflows** had ordering differences in Merge nodes that turned out to be non-deterministic in n8n too — m9m's output was more stable, but not identical. No action needed. - **1 workflow** hit a timezone mismatch — an expression using `{{ $now.format('YYYY-MM-DD') }}` in a cron context. m9m defaults to UTC; n8n to server local. Fixed by adding explicit timezone. Total engineer-time for the shadow run: 1.5 days including the diff tooling. ## Re-expressing community nodes — week two The 14 yellow workflows used a mix of: a Stripe-specific node, a custom HubSpot connector, and an OCR-by-a-specific-vendor node. Each was replaced with an HTTP Request node using the vendor's REST API. The one non-trivial case: the OCR node streamed a file upload as `multipart/form-data` with a specific field ordering the vendor silently required. We discovered this by comparing request payloads with `mitmproxy`. Two hours of debugging; one comment in the workflow JSON explaining the non-obvious field order. Total engineer-time: 3 days. ## Custom Go nodes — week three Two of the three red workflows needed genuine custom logic: a proprietary file format parser and a rate-limited vendor SDK that doesn't expose a clean HTTP surface. We wrote both as custom Go nodes. Each node was ~200 lines of Go, with table-driven tests. m9m's node interface is three methods — `Execute`, `Describe`, `Validate` — so the learning curve was short. The third red workflow we retired; it was a legacy report no one had opened in six months. Total engineer-time: 4 days (2 nodes × 2 days). ## Cut-over — week four Per-tenant cut-over, one tenant a day: 1. Pause n8n workflows for the tenant. 2. Enable m9m equivalents. 3. Watch logs for the day. 4. Delete n8n equivalents one week later. Rollback plan: re-enable n8n. We never used it. Total cut-over engineer-time: 2 days of watching logs. ## Outcome - **Total migration time**: ~11 engineer-days, spread across a calendar month. - **Infra footprint**: down from 4 vCPU / 8 GB + Postgres to 2 vCPU / 2 GB, no external database. Monthly infra bill dropped ~$180. - **Cold-start pain**: gone. Webhook latency p50 down from 2.8 s to 180 ms. - **OOM kills**: zero in the six months since cut-over. - **Sandboxing**: the agent-experiments team retired their ad-hoc Docker wrapper and moved to m9m's CLI nodes with namespace sandboxing. A separate write-up covers that work. ## Gotchas worth naming - **Timezone defaults** differed, as above. Audit any expression that uses `$now` or `$today`. - **Credential re-entry** was mechanical but tedious. We scripted it against a password manager export to save the afternoon. - **Retry semantics** around flaky HTTP nodes: n8n's default was "retry on any error up to 3 times, 5 s back-off"; m9m's default is "no retry, fail fast." We explicitly set retry policies on HTTP nodes that needed them and documented the new default. - **Community node pin** meant we had been stuck on an old n8n version for security reasons. Migrating away removed that pin entirely — an unquantified but real win. Most are. Neul Labs runs fixed-price migration audits for teams of this size. We'll tell you, in writing, how green/yellow/red your workflows are, and what the cut-over calendar looks like. [Consulting page](/consulting). ## What we would do differently - Build the diff tooling earlier. Knowing, concretely, that 59/63 workflows produced identical output gave us the confidence to move fast on cut-over. We wish we'd had that on day one, not day three. - Start the custom-node work in parallel with the shadow run, not after. The nodes had a longer tail than we expected. - Write the runbook for rollback explicitly, even though we never used it. The exercise surfaced two ordering assumptions that would have been painful under real incident pressure. ## Related - [n8n migrators landing page](/for/n8n-migrators) - [m9m vs n8n comparison](/compare/vs-n8n) - [Guide: building a custom node in Go](/guides/building-a-custom-node-in-go) --- ## What is m9m? A zero-infra workflow runtime for the agent era URL: https://m9m.neullabs.com/articles/what-is-m9m/ Description: m9m is a single-binary Go workflow automation runtime with n8n compatibility and first-class AI agent orchestration. Here is what it is, why it exists, and where it fits. m9m is a **single-binary, Go-native workflow automation runtime** that runs your n8n workflows 5–10× faster and treats AI agent orchestration as a first-class capability. It ships as a ~30 MB binary with no Node runtime, no required database, and no container dependencies. Cold start is under 500 ms. It fits on a free-tier VPS and embeds inside other products via Go, Python, and Node.js SDKs. This article is the long-form version of that sentence. It answers: what does m9m actually do, why does it exist, how does it compare to the other tools in the space, and when is it the right pick. ## The one-paragraph answer m9m executes workflows. A workflow is a directed graph of nodes — fetch an HTTP endpoint, run a SQL query, transform JSON, call an LLM, post to Slack. Nodes can be triggered by cron schedules, incoming webhooks, or direct CLI invocation. m9m reads the same JSON workflow format as n8n, supports the same expression syntax, and ships 32 of the most-used node types. In addition, it runs **sandboxed CLI agent nodes** (Claude Code, Codex, Aider) inside Linux namespaces, and exposes an **MCP server** with 37 tools so an external LLM can manage m9m itself. ## What is m9m _not_ - It is not a visual workflow editor with the UX polish of n8n. There is a web UI, but it is utilitarian. The authoring experience is JSON-first. - It is not a long-running durable-execution engine in the Temporal sense. Workflows checkpoint and resume after crashes, but if you need multi-month workflows with cross-region replication, Temporal is a better fit. - It is not an agent framework. You still write your agent in PydanticAI, LangGraph, CrewAI, or the Anthropic SDK. m9m is where that agent _runs_. ## Why it exists Two trends collided. **Workflow engines got slow.** The Node.js-based generation of tools (n8n, Tines, Pipedream) ask for ~512 MB of memory per instance, 3-second cold starts, and container sizes north of 1 GB. That is fine at demo scale and punishing at platform scale. A team running a few hundred workflows on a $50/month VPS ends up with two choices: pay 10× for bigger infra, or wait for everything. **Agent infrastructure fragmented.** Production agent systems need retries, timeouts, checkpoints, cost caps, sandboxing, audit logs — the same infrastructure workflow engines solved a decade ago. But the agent ecosystem grew up in Python, with LangGraph and custom orchestrators, disconnected from the n8n/Zapier world. Platform teams end up running two orchestration stacks for what is, structurally, the same problem. m9m is the bet that these two stacks should be one, written in Go, shipped as a single binary, and deployable to a $10 box. ## The numbers From the project [README](https://github.com/neul-labs/m9m), reproducible with `m9m benchmark`: | Metric | m9m | Node-based alternative | |---|---|---| | Cold start | ~500 ms | ~3 s | | Memory (idle) | ~150 MB | ~512 MB | | Container size | 300 MB | 1.2 GB | | Concurrent workflows | 500 | 50 | The speedup on workflow execution is typically 5–10×. The compound effect of faster startup and higher concurrency is what makes m9m feasible on small infra. ## How it runs your existing n8n workflows m9m reads n8n's workflow JSON schema directly. Node IDs, connections, trigger definitions, and parameters all map across. Expression syntax (`{{ $json.field }}`, `{{ $node["HTTP Request"].data }}`) evaluates with the same built-in function set. What doesn't cross over: - **Community nodes** from n8n's registry — m9m ships 32 core node types; community nodes are either re-expressed as HTTP calls or ported as custom Go nodes. - **Credential data** — re-enter credentials on the m9m side. The formats (including OAuth2 flows) match. In practice, for the teams we have migrated, roughly 80–90% of workflows cross over unchanged, 10% need a small patch, and a handful need a custom node. See the [migration case study](/articles/n8n-to-m9m-migration-story) for the details. ## How it runs agents A CLI agent is a node type. You point it at Claude Code, Codex, or Aider, specify a sandbox (namespaces, CPU, memory, network), and supply a prompt. m9m spawns the agent in isolation, captures input/output, and returns artifacts. No host-level escape surface. No global state. An MCP server ships with m9m. It exposes 37 tools — `workflow.list`, `run.start`, `run.logs`, `workflow.update`, `credential.list`, and so on — over Model Context Protocol. Any MCP-aware LLM can point at m9m and manage it: re-run a failed workflow, patch a retry policy, pull audit logs. Every action is audited; every workflow edit is versioned in Git. See the [agent core page](/agent-core) for the full treatment. ## Where m9m fits **Good fits:** - Teams on n8n that want the same workflows at a tenth of the infrastructure cost. - Platform teams unifying business-ops, data, and agent automation on one runtime. - Product teams that need to embed a workflow engine inside their own product. - Any team shipping agent products that needs sandboxing, MCP, human review, and audit logs without gluing five tools together. **Worse fits:** - Teams whose primary need is a polished drag-and-drop editor for non-technical users. - Teams with multi-month durable workflows that need strong cross-region consistency. - Pure research agent pipelines that don't need a runtime — just a Python script. If you're evaluating: [Why m9m](/why-m9m). If you're migrating: [n8n migration guide](/for/n8n-migrators). If you're building agents: [agent core](/agent-core). If you want help: [consulting](/consulting). ## FAQ **Is m9m a drop-in replacement for n8n?** For the backend execution path, largely yes — 32 node types and the n8n expression engine cover the bulk of typical workflows. The editor experience is more minimal than n8n's, so if your team heavily uses n8n's visual editor, consider keeping n8n for authoring and using m9m for execution. **Is m9m open source?** Yes, MIT-licensed. Source at [github.com/neul-labs/m9m](https://github.com/neul-labs/m9m). **What language is m9m written in?** Go 1.21+. Workflow execution is native Go; inline JavaScript and Python nodes are supported for custom logic. **What does m9m cost?** Free. MIT license. No paid tier. [Neul Labs](/consulting) sells consulting — design, migration, agent platform build-out, and SLA support — for teams that want it. --- # Use cases ## AI agent orchestration URL: https://m9m.neullabs.com/use-cases/ai-agent-orchestration/ Description: Orchestrate Claude Code, Codex, and Aider as sandboxed m9m workflow steps with resource limits, audit logs, and human review. **Problem.** Coding agents are powerful but unbounded: given a shell they can touch anything on the box, and there is no record of what they did. Bolting a separate agent stack next to your automation tool doubles the infrastructure and still leaves the sandboxing to you. **Solution.** m9m treats agent orchestration as first-class. CLI nodes launch Claude Code, Codex, or Aider inside Linux namespaces with CPU, memory, and network limits, and every action is written to the audit log. The same workflow can gate the agent behind a human-review step and re-run it on failure. --- ## Replace a heavy n8n install URL: https://m9m.neullabs.com/use-cases/n8n-replacement/ Description: Drop your n8n memory and container footprint by running the same workflow JSON on m9m — one binary, no Node runtime, no database. **Problem.** A production n8n install carries a Node.js runtime, a database, and hundreds of megabytes of RAM at rest. Scaling it means containers and a cluster, even for modest automation loads. **Solution.** m9m imports n8n workflow JSON unchanged — same node names, same {{ $json.field }} expressions, same cron and webhook triggers — and runs it from a single ~30 MB binary. The README figures are ~150 MB memory at rest versus ~512 MB, a ~300 MB container versus ~1.2 GB, and roughly 500 concurrent workflows per process. --- ## Scheduled jobs & cron on a VPS URL: https://m9m.neullabs.com/use-cases/scheduled-jobs/ Description: Run scheduled ETL, reports, and sync jobs as versioned m9m workflows on a small VPS, with retries, audit logs, and Prometheus metrics. **Problem.** Cron scripts drift: no versioning, no retries, no visibility into why last night’s job failed. Moving them to a hosted automation platform adds cost and a Node stack you have to operate. **Solution.** m9m gives you cron and webhook triggers, HTTP and database nodes, retries, Git-based versioning, audit logs, and Prometheus metrics — all in one binary you can drop on a small VPS. Enterprise-grade observability without an enterprise tier. ---