System Design Atlas

Multi-stage request approval

10 / 10Worked example

Final design

Which decisions, tests and earlier steps to revisit will make your next approval design verifiable?

The complete design connects A-17 through R-3 and P-2 to F-17, G-17 and U-17. A later test case introduces rule version P-3. The product-neutral architecture uses a transactional core for business state and outbox; the purchasing application deduplicates handover.

Starting point The previous steps have defined system boundary, rules, scale, contracts, data, architecture, error flows and operations.

Assumptions for the example case

Illustrative design: an internal procurement request for 6,000 euros undergoes business review followed by budget review. The inclusive budget threshold is 5,000 euros. These figures are assumptions rather than operational measurements. Ordering, payment, contract law and automatic decisions are outside the scope.

Overall request-approval architecture

Overall architecture · Revisions, approvals and purchasing handover together

Request A-17Revision R-3Business review F-17Budget review G-17Confirmed purchasing handover U-17
Applicants and reviewersCommands and Work Lists
People → APIHTTPS · Authenticated commands and queries

System boundary · Approval coordination

API processSubmission, decision, withdrawal and status consultation
API → SQLBusiness state, version and outbox in one transaction
DecisionOnly the active revision may be approved through business and budget review; P-2 remains bound to R-3.Test caseA delayed decision on R-3 delivers 409; €5,000 generates G-17, €4,999 does not.Return to an earlier stepSteps 2, 4 and 5 · Rules, contracts and states
Worker processHandover and reminders outside the request path
SQL → WorkerRead committed pending U-17
Worker → SQLSave proof of acceptance and retry status
DecisionThe worker continues stored handovers using a stable key and reconciles their outcome.Test caseA crash or lost feedback does not generate a second purchase order.Return to an earlier stepSteps 7 and 9 · Failure flow and recovery
Relational SQL datastoreA-17 · R-3 · Tasks · Policy P-2 · Outbox
DecisionRequest status, version and U-17 are protected within the same transaction.Test caseAn abort before commit leaves neither overall approval nor a handover request.Return to an earlier stepSteps 5 and 6 · Transaction and runtime boundary
Worker → PurchasingSend U-17; Purchasing → Worker confirms new or existing acceptance
Purchasing applicationConfirms new or existing U-17
DecisionThe purchasing application recognizes U-17 as the same handover on each repetition.Test caseAn identical repetition provides the existing proof of acceptance and does not generate a second order.Return to an earlier stepSteps 4 and 7 · Retry contract and handover
  • Separate runtime processes
  • Authoritative SQL datastore
  • People and purchasing outside

The final view connects A-17 through confirmed purchasing handover to the runtime components and their outstanding evidence.

The full overview combines request, revision, approvals, relational datastore, worker and purchasing application. Decisions, tests and steps to revisit are attached to the affected components.

First end-to-end flow

StepDetermined behaviourExpected evidence
SubmitR-3 and P-2 become immutable; F-17 arises.Idempotent submission test shows exactly one active revision.
DecideF-17, then G-17, atomically check role, status and active revision.A concurrency test produces exactly one business effect or a 409.
Hand overA-17 approved creates U-17 pending; the worker retries with deduplication.Lost-ack test does not produce a second purchasing effect.
OperationBacklogs, conflicts and pending handovers have assigned ownership.Work lists and recovery exercise are checked against agreements.

Submit

Determined behaviour
R-3 and P-2 become immutable; F-17 arises.
Expected evidence
Idempotent submission test shows exactly one active revision.

Decide

Determined behaviour
F-17, then G-17, atomically check role, status and active revision.
Expected evidence
A concurrency test produces exactly one business effect or a 409.

Hand over

Determined behaviour
A-17 approved creates U-17 pending; the worker retries with deduplication.
Expected evidence
Lost-ack test does not produce a second purchasing effect.

Operation

Determined behaviour
Backlogs, conflicts and pending handovers have assigned ownership.
Expected evidence
Work lists and recovery exercise are checked against agreements.

Pending evidence and decisions

Rule migration
P-2 → P-3 requires an approved migration plan defining eligible cases, mapping, ownership and rollback.
Operational objectives
RTO, RPO, reaction times, deadlines and representation rules must be agreed with the responsible organization.
User acceptance
Readers then check whether they can explain the versioning, the conflict case and the separate purchasing effect and transfer it to their own case.

Terms in this step

Validation plan
A list of specific tests and their expected outcomes that can confirm or reject architectural assumptions.

Try it yourself

Fill in the template for your own approval case: revision, approval rule, external handover, conflict test and open migration decision.

A hint for your attempt

Start with one concrete request and one critical concurrency scenario, then add more stages.

Compare with a possible solution
Revision and Rule
Example A-17/R-3: 6,000 euros under P-2, submitted immutably. Review F-17 first, then G-17 for amounts of at least 5,000 euros. Test: 5,000 creates the second task only after business approval; 4,999 does not. Revisit step 2 if the threshold or ordering is wrong.
Competing decision
Both commands expect R-3/v7. The decision and R-4 submission increment the same request version. Test: R-4 wins and F-17 receives 409; conversely, F-17 wins and the R-4 submission receives 409. Revisit step 5 if both succeed or leave partial state.
External transfer
A-17 approved generates U-17 pending in the same commit. The worker delivers U-17 until the purchase confirms the new or known acceptance. Test: Feedback is lost after acceptance; renewed U-17 does not produce a second target effect. Return to step 7 with duplicate order reference.
Open migration
P-2 → P-3 remains open. Before implementation, the domain owner defines eligible ongoing cases and task mapping; preserve the original decision and migration record. Test: an excluded case stays on P-2; an aborted migration leaves no partial state. Revisit step 9 if ownership or recoverability is missing.

Apply to your project

Which small approval case could you design next using the same state and conflict questions?

The Markdown template captures your answers and serves as a starting point for your own design.

Start your own design

Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.

Download design template (.md)
Compare the ten tasks with the example case
  1. Purpose and boundary

    Which business guarantee must your system provide before another system produces an effect?

    In the example: Approval coordination delivers an approved revision and a traceable handover. It does not create a purchase order.

  2. Requirements

    Which role or object rule must your design check directly in the write command?

    In the example: A decision takes effect only for an open, assigned task on the active revision and is checked on the server.

  3. Scale estimates

    Which load assumption in your project is mean value, which consciously chosen test peak?

    In the example: 0.0694 requests/s, 20 decisions/s and 10,000 active requests are not interchangeable figures. They test different properties.

  4. Interfaces

    Which request data must be compared in your critical command on the server side with the current state of affairs?

    In the example: The client and target system receive stable keys, expected versions and explicit conflict responses, preventing silent duplicate effects.

  5. Data and states

    Which dependent open entities must you explicitly close or migrate when changing versions in your design?

    In the example: A commit decides a specific open task against the active revision or leaves the entire attempt without effect. A reminder changes none of these states.

  6. Overall architecture

    Which of your domain modules need an immediate answer, and which ones are allowed to work in a decoupled manner?

    In the example: The internal approval is committed together with its domain state. External handover follows with retry support and remains separately visible until confirmed.

  7. Critical flow

    Which external event in your project can only take place after which local commit?

    In the example: A conflict remains 409; an uncertain handover remains pending. Only a commit or reconciliation establishes a reliable domain state.

  8. Bottlenecks and trade-offs

    Which three signals would trigger different initial responses in your design?

    In the example: Task age, conflict rate and handover duration are measured separately. The evidenced cause determines whether responsibilities, the interface, data access or target integration need changing.

  9. Operations and security

    Which operations role may investigate your workflow, and which write effects require a role with business authority?

    In the example: Operations observe and investigate. The server checks each write permission on the object and preserves conflict and handover history.

  10. Final design

    Which small approval case could you design next using the same state and conflict questions?

    In the example: The validation plan checks whether A-17/R-3 is correctly approved, a superseded command is rejected and U-17 is handed over without duplicate effects in the target system. Real load, integration and recovery evidence, plus migration and operating agreements, remain outstanding.