All field notes

Reliable autonomy

The Unit of Exactly-Once Execution Is the Business Effect

Exactly-once is not a property of an agent run or a message. It is a governed claim about one approved business mutation.

MP
Max PerfiljevFounder & CEO, AES · Architect of Autonomous Organizations
Read in Russian

Autonomous systems retry. They resume after timeouts, move work to another worker after a failure, and delegate a task from one agent to another. This is normal distributed-systems behavior. It becomes dangerous when a retry is allowed to look like a new decision.

Consider an approved instruction to issue a customer refund, create a supplier order, or update an access entitlement. The runtime may make several attempts to carry out that instruction. Those attempts are not several business actions. They are several possible executions of one business intention. Conversely, two requests with exactly the same payload may be two legitimate, separate intentions: two identical orders can be intended orders.

That distinction determines what an autonomous organization must deduplicate. The unit of exactly-once execution should be the governed business effect: one approved, externally visible mutation. It should not be an agent run, workflow instance, trace, message, or tool call.

Three identifiers, three scopes

A runtime needs to keep identifiers with different meanings separate. A run ID identifies one execution history. It answers: which worker or agent attempted this work, with which intermediate steps? An event or message ID identifies one transport record. It answers: which record was delivered, and was this delivery a retransmission? An effect ID identifies one intended mutation in the world. It answers: which approved business result is this system trying to produce?

The distinction is practical, not semantic tidiness. CloudEvents requires the combination of source and id to be unique for a distinct event, and allows a retransmitted duplicate to keep the same ID. That is useful for consumers detecting a repeated transport record. It does not establish the identity of a business effect that may involve several events, agents, queues, and external calls.

Likewise, a run ID cannot serve as an idempotency identity. A resumed workflow or reassigned task commonly receives a new execution history. If each history creates a new external idempotency key, the runtime has deliberately disabled its own duplicate protection. A trace ID has the same problem: it is an observability correlation, not a statement that two operations express one approved intent.

Mint the effect ID at approval

The effect ID should be minted when the organization approves a business action, before execution begins. Approval may be produced by a policy decision, a delegated authority, or a human control; the mechanism can vary. The architectural requirement is stable identity. Every retry, resumption, and handoff that seeks the same approved result must carry the same effect ID.

The runtime should bind that ID to a fingerprint of the intended mutation. The fingerprint can cover the target, relevant payload, operation type, and other fields that define the effect. It is not a replacement for the ID. Payload hashing alone cannot distinguish one intentional payment from a later, identical intentional payment. The effect ID carries the identity of the approved intention; the fingerprint protects that identity from being reused with altered parameters.

An effect ID says “this is the same approved action.” A payload fingerprint says “and it is still the action that was approved.”

This is consistent with the design of idempotent APIs. AWS describes caller-provided request identifiers as a way to recognize repeated expressions of the same intent, and recommends rejecting an identifier reused with changed parameters. Stripe similarly accepts client-supplied keys for mutations, rejects parameter changes under the same key, and documents a finite retention period for its deduplication records.

Make the effect ledger a control surface

An effect ledger is the runtime record for this contract. At minimum, it should hold the effect ID, target system and operation, mutation fingerprint, authorization reference, status, result or destination reference, and the period during which duplicates will be recognized. It should also record the destination-specific mechanism used: an idempotency key, a transactional operation, or a reconciliation path.

The ledger changes duplicate suppression from a hidden SDK feature into a governable operating function. Operators can ask whether a refund was attempted once or four times, whether four attempts belonged to one approved effect, which authorization permitted it, and when the destination’s deduplication window expired. Auditors can distinguish a retried effect from a second business decision. Policy can determine which effects require durable retention and which may safely age out after a bounded period.

The registration of an effect identity and the mutation need careful design. AWS notes that recording an idempotency token and applying its associated mutation must be atomic; otherwise a system can record the token without doing the mutation, or mutate without recording the token. The same race exists in an autonomous runtime. Concurrent attempts require atomic registration, explicit conflict handling, or serialization. An effect ID does not itself stop two workers from reaching for the same action at the same time.

Adapters carry the contract to each destination

The governed effect is internal to the organization; each destination has its own guarantees. An adapter should translate the stable effect ID into the destination’s idempotency key or transactional mechanism, while preserving the destination’s scope and retention rules in the ledger. A payment API may retain keys for a documented period. A database may support a transaction. A message processor may deduplicate only within its own store. These are different contracts, not interchangeable labels.

Kafka illustrates the boundary clearly. Its exactly-once processing can commit offsets and outputs atomically when both remain within Kafka’s transactional domain. Once an effect reaches an external system, exactly-once delivery generally requires cooperation from that destination. An autonomous organization should not turn a strong local guarantee into a universal claim about every SaaS API, bank, device, or inbox it touches.

Treat timeout as ambiguity, not permission

The hardest case is a non-cooperating destination. An agent sends a mutation, loses the response, and times out. The operation may have succeeded, failed, or succeeded only partly. Retrying blindly turns uncertainty into a potential duplicate.

The correct status is ambiguous outcome. The runtime should prevent automatic re-execution of the effect, then resolve the state through a destination lookup, a later callback, or reconciliation against the destination’s records. Reconciliation is not a substitute for idempotency. It is the necessary fallback when the runtime cannot obtain an authoritative answer at the point of execution.

Exactly once is a bounded governance promise

“Exactly once” is often used as a blanket reliability slogan. For autonomous organizations, it should instead be a precise, bounded promise: within a defined effect ledger, for a defined mutation fingerprint, over a defined retention period, and subject to the capabilities of each destination, the organization will recognize repeated attempts to produce one approved business effect.

That promise is more useful than an impossible end-to-end guarantee. It gives retry logic a stable object to preserve. It gives authorization a specific action to govern. It gives operators evidence to inspect when a timeout becomes a dispute. And it prevents the most basic accounting error in autonomous work: mistaking multiple attempts for multiple decisions.

BUILD WITH AES

Turn architecture into an operating company.

AES connects strategy, tasks, organizational memory, knowledge, agents, people and approvals in one execution environment.