Bpmn Generator
Enterprise BPMN 2.0 Generator β JSON Logic-Core β ElkJS Layout β OMG-compliant XML + SVG
Ask AI about Bpmn Generator
Powered by Claude Β· Grounded in docs
I know everything about Bpmn Generator. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
BPMN Generator
BPMN 2.0 diagram generator β converts natural language process descriptions or structured JSON into OMG-compliant BPMN 2.0.2 XML files and SVG previews (ISO/IEC 19510:2013).
What It Does
You describe a business process β either as free text or as a structured JSON (Logic-Core) β and the generator produces:
- A BPMN 2.0 XML file (.bpmn) that opens in bpmn.io, Camunda Modeler, or any standard-compliant tool
- An SVG preview with all BPMN symbols, lanes, pools, and edge routing
- A validation report covering structural correctness, naming conventions, and complexity metrics
The output is structurally valid and OMG-compliant. It handles pools, lanes, gateways, boundary events, sub-processes, message flows, and loop markers correctly β things that LLMs typically get wrong when generating BPMN XML directly.
Realistic Expectations
This tool produces a solid first draft, not a finished diagram. Expect to refine:
- Layout β Auto-layout handles most cases well (happy-path alignment, orthogonal routing, lane partitioning), but complex processes with many cross-lane edges or feedback loops may need manual adjustment in a BPMN editor
- Labels & naming β The LLM generates reasonable names, but domain-specific terminology may need correction
- Edge cases β Unusual gateway patterns, deeply nested sub-processes, or very large diagrams (30+ activities) can produce suboptimal visual results
- Business logic β The generator models what you describe; it doesn't validate whether your process makes business sense
Think of it as going from 0% β 80% in seconds. The remaining 20% is domain expertise that requires human judgment.
Pipeline
User Text β [Phase 1] Intent Extraction (LLM β JSON Logic-Core)
β [Phase 2] Validation (26 rules, 4 layers, deadlock detection)
β [Phase 3] Auto-Layout (ElkJS Sugiyama layered algorithm)
β [Phase 4] Serialization β BPMN 2.0 XML + SVG
The LLM never handles coordinates. Layout is 100% algorithmic.
Quick Start
cd scripts/
npm install # installs elkjs + jest
# Generate from JSON Logic-Core:
node pipeline.js my-process.json my-process
# From stdin:
echo '{ ... }' | node pipeline.js - output
# Import existing BPMN:
node import.js existing.bpmn extracted.json
# DOT export (Graphviz):
node pipeline.js my-process.json my-process --dot
# DOT import β Logic-Core JSON:
node pipeline.js graph.dot output --import-dot
# Run tests:
npm test
Output: output.bpmn (BPMN 2.0 XML) + output.svg (vector preview)
Usage as Claude Code Skill
In a specific project
Copy SKILL.md to .claude/skills/operative/bpmn-prozess-erstellen.md and adjust the relative paths for references/ and scripts/ to match where you placed those directories.
As a portable .skill file
The bpmn-generator-v3.skill ZIP archive can be shared with other projects. It contains everything needed:
SKILL.mdβ Skill definitionreferences/β Schema, prompt templates, inline templatescripts/β Pipeline modules, import.js, package.json
Module Architecture
scripts/
βββ pipeline.js Orchestrator + CLI (~180 LOC)
β βββ validate.js Validation wrapper β rules.js
β βββ rules.js Rule engine (26 rules, 4 layers, profile support)
β βββ topology.js Gateway directions, topological sort, lane ordering
β βββ layout.js ELK graph construction + layout execution
β βββ coordinates.js Coordinate maps, edge clipping, pool equalization
β βββ bpmn-xml.js BPMN 2.0 XML generation (DI, top-level defs)
β βββ svg.js SVG rendering (pools, lanes, activities, events)
β βββ icons.js Event markers, task icons, bottom markers
β βββ dot.js DOT export (Logic-Core β Graphviz) + import
β βββ types.js Type predicates, BPMN XML tag mapping
β βββ utils.js Config loader, visual constants, helpers
βββ import.js BPMN XML β Logic-Core JSON round-trip importer
βββ orchestrator.js Multi-agent state machine + CLI
βββ agents/
β βββ modeler.js LLM-powered: textβJSON, refine, amend
β βββ reviewer.js Deterministic: validateLogicCore() wrapper
β βββ layout.js runPipeline() + optional vision review
β βββ compliance.js Deterministic: runRules() gate
β βββ llm-provider.js OpenAI-compatible fetch abstraction (cloud + local)
βββ workflow-net.js Petri-Net soundness checker (WF01-WF03)
βββ prepare-training-data.js Training data ETL (BPMNβLC, filter, JSONL)
βββ evaluate-slm.js SLM evaluation (pipeline-based metrics)
βββ mcp-bpmn-server.js MCP server (4 tools)
βββ http-server.js HTTP API (5 endpoints)
βββ config.json Externalized constants (shapes, colors, gaps)
βββ package.json Dependencies (elkjs, jest)
βββ pipeline.test.js 114 tests (Jest, ES Modules)
βββ orchestrator.test.js 22 tests (agents + state machine)
Dependency graph (acyclic):
types.js β (no deps)
utils.js β (no deps, reads config.json)
rules.js β types, workflow-net
workflow-net.js β types
validate.js β rules
topology.js β types
layout.js β types, utils, topology, elkjs
coordinates.js β types, utils
icons.js β utils
bpmn-xml.js β types, utils, topology, icons
svg.js β types, utils, icons
dot.js β types
pipeline.js β all of the above
Repo Structure
bpmn-generator/
βββ README.md This file
βββ LICENSE MIT License
βββ CHANGELOG.md Version history
βββ CONTRIBUTING.md Contribution guide
βββ THIRD-PARTY-NOTICES.md Dependency licenses
βββ SKILL.md Claude Code skill definition
βββ CLAUDE.md Project instructions for Claude Code
βββ ROADMAP.md Development roadmap (K0-K8, M1-M6, L1-L6)
βββ COMPATIBILITY.md bpmn.io compatibility report
βββ bpmn-generator-v3.skill Portable ZIP archive
βββ .github/workflows/ci.yml GitHub Actions CI
βββ references/
β βββ logic-core-schema.md JSON schema documentation (prose)
β βββ input-schema.json Formal JSON Schema (draft 2020-12)
β βββ prompt-template.md LLM prompt templates + few-shot patterns
β βββ inline-template.md HTML template for browser-side ElkJS
β βββ fachliches-regelwerk.md Rule documentation (26 rules, 4 layers)
β βββ omg-compliance.md OMG BPMN 2.0.2 compliance mapping
β βββ review-set/ Test fixtures for visual review
βββ rules/
β βββ default-profile.json Default rule profile (all layers active)
β βββ strict-profile.json Strict profile (warnings β errors)
βββ scripts/ Pipeline modules (see above)
βββ tests/
βββ fixtures/ Test input files (JSON Logic-Core)
Rule Engine
26 rules across 4 layers with configurable severity via JSON profiles:
| Layer | Severity | Rules | Examples |
|---|---|---|---|
| Soundness | ERROR | S01-S11 | Start/End events, deadlocks, boundary events |
| Style | WARNING | M01-M09 (M05/M06 disabled) | Naming conventions, gateway labels |
| Pragmatics | INFO | P01-P03 | Complexity metrics |
| Workflow-Net | ERROR/WARNING | WF01-WF03 | Liveness, boundedness, deadlock-freedom (opt-in) |
# Default profile (all layers active):
node pipeline.js input.json output
# Strict profile (style warnings β errors):
# (programmatic: runPipeline(lc, { ruleProfile: 'rules/strict-profile.json' }))
See references/fachliches-regelwerk.md for full rule documentation.
Programmatic API
import { runPipeline } from './pipeline.js';
const logicCore = { nodes: [...], edges: [...] };
const result = await runPipeline(logicCore);
// result.bpmnXml β BPMN 2.0 XML string (or null on validation error)
// result.svg β SVG string
// result.coordMap β coordinate map
// result.validation β { errors: [], warnings: [] }
Individual modules can be imported directly:
import { validateLogicCore } from './validate.js';
import { generateBpmnXml } from './bpmn-xml.js';
import { generateSvg } from './svg.js';
import { logicCoreToDot, dotToLogicCore } from './dot.js';
Features
- Multi-pool collaborations with message flows
- All BPMN 2.0 task types (User, Service, Script, Send, Receive, Manual, Business Rule)
- Call Activity, Sub-Process, Transaction with correct rendering
- Expanded sub-processes with inline children
- Boundary events (timer, error, message, signal, escalation β interrupting/non-interrupting)
- All gateway types with correct
gatewayDirection(Diverging/Converging/Mixed) - Loop/multi-instance markers (standard loop, parallel MI, sequential MI)
- Data objects, data stores, text annotations, groups, associations
- Collapsed pools (black-box participants)
- Round-tripping (BPMN XML β Logic-Core JSON β BPMN XML)
- DOT format (Graphviz export + import for visualization)
- Inline mode (browser-side ElkJS rendering without Node.js)
- Configurable rule engine (26 rules, 4 layers, JSON profiles)
- OMG BPMN 2.0.2 compliant XML output (ISO/IEC 19510:2013)
- BPMN-in-Color (bioc: namespace β per-node fill/stroke in XML + SVG)
- Documentation View (SVG tooltips +
--docMarkdown companion) - Happy-Path Y-Leveling (post-layout alignment, configurable)
- MCP Server (generate, validate, import as MCP tools)
- bpmn.io compatible (verified with bpmn-js viewer)
Multi-Agent Orchestration
The orchestrator chains 4 agents in a feedback loop until the diagram is valid and compliant:
Modeler (LLM) β Reviewer β Layout/Pipeline β Compliance β Done
β β β
βββββββββββββββββ β (Review loop: max 3)
β β
ββββββββββββββββββββββββββββββββ (Layout loop: max 2)
# Review-only (no LLM needed):
node scripts/orchestrator.js --input logic-core.json --output /tmp/result
# Full cycle with LLM (text β BPMN):
node scripts/orchestrator.js --text "Process description..." \
--api-url https://api.example.com/v1 --api-key KEY --model gpt-4.1 \
--output /tmp/result
import { orchestrate } from './orchestrator.js';
// Without LLM β review + generate + compliance only:
const result = await orchestrate(logicCoreJson);
// With LLM β full text-to-BPMN cycle:
const result = await orchestrate('Process description...', { llmProvider });
MCP Server
The BPMN Generator can be used as an MCP (Model Context Protocol) server, exposing four tools:
| Tool | Description |
|---|---|
generate_bpmn | Logic-Core JSON β BPMN 2.0 XML + SVG |
validate_bpmn | Validate Logic-Core without generating output |
import_bpmn | BPMN 2.0 XML β Logic-Core JSON |
orchestrate_bpmn | Multi-agent review + generate + compliance |
Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"bpmn-generator": {
"command": "node",
"args": ["/path/to/scripts/mcp-bpmn-server.js"]
}
}
}
HTTP API
The BPMN Generator also provides an HTTP API for multi-user access (CI/CD pipelines, web apps, external systems):
| Method | Path | Description |
|---|---|---|
POST | /api/v1/generate | Logic-Core JSON β BPMN 2.0 XML + SVG |
POST | /api/v1/validate | Validate Logic-Core without generating output |
POST | /api/v1/import | BPMN 2.0 XML β Logic-Core JSON |
POST | /api/v1/orchestrate | Multi-agent review + generate + compliance |
GET | /health | Health check (uptime, version) |
Start
PORT=3000 node scripts/http-server.js
Request
curl -X POST http://localhost:3000/api/v1/generate \
-H 'Content-Type: application/json' \
-d '{"logicCore": {...}, "clientId": "my-app", "callbackUrl": "https://..."}'
Optional fields: callbackUrl (async delivery with retry), clientId (audit), correlationId (tracking).
Observability
- Audit log:
audit/bpmn-generator.jsonl(append-only JSON Lines, metadata only) - Dead letter:
dead-letter/(failed callback deliveries)
OMG Compliance
See references/omg-compliance.md for a detailed mapping of OMG BPMN 2.0.2 specification sections to implementation code.
Third-Party Libraries
| Library | License | Purpose |
|---|---|---|
| ElkJS | EPL-2.0 | Sugiyama layered auto-layout |
| bpmn-moddle | MIT | BPMN 2.0 meta-model (XML serialization) |
| MCP SDK | MIT | MCP server integration |
See THIRD-PARTY-NOTICES.md for full license details.
References
- OMG BPMN 2.0.2 (formal/2013-12-09, ISO/IEC 19510:2013)
- Bruce Silver: "BPMN Method and Style, 2nd Edition"
- Soliman et al. (2025): "Size matters less: how fine-tuned small LLMs excel in BPMN generation"
- Domroes et al. (2023): "Model Order in Sugiyama Layouts" (ELK)
License
MIT β see THIRD-PARTY-NOTICES.md for dependency licenses.
