Case study · Open source

DagNats

A DAG workflow engine for durable jobs and autonomous LLM coding pipelines. One Go binary, an embedded NATS server, and step types — AgentLoop, Planner, Approval, Continue-As-New — that other engines treat as application-layer concerns.

NATS JetStream embedded · Event-sourced state · One process · scp + run

Project

Durable workflow engine

Engagement

Original engine design and build

Status

v0.1 · alpha · open source

Overview

DAGs that survive restarts.

Describe work as a directed acyclic graph of tasks. The engine runs the graph, retries failures, recovers from crashes, and reconstructs state from an immutable event log.

The deploy is scp dagnats user@host && ./dagnats serve. No Postgres to migrate, no Redis to monitor, no broker to configure. The embedded NATS server is the entire substrate.

DagNats documentation, primary view

Step types

Agent loops are first-class.

Most engines treat “run an agent until it’s done” as application-layer code you write per project. DagNats ships those primitives in the workflow language.

AgentLoop

Run until done

An agent that calls tools, observes results, and decides when to stop — bounded by an explicit turn limit, recoverable across restarts.

Planner

Decompose then dispatch

Generate a sub-DAG of work from a brief, then run the sub-DAG through the same engine — recursion as data, not call stack.

Approval

Pause for a human

Halt the run, surface a question to a human, and resume the workflow when an external signal arrives.

Continue-As-New

Bounded recursion

Carry state into a fresh run instead of unbounded loops — explicit, audit-friendly, terminating.

Architecture

JetStream is the entire system.

All workflow state lives in NATS JetStream — durable streams for events, KV buckets for snapshots and run metadata. There is no separate database.

DagNats architecture diagram

Compared to neighbors

Lighter than Temporal. Self-hostable in one binary.

Temporal, Hatchet, and Inngest each have their place. DagNats is the niche where native agent step types, a one-binary deploy, and zero external databases all matter.

DagNats comparison table

Specifications

One process. One wire format.

Language

Go (no CGo)

Module

github.com/danmestas/dagnats

Transport

NATS JetStream (embedded)

State

Event-sourced + KV snapshots

Binaries

1 — dagnats serve

SDKs

Go · HTTP bridge

Discipline

TigerStyle · bounded loops

License

Apache-2.0 · alpha

Related

The orchestration layer.

DagNats orchestrates work that libfossil stores and EdgeSync distributes — three pieces of one substrate for autonomous coding agents.

Reach out

Questions about the engine, want to use it for something, or just want to compare notes — send me an email.

[email protected]