The call
What happens, in order
ExecutionTrustApplication.execute() (packages/runtime/src/ExecutionTrustApplication.ts) runs four steps sequentially, not as a single pipeline object:
- Accept —
BusinessTransactionService.accept()persists the transaction as submitted. - Execute —
Runtime.execute()runs it throughRuntimeEngine, which routes to the referenced Policy, evaluates it deterministically, and records a Decision and Execution. - Verify —
VerificationService.verify()computes and checks the trust record’s hash (see Packages → crypto), producing a Verification. - Receipt —
ReceiptService.generate()produces a signed Receipt, but only because step 3 succeeded.
A
businessTransactionId must be a well-formed UUID — see the Execute reference for the exact regex and the 400 you get otherwise.Signals must be deterministic
Thesignals your policy evaluates (e.g. amount, riskScore) must be pre-computed, static values by the time you call execute() — PolicyEngine.evaluate() is a pure function over (policy, signals), with no notion of re-fetching or recomputing a signal mid-evaluation. If your signal is itself the output of a model or an external call, resolve it before constructing the transaction, not inside the request.
What the bundled examples actually show
examples/01-hello-world and examples/03-runtime-execution are the only two of the ten numbered examples with real, runnable code (see Examples Overview for the rest).
examples/03-runtime-execution also calls RuntimeEngine directly with an empty RuntimePipeline([]), bypassing RuntimeFactory/ExecutionTrustApplication entirely — it demonstrates the lower-level RuntimeEngine API from runtime, not the POST /execute path described above.
Related
Execute (REST API)
The endpoint reference.
Execution Lifecycle
The domain-level version of the same four steps.
runtime package
ExecutionTrustApplication and its services.Receipt Verification
What happens after execution.