« All posts

Generating Procurement Approval Workflows from an Org Graph

Instead of static workflow engines, the organization is modeled as a versioned graph; approvals are computed at runtime, preserving full auditability.

The APSentra team outlines an architectural pattern addressing why enterprise procurement approval workflows routinely break down. The root cause isn't throughput or latency but design philosophy: classic workflow engines hardcode fixed step sequences like 'request → manager → finance → approval,' while the organization itself keeps changing, leaving these definitions frozen at deployment time. This produces structural drift, context-blind routing that can't encode amount/category/budget-dependent logic, and audit trails that reveal nothing about the approver's actual authority at that moment.

Their fix is to model the organization as a directed graph with nodes such as Entity, BusinessUnit, CostCenter, BudgetPool, Role, and Employee, connected by edges like REPORTS_TO, DELEGATES_TO, OWNS, DRAWS_FROM, and GOVERNS. Crucially, the graph is versioned rather than mutated in place — every change writes a new edge with a validity timestamp, making it possible to reconstruct exactly who held approval authority when a given request was submitted. Approval itself becomes a generated state machine that queries the graph at each transition instead of following a static sequence; a 3-level and a 9-level approval chain run through the same code path, so reorganizations are handled correctly without redeploying logic.

The piece also stresses that budget validation and reservation must occur as a single atomic operation using optimistic locking to prevent double-spend races between concurrent requests. Rather than storing approval status in a mutable column, the system uses event sourcing: every transition is appended as an immutable domain event that captures the organizational graph version and budget snapshot at that instant, yielding a system that is both flexible to reorganization and fully auditable.

» SourceDev.to