Automation case / 05 · Approval states, invalidation & re-entry

Designing approval automation as a state machine

A fictional automation case: approvals as designed states, not as emails and checkboxes.

Fictional scenario

Independently created. Contains no employer or client implementation detail, internal names or figures.

01The outcome

Each request is in exactly one visible state; changes invalidate exactly the approvals they affect; waiting has a clock and a next approver; every decision is on record.

The reality

Approvals are a chain of emails: nobody knows which decision is pending, rejected quotes come back as edits, and changed prices keep old approvals.

Architecture question

Which changes invalidate an approval—and where must the process restart?

Key decision

Model the two decisions as states of one approval machine, with invalidation rules per data change, instead of a single approval step.

ContextCommercial deals outside standard terms need commercial approval, and new credit exposure needs financial validation. The current automation sends emails and ticks a checkbox. Rejections come back as edits to the same request, and a price changed after approval keeps the approval.

Trigger

A seller submits a deal that is outside standard terms or adds credit exposure.

Done means
  • Commercial and financial decisions recorded separately
  • Approved state valid only for the approved data version
  • Rejections carry a reason
  • Escalation fired when a clock ran out
Systems and partiesCRMERPNotification

02The reality · current state

What the automation does today.

  • Nobody can tell which decision is pending, or with whom
  • Rejections and requests for changes look the same
  • A price change after approval keeps the old approval
  • Approvals wait indefinitely when the approver is away
  • History is scattered across inboxes

03Target steps

Each step with its mode, its actor and its guard.

  1. 01
    Submitted

    Data version frozen with the request.

    HumanSeller
  2. 02
    Commercial review

    Terms within strategy? Approve, reject or return.

    HumanSales manager
  3. 03
    Route to finance

    Only when credit exposure changes.

    AutomatedCRMGuardSkip when no new exposure
  4. 04
    Financial review

    Credit and payment terms acceptable?

    HumanFinance
  5. 05
    Approved

    Approval attached to the data version; downstream unblocked.

    AutomatedCRM → ERP

04Key dimension · Approval states, invalidation & re-entry

Two decisions, one machine

Rejected and returned are different outcomes. Resubmission is a new decision on a new version—not an edit.

Run path
Failure
Recovery
Run path

Commercial review

Waiting on the sales manager’s decision, with a clock.

Can move to
  • Commercially approvedSales manager approvesPerson
  • Returned for changesSales manager asks for changesPerson
  • RejectedSales manager rejectsPerson
  • Escalated · commercialNo decision within two working daysTimer

Entered from Submitted, Escalated · commercial, Resubmitted.

Which data changes restart which decision
When this changesIt restarts
Price, discount or product mixCommercial review (and finance if exposure changes)
Payment terms or credit limitFinancial review only
Delivery date or contactNothing: not part of either decision
Customer legal entityBoth decisions

Delegation is a recorded assignment with scope and dates—never a shared login. Silence never approves.

05Execution safety

If it can run twice, it is designed to run twice.

Execution patternRecord-level state machine with timers

Short automated steps between long human waits; the state must survive days and be auditable.

Version binding
Approval valid for the data version it was given on
Invalidation
Declared per field: which change restarts which decision
Timer
Reminder, then escalation to a named next approver
History
Every transition with who, when, version and comment

06Exceptions & recovery

Not every failure is a retry.

  • Approver absent ConfigurationOut-of-office or no delegateRoute to the declared delegate or next levelSales operations
  • Data changed after approval Stale stateVersion mismatchInvalidate the affected decision onlyAutomation
  • ERP unavailable when approved Dependency · retryDownstream call failsApproval stays; downstream queuedPlatform team
  • Final rejection RejectionApprover decisionEnd with reason; seller notifiedSeller

07The trade-offs

Credible options, judged against these premises.

Rejected

One approval step for everything

One approver, one kind of risk

Cost: Merges two decisions; wrong evidence for both
Rejected

Email-based approvals

Very rare exceptions

Cost: No state, no history, no clock
Selected

Approval state machine with invalidation and timers

Recurring approvals with two owners

Cost: Invalidation rules must be maintained

08The second layer

Questions that change the design.

Decisions

  1. Do commercial and financial approval represent different decisions?
  2. Can approval be delegated?
  3. Who owns escalation?

Change

  1. What data invalidates prior approval when changed?
  2. When must approval restart?
  3. Is a resubmission a new decision?

Time & record

  1. What happens after timeout?
  2. How is history retained?
  3. What does the seller see while waiting?

09Decisions & outputs

What the work produces.

  1. 01Approval state machine
  2. 02Invalidation matrix
  3. 03Escalation clocks
  4. 04Delegation rule
  5. 05Approval history model