Workflow Engine
Node-Based Business Process Modelling
Approval chains and operational processes modelled as configurable graphs instead of hardcoded if-statements.
- TYPE
- AUTOMATION
- STATUS
- LAB
- YEAR
- —
- ROLE
- Architecture, experiment
- PLATFORM
- Node.js service, Flutter Web editor
- STACK
- Node.js · TypeScript · PostgreSQL · Neo4j
PROBLEM
Every ERP accumulates process rules: this discount needs a manager, that purchase over a limit needs two approvals, this stock issue needs a store keeper acknowledgement. Written as code, each new rule is a release, and each customer wants a slightly different rule.
The rules also become invisible. Nobody can see the approval chain, only discover it by hitting it.
SYSTEM
Processes are modelled as a graph of nodes — trigger, condition, approval, action, notification — persisted as configuration rather than code, and executed by a single engine.
Because the process is data, it can be shown as a diagram, versioned, and differed between tenants. A running instance keeps its own state, so a rule change does not corrupt work already in flight.
CORE FLOW
How the operation moves through the system.
- A business event from any product: bill created, stock issued, tour closed
- Evaluated against the event payload and tenant configuration
- Routed to a role or a person, with escalation and timeout
- Calls a domain operation idempotently; failures are retriable
- Outcome delivered to the people who need to know
- Full instance history: what fired, who decided, what changed
Node execution model running from trigger through condition, approval, action, notification and audit.
KEY MODULES
- M01Process editor
- Visual node graph; the configuration is the diagram.
- M02Execution engine
- Instance state machine with retry, timeout and escalation.
- M03Versioning
- Running instances stay on the version they started on.
- M04Audit
- Per-instance history of every evaluation and decision.
ARCHITECTURE
- Definition store
- Process graphs held per tenant and versioned.
- Graph exploration
- Neo4j used to reason about dependencies and reachability in a process.
- Instance state
- PostgreSQL; each instance is durable and independently resumable.
- Status
- Laboratory work. Being proven against real approval chains before use in production.
ENGINEERING
The parts that were not obvious, and what the system does about them.
- 01 / 02
Changing a process while instances are running
Editing an approval chain must not strand a purchase order halfway through. Instances pin their definition version, so a change applies only to work that starts after it.
- 02 / 02
Actions that must not run twice
A retried action node cannot post the same journal entry again. Every action carries an idempotency key derived from the instance and the node, which makes retry safe by construction.
SCREENS
- SCREEN_01Process editor — node graph
- SCREEN_02Instance audit history
RESULT
An experiment with a clear target: the next customer-specific approval rule should be configuration, not a deployment.