Skip to content

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:

  1. Use the hosted version: upload BPMN, download code
  2. Self-host with Docker: run it on your own infrastructure
  3. 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.

Open the web app ↗

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 ​

bash
docker pull miragon/bpmn-to-code-web:latest
docker run -p 8080:8080 miragon/bpmn-to-code-web:latest

Then open http://localhost:8080. The image is on Docker Hub.

Environment variables ​

VariableDefaultDescription
PORT8080Port the server listens on
ALLOWED_CORS_ORIGINSall originsComma-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 ​

RoutePurpose
GET /Redirects to the UI at /static/index.html
GET /healthHealth check, answers {"status": "UP"}
GET /api/configLegal links and version the UI displays
POST /api/generateGenerates the Process API
GET /swaggerSwagger UI for the routes above

Call the REST API ​

The generation endpoint takes one to three BPMN files, each Base64-encoded.

bash
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 ​

json
{
  "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>" }
    ]
  }
}
  • files holds one Process API per BPMN file plus the shared definition files, which have processId: null.
  • runtimeDependency names 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, .csproj and .NET CLI for C#, npm for TypeScript.
  • libraryFiles holds the sources of bpmn-to-code-runtime; it is empty for C# and TypeScript.

Errors ​

A failed request answers with "success": false and the reason in error.

StatusWhen
400No 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
500Any other failure