Duna runs the long-lived work between people, systems and AI agents: approvals that take days, payments that fail, shipments that go missing. Draw the process, give its agents governed tools, test it against mocks, run it on PostgreSQL and plan the way back before you need it.
docker compose up -d --buildA process is a set of states joined by transitions. At every state the engine follows the same order: onEntry, the wait, a transition, then onExit. Watch one instance go through a review step.
01EnterThe instance arrives at manual-review. The engine writes a state-enter entry to its history.
The instance arrives at manual-review. The engine writes a state-enter entry to its history.
The state's onEntry actions run in the order they are written, one at a time. Each can write its result to a variable.
This is a human state, so the instance parks. A task is created for the reviewer role and the state is saved in PostgreSQL. Nothing holds a thread while it waits.
A reviewer completes the task. The answer is written to vars.decision and the instance wakes up.
Transitions are tried in priority order. The first whose guard is true wins, and a default catches the rest. Here vars.decision === 'approve' holds.
The chosen transition can carry actions of its own. They run now, before the state is left.
Then the state's onExit actions run. They run on every normal exit, whichever transition was taken.
The instance enters approved and that state's onEntry begins. Every step leaves a history entry and a snapshot of the variables.
Every part of Duna has its own line colour, on this site and in the diagrams. Pick a line to see what it does, or read the whole map on the product page.
Draw the process on a canvas. Keep every decision in a versioned JSON definition.
Wait for people, events, messages and time. PostgreSQL keeps the thread.
Model the way back: retries, undo steps newest first, transaction groups.
Simulate drafts, run real HTTP against mocks, save scenarios with verdicts.
Run a short Python or Node.js script, or your own image, in a locked-down container.
HTTP, databases, brokers, mail, files and Redis as first-class actions.
OIDC sign-in, every decision through Open Policy Agent, company scoping.
A history of every step, a heatmap on the canvas, and explicit recovery controls.
Explanations, reviews and proposed changes. You review, apply and test.
States, guarded transitions and actions sit on a canvas that lays itself out with ELK and routes its edges at right angles. Every change lands in the same JSON definition: open the source view, format it, read the diagnostics, publish, and compare versions side by side.
Read the definition modelThe canvas lays itself out with ELK. Drop a state, connect it, and fill the typed form for each action.
An instance parks while it waits: for a human task with declared outcomes and an SLA, for an event or a broker message, for a timer or a cron schedule. Its state lives in PostgreSQL, so a restart resumes the process instead of losing it. Loops, parallel branches and child processes belong to the same definition.
Read about tasks and timers| Since | Instance | State | Status |
|---|---|---|---|
| 09:14 | A-100 | manual-review | WAITING · HUMAN |
| 09:15 | O-118 | awaiting-delivery | WAITING · EVENT |
| 09:20 | P2P-7 | budget ∥ compliance | FORK · 1 OF 2 |
| 10:00 | R-42 | send-reminder | TIMER · CRON |
| 10:02 | O-117 | delivered | COMPLETED |
Each action can declare its error route, its retry policy and its own undo step. When a later step fails, Duna runs the recorded undo steps newest first, across fork branches too. Database work can share a transaction group that retries as a whole, with a checkpoint after each group and durable claims, so a crash narrows to a known window instead of an unknown one.
Compensation is business logic you model, not a distributed rollback. A transaction group narrows the crash window; it is at-least-once, not atomic, so external effects still need idempotency.
Read about compensationSimulate an unpublished draft on a throwaway engine with stubbed side effects, or run it for real against WireMock mock services that answer slowly, drop the connection or fail twice before they succeed. Save the scenarios beside the definition, check them with fourteen kinds of assertion, and run them headless in CI with JUnit output.
Read about Test Studio503timeout200 · chargedpasspasspassA container action hands a JSON input to a short script (Python 3.13 or Node.js 24) or to your own image pinned by digest, and takes the JSON it prints as the action's value. A separate runner starts it as a non-root user on a read-only file system with no network, unless the action asks for its company's allow-list. The instance parks while it runs.
Off by default. A host runs container actions only with the runner configured and the company granted the runtime, image or network in its policy.
Read about container actions{
"id": "calculate-risk",
"type": "container",
"assignTo": "risk",
"timeoutMs": 120000,
"config": {
"mode": "script",
"runtime": "python-3.13",
"script": "import json,sys\nx=json.load(sys.stdin)\nprint(json.dumps({'risk':'high' if x['amount']>10000 else 'low'}))",
"input": { "amount": { "$expr": "vars.amount" } },
"memoryMb": 256,
"network": "none"
}
}Every instance keeps a timeline with a variable snapshot after each step, so you can step back through what happened. The performance heatmap folds that history onto the canvas: where instances wait, where they fail and which transitions they take. Operators retry, move, suspend, resume or cancel, with a dry run first.
Read about operationsThirteen built-in action types share one envelope: a condition, a timeout, an idempotency key, an error route and an undo step. Call HTTP services, query named database connections, publish to brokers, send mail with attachments and move files through an S3-compatible store.
Call existing APIs with headers, bodies, files and multipart forms.
type: httpNamed connections, with database work grouped into transaction groups.
type: db · PostgreSQL · SQL Server · OraclePublish messages, wait for them, or start a process when one arrives.
type: publish · RabbitMQ · KafkaSend SMTP mail through configured connections, with file attachments.
type: emailAn S3-compatible store: write, read, copy, list, CSV and share links.
type: fileUse a Redis connection, or run a script on the separate container runner.
type: redis · type: containerSign-in uses OpenID Connect with PKCE against WSO2 Identity Server. Every authorization decision goes to an Open Policy Agent sidecar, at the route, the resource and the engine, and fails closed when the policy cannot be reached. Company scoping keeps definitions, instances, tasks and files inside the caller's companies.
Read about operations and securityThe assistant explains a process or an instance, reviews a design, suggests tests and mocks, analyses performance and failures, and proposes changes as a preview you apply yourself. It works with Anthropic or OpenAI-compatible providers, and it never publishes a definition or acts on an instance on its own.
The assistant helps the people who design and run processes. Agents that work inside a running process are a capability of their own: see agentic orchestration.
Read about AI assistanceSix orchestration patterns, each with a diagram, the situations it fits and the guide behind it. All six patterns
Let automated checks do the routine work, then route a decision to a person when judgment is needed. The process waits for an explicit outcome before continuing.
Understand the patternSplit independent checks into branches and bring their results back together before the process continues. Make the synchronization point visible in the definition.
Understand the patternSome work has already completed when a later step fails. Register explicit compensation for completed actions and run it in reverse order along the error path.
Understand the patternDocker Compose starts the API, the web app, PostgreSQL and the services around them. Open the editor, publish a sample and start an instance.
Follow the quickstartDevelopment defaults. Harden authentication, secrets and networks before production.
# From your local Duna project directory
docker compose up -d --build
# The editor
# http://localhost:8080
# Is the API ready?
curl http://localhost:5218/health/readyStart from a pattern, or read how the engine runs it.