Farmium — Platform
Co-Founder · Production platformA multi-tenant workflow automation platform whose execution engine borrows tricks from CPU architecture
Farmium is a production SaaS for composing, versioning, and running complex automation workflows as directed acyclic graphs. The core is a half-million-line TypeScript/Vue platform whose parallel DAG engine does cost-aware speculative execution, Merkle-style computation caching, and Bayesian/evolutionary optimization — wrapped in real-time collaborative editing and a full observability stack.
Half a million lines of typed code, organized into a 54-module backend and a 409-component frontend
The metrics panel captures the operating envelope this platform is engineered around. The backend is roughly 290K lines across 670 TypeScript files — 200+ services and 93 controllers over 110 database models grouped into 54 modules. The frontend adds about 200K lines across 409 Vue 3 components, including a collaborative visual editor. The DAG graph itself supports 60+ strongly-typed node kinds with static type inference and runtime type guards. These are the real dimensions the architecture has to stay coherent across, not a marketing rounding.
A parallel DAG engine with CPU-style speculative execution at its core
The detail panel goes deep on the heart of the platform: a parallel DAG execution engine spanning 152 files and roughly 68K LOC. It owns the full execution lifecycle — scheduling and running independent nodes concurrently, threading pipelines, evaluating conditional branches, and driving control flow like loops, switches, and approval gates. On top of that sits something unusual for a SaaS: cost-aware speculative execution. A 2-bit saturating-counter Branch Target Buffer, modeled directly on CPU branch predictors, learns which branches tend to be taken and pre-runs them — but only when the expected savings justify the cost, so it never speculates into work too expensive to discard.
A Merkle-style computation cache, then a search engine layered on top of the workflow itself
This detail panel covers how expensive work is never repeated, and how workflows tune themselves. Expensive node outputs are deduplicated through a Merkle-style computation cache: each key is a composable SHA-256 over workflowId, nodeType, codeVersion, config, and inputs, with deterministic canonicalization so identical work collapses to a single entry — even across different pipelines. Layered above it is an optimization system that treats a workflow as a search space, using A/B testing plus Bayesian and evolutionary search to tune node parameters against a multi-objective score balancing quality, cost, and time.
A collaborative visual editor with IDE-grade inspection over live execution
The detail panel describes the front-of-house: the visual editor is collaborative in real time. CRDT-based editing (Yjs) lets multiple people shape the same workflow without conflicts, while WebSocket gateways stream live execution progress, per-node state transitions, and notifications back to every connected client. The frontend pairs this with git-style visual version control and diffing, a node-level debugging panel that previews each node's output, and a batch-processing UI — so authoring feels like drag-and-drop but ships with the inspection tools of an IDE.
Behavioral security intelligence and end-to-end observability across the whole estate
The final detail panel covers the operational backbone. A behavioral security engine profiles login activity to flag anomalies — impossible travel, brute force, credential stuffing — then risk-scores sessions and triggers automated responses. Billing stays correct under concurrency through atomic credit deduction with deadlock detection, retry, and idempotency. And everything is observable end to end: Prometheus metrics, Grafana dashboards, distributed tracing, error tracking, and centralized log aggregation across the 54-module backend, so failures are seen before they spread.