FM-020 Time, State, and API Lifecycle

Distributed Transaction and Partial-Workflow Failures

A multi-service operation partially completes; the system does not reach a consistent business state after a step fails.

Failure explanation

A business workflow spans multiple services that cannot share one atomic database transaction. One step succeeds while a later step fails, leaving the business process in a partially completed state. Without durable workflow state, compensating actions, and recovery logic, resources may be charged, reserved, or created without the corresponding downstream action.

Example

An order service charges a card, then the inventory service times out before reserving stock. The customer is charged but the order remains unfulfillable.

How to test

  • Inject a failure after each workflow step.
  • Test timeouts where the downstream outcome is unknown, duplicate messages, service restarts, and compensation failures.
  • Inspect durable workflow state and reconciliation behavior.
  • Verify that retries resume safely rather than restarting completed steps.

Expected behavior

The workflow reaches a valid terminal state or remains recoverable with explicit status and compensating actions. The API communicates pending, failed, or compensated outcomes accurately.

Runnable examples

Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.

Learn how to find and fix it