A coordinator confirms a service visit. The application saves the booking, reserves equipment and asks another service to send a confirmation. The last step fails. Should the booking disappear, stay confirmed without a message, or wait for someone to resolve it?

Before accepting a multi-step business workflow, agree which changes must succeed together, which can finish later and who owns a partly complete result. A database rollback and the cancellation of an external reservation are different recovery decisions.

This guide provides a boundary worksheet and a fictional booking example. It is a planning framework, not a tested implementation or a customer story.

Define what a completed workflow means

Avoid one Success label for several different outcomes. For the booking example, consider separate statements:

  • The booking and its local equipment allocation were saved together.
  • The external calendar accepted the visit.
  • The notification provider accepted a request.
  • The recipient received or read a message.

These are proposed evidence boundaries, not claims about a particular product. Ask the supplier which observations the integration actually makes. If it only knows that a request was accepted, the interface should not turn that into customer notified.

Write down the business rule before choosing the mechanism. For this fictional workflow, suppose a booking must never be recorded as confirmed without a matching local equipment allocation and an accepted external calendar entry. A delayed optional confirmation message, however, need not cancel an otherwise valid booking. Another business may choose a different rule.

The handover question is: Which exact facts must be true before this application calls the work complete?

Draw the local database transaction boundary

PostgreSQL describes a transaction as a way to bundle multiple steps into an all-or-nothing operation.[1] Its tutorial shows transaction blocks using BEGIN and COMMIT, with ROLLBACK canceling the updates in the block.[1]

For our fictional booking, ask whether saving the booking and its local equipment allocation can share that transaction boundary. If they must succeed together, request a demonstration in which the second write fails and neither partial result becomes committed.

Do not assume several separate Save calls behave as one transaction. PostgreSQL notes that individual statements have their own implicit transactions when an explicit transaction block is not used, and that some client libraries manage transaction commands automatically.[1] Check the actual boundary in the chosen implementation.

Keep the acceptance claim narrow: a demonstration of two database writes rolling back together is not evidence that an email, external booking or other remote action was undone. Put each external effect on its own row in the worksheet.

Choose recovery rules for external actions

Microsoft's Compensating Transaction pattern explains why restoring earlier data is not always a safe way to reverse a distributed operation: other work may have changed the state, and business-specific recovery rules may apply.[2]

A compensating action is not a time machine. In the fictional example, canceling an external calendar reservation would be a new action with its own outcome. It would not erase the fact that the reservation existed. Nor should recovery restore an old copy of the entire booking and overwrite a colleague's later correction.

For each external step, agree a policy:

  • Continue with a visible pending state when the business can safely wait.
  • Stop subsequent work while someone resolves a required missing result.
  • Attempt a defined compensating action when a completed step must be reversed.
  • Escalate when the result cannot be established or the proposed reversal requires a person's decision.

These choices are a buying framework, not a recommendation to add a distributed workflow engine to every application. Ask for the simplest design that meets the actual rule. Microsoft also notes that a single failed step does not always require reversing the whole process.[2]

Use a partial-failure acceptance worksheet

Here is a fictional specification to adapt. Expected means a requirement to agree and verify, not an observed result. None of these application checks has been run for this article.

Fictional partial-failure acceptance worksheet — proposed and not run
StepRequired boundaryExpected failure stateEvidence to request
Save booking and local equipment allocationBoth committed together; booking not yet fully confirmedNeither committed if allocation write failsDatabase result and operation record after an injected second-write failure
Create external calendar entrySeparate remote action required for confirmationBooking held as calendar pending, not fully confirmedActual provider reference or explicit unresolved result
Request an optional confirmation messageSeparate remote action after confirmationBooking stays valid; message status remains pending or failedProvider acceptance evidence without an invented delivery claim
Cancel an external calendar entry after an agreed reversalSeparate compensating actionCancellation pending or needs attention if it failsOriginal reference, cancellation result and unresolved-work record

The business must still decide whether equipment stays reserved while the calendar step is pending, for how long, and who may release it. Leaving that question unanswered can produce a technically consistent application that does the wrong work.

Add the person or role allowed to resolve each exception. The system will recover is not a complete requirement if nobody can explain what happens when recovery also fails. Microsoft's guidance recognizes that compensation can fail and that some situations require manual intervention.[2]

Rehearse six partial-failure cases before sign-off

Ask the developer to run these checks in an isolated test environment with synthetic records. Record the software and integration versions, failure method, expected state, actual state and evidence. All six cases below are proposed checks, not completed tests.

  1. Fail the second local write. Check that the first write did not remain committed where the agreed rule requires all-or-nothing behavior.
  2. Fail the external calendar step after the local commit. Check that staff see the agreed pending state, not an unconditional completion banner.
  3. Make the provider outcome unknown. Check that the application preserves the operation reference and routes the uncertainty for reconciliation rather than presenting a guessed result.
  4. Fail the optional message request. Check that the booking remains valid if that is the agreed policy, while the message failure remains visible.
  5. Fail a compensating action. Check the remaining external state, the exception owner and the evidence available to that person.
  6. Let a colleague make a later permitted change before recovery. Check that recovery does not blindly restore stale information over that change.

Keep retry behavior in scope, but do not confuse it with transaction boundaries. The safe-retries guide covers repeated actions; this worksheet asks what should remain when different steps have different outcomes.

Put the agreed boundaries in the project brief

A useful brief can fit on one page: the business operation, the facts required for completion, the local transaction boundary, the external effects, the allowed pending states and the exception owner. Attach the worksheet and ask for rehearsal evidence before sign-off.

A polished interface can hide partial work. A clear boundary makes that work understandable: what saved, what did not, what remains uncertain and what happens next.

If you are planning a web application, use CodeDrawn Digital's project brief to describe the workflow and the failure you most need to avoid. The site's helper lets you request an email draft; it does not establish sending or receipt.

Sources

[1] https://www.postgresql.org/docs/current/tutorial-transactions.html

[2] https://learn.microsoft.com/en-us/azure/architecture/patterns/compensating-transaction

Primary documentation checked on 25 November 2026. The worksheet and rehearsal cases are conceptual requirements, not evidence of an implemented application. The PostgreSQL current-documentation URL does not establish an installed database version; Microsoft's pattern guidance does not prove that any application's compensation works.