Web App
Generate from BPMN models in the browser, no Gradle or Maven setup needed. The web app runs the same generator as the build plugins, so the output is identical. Three ways to use it:
- Use the hosted version: upload BPMN, download code
- Self-host with Docker: run it on your own infrastructure
- Call the REST API: from CI, scripts or any HTTP client
Use the hosted version
Upload up to three BPMN files, pick the output language and engine, and download the generated Process API. Nothing to install.
Generated code uses the fixed package com.example.process (for C# the namespace Com.Example.Process); change it after downloading. The generated code needs the runtime package of its language, which the app shows next to the result: bpmn-to-code-runtime for Kotlin and Java, Miragon.BpmnToCode.Runtime for C#, @miragon/bpmn-to-code-runtime for TypeScript. C# and TypeScript output are experimental, and their NuGet and npm packages are not published yet.
Self-host with Docker
docker pull miragon/bpmn-to-code-web:latest
docker run -p 8080:8080 miragon/bpmn-to-code-web:latestThen open http://localhost:8080. The image is on Docker Hub.
Environment variables
| Variable | Default | Description |
|---|---|---|
PORT | 8080 | Port the server listens on |
ALLOWED_CORS_ORIGINS | all origins | Comma-separated list of allowed origins. Empty or * allows all |
IMPRINT_URL | — | Shows an imprint link in the UI when set |
PRIVACY_URL | — | Shows a privacy policy link in the UI when set |
Endpoints
| Route | Purpose |
|---|---|
GET / | Redirects to the UI at /static/index.html |
GET /health | Health check, answers {"status": "UP"} |
GET /api/config | Legal links and version the UI displays |
POST /api/generate | Generates the Process API |
GET /swagger | Swagger UI for the routes above |
Call the REST API
The generation endpoint takes one to three BPMN files, each Base64-encoded.
curl -X POST https://bpmn-to-code.miragon.io/api/generate \
-H "Content-Type: application/json" \
-d '{
"files": [{
"fileName": "bike-leasing.bpmn",
"content": "'$(base64 < bike-leasing.bpmn | tr -d '\n')'"
}],
"config": {
"outputLanguage": "KOTLIN",
"processEngine": "ZEEBE"
}
}'outputLanguage is KOTLIN, JAVA, CSHARP or TYPESCRIPT; processEngine is ZEEBE, CAMUNDA_7 or OPERATON.
Response
{
"success": true,
"files": [
{ "fileName": "BikeLeasingProcessApi.kt", "content": "// Generated by bpmn-to-code ...", "processId": "bikeLeasing" },
{ "fileName": "ServiceTasks.kt", "content": "// Generated by bpmn-to-code ...", "processId": null }
],
"libraryFiles": [],
"runtimeDependency": {
"name": "io.miragon:bpmn-to-code-runtime",
"importedFrom": "io.miragon.bpmn.runtime",
"version": "<version>",
"snippets": [
{ "label": "Gradle", "code": "implementation(\"io.miragon:bpmn-to-code-runtime:<version>\")" },
{ "label": "Maven", "code": "<dependency>...</dependency>" }
]
}
}filesholds one Process API per BPMN file plus the shared definition files, which haveprocessId: null.runtimeDependencynames the runtime package of the output language, with one snippet per way of adding it to a build: Gradle and Maven for Kotlin and Java,.csprojand .NET CLI for C#, npm for TypeScript.libraryFilesholds the sources ofbpmn-to-code-runtime; it is empty for C# and TypeScript.
Errors
A failed request answers with "success": false and the reason in error.
| Status | When |
|---|---|
400 | No files, more than three files, a file that is not Base64 or not readable BPMN, a model that fails validation, or two files that would be generated under one name |
500 | Any other failure |