Simulate and test a BPMN process
Why this matters for your team: catch a broken process — an unreachable branch, a missing gateway condition — in a test run that takes milliseconds, before it ever reaches a real cluster or a customer.
Testing a process by deploying it to Camunda, starting an instance, and watching Operate
is slow feedback for something that should behave like a unit test. @bpmnkit/engine
runs the same BPMN 2.0 XML you'd deploy to Camunda 8 entirely in-process, so a process test
runs in milliseconds.
Writing a process test
import { Engine } from "@bpmnkit/engine";
const engine = new Engine();
engine.deploy({ bpmn: defs }); // defs is the built BpmnDefinitions, not exported XML
engine.registerJobWorker("payment-charge", async (job) => {
job.complete({ chargeId: "test-123" });
});
const instance = engine.start("payment-flow", { orderId: "ord-1", amount: 42 });
// assert the instance reached the expected end event, took the expected
// gateway branch, and completed with the expected variables Because job workers are just functions you register, a test can simulate a failing payment, a timeout, or any other edge case without touching a real external system — useful for exercising boundary-event error paths that are hard to trigger reliably against a live integration.
Where this fits in a pipeline
Generate a process with @bpmnkit/core, exercise it with
@bpmnkit/engine, and only deploy to Camunda 8 with @bpmnkit/api
once the simulation passes — the same shape as the
Camunda 8 automation pipeline, with a fast
correctness gate in the middle.
Frequently asked
Does the simulation engine implement the full BPMN spec?
@bpmnkit/engine covers the parts of BPMN that matter for realistic process testing: service and user tasks, exclusive/parallel/inclusive gateways, timers, message correlation, and DMN business-rule evaluation.
Can I run this in a browser, not just Node.js?
Yes — @bpmnkit/engine has zero runtime dependencies and runs the same way in the browser or Node.js, so it can back an in-browser "test this process" feature as well as a CI test suite.