bpmn-to-code generates a typed Process API from your BPMN models, so workers, engine calls and tests use constants instead of strings for element ids, job types and message names. Rename a task in the modeler, and your build tells you which code still uses the old name.
A BPMN model and the code around it drift apart quietly: someone renames a task in the modeler, and workers, engine calls and tests keep their old strings until a process instance gets stuck. bpmn-to-code turns the model into a typed API, so the drift shows up in your build.
Constants instead of strings in your code. Element ids, job types, messages, signals, errors and variables come from the model, see Generated API.
@JobWorker(type = ServiceTasks.MIRAVELO_SEND_CONTRACT)
fun sendContract() { ... }Process tests that follow the model. ProcessPath walks the expected route through the generated flow nodes; a path the model no longer contains does not compile.
val path = ProcessPath.from(FlowNodes.StartEventLeasingRequestReceived)
.then { it.serviceTaskValidateApplication }
.then { it.businessRuleTaskCheckCreditRating }
.then { it.gatewayIsSolvent }
assertThat(instance).hasPassedInOrder(*path.ids)Models checked before code is generated. Built-in rules stop the generation on a missing job type or message name, and on the JVM bpmn-to-code-testing runs them and your own rules in JUnit, see Validation.
No lock-in. The API is plain constants and objects, independent of engine, worker library and test framework.
Works with Camunda 8 (Zeebe), Camunda 7 and Operaton. Generates Kotlin and Java, and as experimental output C# and TypeScript. All values are listed under Configuration.
Pick the client that fits your project; each one has its own setup guide.
| Client | For | Setup |
|---|---|---|
| Gradle plugin | Kotlin and Java projects with Gradle | bpmn-to-code-gradle |
| Maven plugin | Java and Kotlin projects with Maven | bpmn-to-code-maven |
| CLI | any build, CI scripts, Homebrew | bpmn-to-code-cli |
| Web app | trying it out, no build tool | bpmn-to-code-web |
| MSBuild / .NET tool | C# projects (experimental, unpublished) | BpmnToCode.MSBuild |
| npm package | TypeScript projects (experimental, unpublished) | @miragon/bpmn-to-code |
- Set up the client for your build from the table above.
- Generate the API, for example with
./gradlew generateBpmnModelApiormvn generate-sources. - Replace the strings in your workers, engine calls and tests with the generated constants.
To fail CI on a stale API, see Verify in CI.
For Kotlin and Java, the Claude Code plugin sets up the generator and writes workers, engine calls and tests against the Process API, see Agent Skills:
/plugin marketplace add Miragon/bpmn-to-code
/plugin install bpmn-to-code@bpmn-to-code
- Documentation: every feature, option and limit at miragon.github.io/bpmn-to-code.
- Upgrading: release notes and migration guides in the changelog.
- Bugs and ideas: open an issue.
How to build, test and change the project is in CONTRIBUTING.md. We do not accept external pull requests.
