Top 100 AI Agent Architecture Design Concepts

103 — Durable Workflow Execution

Preserve business progress across process crashes, long waits, retries, and human approvals without duplicating external effects.

Concept overview

Durable execution records enough workflow history to continue a logical process after workers disappear. It separates durable coordination from activities that call models, tools, or external systems. A restarted worker reconstructs the workflow's recorded decisions instead of treating the entire request as a new task.

Durability is not universal exactly-once execution. An activity can perform a remote effect and fail before its result is recorded. External operations therefore need stable identities, idempotency, status reconciliation, and explicit handling of ambiguous outcomes. Model calls belong in recorded activities so replay does not silently generate a different plan.

Why it matters in production

Proof of concept

A proof of concept can checkpoint a short task, but must identify which waits and side effects survive process termination.

Production

Production adds persisted history, bounded activity retries, durable timers, approval signals, cancellation rules, and operation reconciliation for uncertain external results.

Enterprise scale

Enterprise scale requires workflow versioning, history retention limits, worker isolation, queue capacity planning, and migrations for long-running processes already in flight.

Architecture components

Workflow coordinator

Advances deterministic business state using persisted events, timers, and activity results.

History store

Retains workflow decisions and completion records needed for reconstruction and audit.

Activity workers

Run model and tool calls outside deterministic coordination and return structured results.

Signal and approval endpoint

Authenticates external decisions and binds them to the pending workflow revision.

Effect ledger

Tracks stable operation keys, submission status, receipts, and reconciliation obligations.

The architecture, mapped

Crash recovery without blind resubmission — Recorded activity results drive replay; an external effect with an unknown receipt goes through reconciliation.
sequenceDiagram
    participant W as "Workflow history"
    participant A as "Activity worker"
    participant S as "Business service"
    W->>A: Schedule operation with stable key
    A->>S: Submit approved effect
    S--xA: Receipt lost after commit
    A--xW: Worker stops before result recorded
    W->>A: Resume pending activity
    A->>S: Query original operation key
    S-->>A: Existing effect receipt
    A->>W: Record reconciled completion

Runtime flow

  1. 1

    Start logical workflow

    Assign a business-level workflow identifier and deduplicate repeated start requests for the same operation.

  2. 2

    Schedule bounded activity

    Record the intended activity, timeout, retry policy, and stable operation identity before dispatch.

  3. 3

    Persist observed result

    Store structured tool or model output, including partial or uncertain status, before advancing dependent work.

  4. 4

    Wait durably

    Suspend on a timer or authenticated approval signal without keeping a worker process occupied.

  5. 5

    Reconstruct after interruption

    Replay recorded coordination decisions while reusing completed activity results and respecting the workflow's compatible code version.

  6. 6

    Reconcile and finish

    Resolve ambiguous effects through status queries, then complete or compensate according to the approved business policy.

Multi-day carrier exception recovery

Logistics · Illustrative enterprise scenario, not a reported customer outcome.

Business situation

Illustrative architecture: A shipment recovery process waits overnight for carrier acceptance and then requires dispatcher approval of a revised appointment.

The problem

Keeping the process in memory loses progress on deployment, while restarting it can duplicate reservations.

Agent requirement

Preserve pending ownership, approvals, and reservation receipts across worker restarts and long external waits.

Architecture

A durable coordinator stores carrier responses and appointment operation keys; workers perform calls and the dispatcher sends a version-bound approval signal.

Runtime

  • Start load workflow
  • reserve candidate slot
  • persist receipt
  • wait for carrier signal
  • request dispatcher approval
  • reconcile final booking

Failure scenario

A worker crashes after reserving a slot; recovery queries the original reservation key before another booking is attempted.

Operational impact

Measure completed workflows, age of pending states, duplicate external effects, recovery time, and unreconciled operations rather than assuming retries imply reliability.

Architecture tradeoffs

DecisionBenefitCost
Persisted workflow historyAllows progress to survive process loss.Adds storage, operational complexity, and retention decisions.
Deterministic coordinationMakes reconstruction predictable.Requires discipline around time, randomness, model calls, and code evolution.
Long-lived approval waitsAvoids keeping workers active while humans decide.Requires expiry, reassignment, and stale-approval policies.

Failure scenarios & recovery

A code deployment changes replay behavior for an in-flight workflow.

Detect: Replay compatibility checks or runtime nondeterminism errors identify divergent decisions.

Recover: Route the workflow to a compatible worker version or apply a tested migration strategy.

A timed-out activity already committed an external action.

Detect: The effect ledger shows submission without a definitive receipt.

Recover: Reconcile by operation key and stop blind retries until the business state is known.

Common architecture mistakes

Calling a model directly inside replayed coordination.

Record model output as an activity result and replay that result.

Treating every timeout as proof of failure.

Represent unknown effect state explicitly and query the downstream system.

Allowing approvals to survive changed inputs indefinitely.

Bind approvals to evidence and action versions with an expiry policy.

When to choose this pattern

Choose it when

  • Workflows span deployments, external callbacks, or human review lasting beyond a request lifetime.
  • Several systems participate in a business process with partial success and compensation.
  • Operators need to inspect and resume a specific logical workflow after interruption.

Avoid it when

  • A short stateless calculation can be retried safely as one request.
  • The team cannot define external operation identities or ambiguity recovery.
  • Hard real-time control depends on workflow history replay and network round trips.

Architecture checklist

  • Define a stable business workflow ID and duplicate-start behavior.
  • Keep nondeterministic model and tool calls in recorded activities.
  • Specify activity deadlines, retry limits, and unknown-outcome states.
  • Bind approval signals to authenticated identities and current action versions.
  • Test worker crashes before and after every consequential remote effect.
  • Plan compatible code evolution for workflows already running.
  • Define history retention, sensitive payload handling, and operator recovery tools.

Primary references