Purple Flow's 512MB Workflow Engine: How AI-First Automation Runs 10,000+ Workflows Without a Database Purple Flow, an early-stage AI-first workflow engine, runs 10,000+ concurrent LLM-driven workflows in 512MB of RAM without a database, keeping all active state in an in-memory hash map and treating LLM tool-calling loops as first-class execution primitives. The design trades durability and observability for a small footprint: in-flight workflows are lost on crash, eviction is purely time-based with no LRU or memory-pressure detection, and logging goes only to stdout. The project is nascent, with 15 GitHub stars and a modest Show HN showing. Purple Flow positions itself as an AI-first n8n alternative that runs 10,000+ concurrent workflows in 512MB of RAM without a database. That constraint forces architectural decisions most workflow engines avoid: no Postgres for state, no Redis for queues, no persistent job tables. Everything lives in memory, which means the plumbing has to handle eviction, crash recovery, and LLM tool calls without the usual safety nets. The project is early 15 GitHub stars, Show HN with 5 points , but the resource budget exposes interesting trade-offs. When you can't lean on a database to serialize workflow state or retry failed steps, you need different primitives for durability, observability, and agent coordination. Purple Flow treats LLM calls as first-class workflow primitives, not afterthoughts bolted onto HTTP nodes. The engine embeds tool-calling loops directly into the execution graph. Instead of defining a workflow as a DAG of HTTP requests and transformations, you define it as a sequence of agent interactions where the LLM decides which tools to invoke next. This changes the orchestration model: The architecture assumes workflows are short-lived and LLM-driven. Long-running jobs with complex retry logic or multi-day pauses don't fit this model. The engine optimizes for rapid agent loops where the LLM makes decisions in seconds, not hours. Purple Flow keeps all active workflow state in RAM using a hash map keyed by workflow ID. Each entry holds: When a workflow completes or times out, the engine evicts it from memory. There's no write-ahead log, no checkpoint to disk. If the process crashes, in-flight workflows are lost. The 10,000+ workflow claim depends on keeping per-workflow state small. A typical entry might be: { "workflow id": "wf abc123", "status": "running", "current step": 3, "messages": {"role": "user", "content": "Scrape pricing from example.com"}, {"role": "assistant", "tool calls": {"name": "http get", "args": {"url": "..."}} }, {"role": "tool", "content": "{\"price\": 49.99}"} , "created at": 1732024800, "timeout at": 1732025100 } At ~5KB per workflow assuming compact JSON and short tool outputs , 10,000 workflows fit in 50MB. The remaining 462MB handles the runtime, LLM client libraries, and HTTP server overhead. Purple Flow uses a time-based eviction strategy: There's no LRU cache or memory pressure detection. If you exceed 512MB, the process will OOM. The engine assumes you size your deployment to match expected concurrency. Without a database, Purple Flow can't replay workflows after a crash. The engine treats failure recovery as an application-layer concern: This shifts durability responsibility to the workflow author. If you need guaranteed execution, you wrap Purple Flow in a supervisor that persists workflow definitions and retries on failure. | Failure Scenario | Purple Flow Behavior | Mitigation Strategy | |---|---|---| | Process crash | All in-flight workflows lost | External supervisor retries from start | | LLM API timeout | Workflow marked failed, kept in memory until TTL | Client retries entire workflow | | Tool call exception | Workflow fails, error logged to stdout | Idempotent tools + client retry | | Memory exhaustion | Process OOM kills | Scale horizontally or reduce concurrency | Purple Flow logs workflow events to stdout in JSON format. There's no built-in metrics endpoint or trace storage. Observability depends on external log aggregation: For production use, you'd pipe logs to Loki or Datadog and build dashboards around workflow ID patterns. The engine itself doesn't track success rates, P95 latency, or error budgets. Purple Flow runs as a single-process HTTP server. You scale by running multiple instances behind a load balancer. Each instance is stateless no shared memory , so workflows can't span processes. Typical deployment: The engine doesn't coordinate across instances. If you need workflow affinity same workflow always routes to the same instance , you implement sticky sessions at the load balancer. Purple Flow's core loop is a recursive agent step executor. Simplified version: python async def execute workflow workflow id: str, user input: str : state = { "workflow id": workflow id, "messages": {"role": "user", "content": user input} , "max steps": 10, "current step": 0 } while state "current step" < state "max steps" : Call LLM with conversation history and tool schemas response = await llm client.chat messages=state "messages" , tools=AVAILABLE TOOLS if response.tool calls: Execute each tool call and append results for tool call in response.tool calls: result = await execute tool tool call.name, tool call.args state "messages" .append { "role": "tool", "tool call id": tool call.id, "content": json.dumps result } state "current step" += 1 else: LLM returned final answer, workflow complete return response.content raise Exception "Max steps exceeded" The engine stores state in the in-memory hash map. If the process dies mid-loop, the state is gone. Purple Flow's architecture optimizes for simplicity and low resource usage. That creates predictable failure modes: These aren't bugs. They're trade-offs for running in 512MB. If you need durability, you add a supervisor. If you need backpressure, you add a queue in front of Purple Flow. Use Purple Flow when: Avoid Purple Flow when: Purple Flow is a proof-of-concept for stateless agent orchestration. It shows you can run thousands of concurrent LLM workflows in a tiny memory footprint if you're willing to give up durability. For production systems, you'd wrap it in a supervisor that persists workflow definitions and retries on failure. For prototypes or ephemeral tasks, it's a clean way to chain tool calls without standing up Postgres.