Unit 08.01: Mapping approvals onto real roles
The automation has to match the approval structure the organisation already has. Simplifying it is not a design decision you get to make.
Approver, latency, and how many
Real approval chains vary by amount band, involve named roles, and take days. All three have consequences for the system.
The code lays out four approval cases.
APPROVALS = [
("payment under 500", "team lead", "same day", "1 approver"),
("payment 500-5000", "finance manager", "1-2 days", "1 approver"),
("payment over 5000", "finance director", "2-5 days", "2 approvers"),
("new supplier", "procurement", "1 week", "1 approver"),
]
print(f"{'case':22} {'human approver':18} {'latency':10} rule")
for case, approver, latency, rule in APPROVALS:
print(f"{case:22} {approver:18} {latency:10} {rule}")
print("""
The automation must match the approval structure the organisation already has,
not a simpler one. Two consequences follow.
The latency column is real: a workflow that pauses for five days needs durable
state, not an open connection. And "2 approvers" means the state has to record
both, so a second approval cannot be satisfied by the same person twice.
""")
The latency column is the one that changes the architecture. A workflow pausing for five days cannot hold anything open - it needs durable state and a run id someone can return to, which is the same requirement as the human gate in Module 5 but with a much longer pause.
"2 approvers" has its own consequence: the state must record both, individually, so a second approval cannot be satisfied by the same person clicking twice. That is a check nobody writes until an auditor asks.
The mistake this prevents
The mistake is building one approval step and mapping every case onto it. The amount bands exist because the organisation decided different amounts warrant different scrutiny, and collapsing them means either over-escalating small payments or under-escalating large ones.
Takeaway
Model the approval chain as it exists: role per band, multiple approvers recorded individually, and pauses measured in days. Long pauses mean durable state, not an open connection.
