See what Duna can coordinate, when each pattern helps, and how the pieces fit together.
01 / People
Human decisions, in the flow.
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.
When it helps
Credit reviews, expense approvals, supplier onboarding and exception handling.
For example
A loan application passes initial checks, waits for a reviewer, then follows its approved or declined route.
Model the allowed outcomes and authorization. Add a timer when a decision needs an escalation path.
02 / Time
Wait without losing the thread.
A business process may take minutes, days, or longer. Persist its state in PostgreSQL while it waits, then resume when a timer elapses or the expected input arrives.
When it helps
Settlement windows, delivery milestones, response deadlines and scheduled follow-ups.
For example
An order moves through preparation, collection and delivery, with explicit waiting periods between stages.
Durability requires the persistent store and a correctly configured runtime. Waiting is part of the definition, not a long-running HTTP request.
03 / Coordination
Independent work. One next step.
Split independent checks into branches and bring their results back together before the process continues. Make the synchronization point visible in the definition.
When it helps
Budget and compliance checks, independent validations and multi-team purchasing processes.
For example
A purchase request needs both a budget check and a compliance check before an order can be placed.
Choose branch completion and error behavior deliberately. Parallelism does not make external systems transactional.
04 / Composition
Compose a larger process.
Keep a larger process understandable by giving a defined piece of work to a child process. Pass inputs, coordinate its completion, and use the returned result.
When it helps
Supplier checks, reusable validations and processes shared across several business journeys.
For example
A purchasing process delegates supplier validation to a child definition before continuing with procurement.
Child processesInput and result mappingSync or async invocation
The illustrated parent waits for the child result. Other designs can invoke a child asynchronously; required definitions must be available in the runtime.
05 / Integration
Connect events to their process.
Different systems publish at different times. Correlate an incoming message to the right waiting instance, then let its transition rules determine what happens next.
When it helps
Payment, dispatch and delivery events crossing service or broker boundaries.
For example
An order waits for payment on RabbitMQ, dispatch on Kafka, and delivery confirmation on RabbitMQ.
Configure connections, correlation and delivery behavior. A definition-level message trigger starts an instance; an event wait resumes an existing one.
06 / Recovery
Design the way back.
Some 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.
When it helps
Reservations, payments and multi-system work that needs a business-level recovery plan.
For example
Stock is reserved and payment captured. If shipping fails, refund the payment, then release the reservation.