Detecting and Correcting BPMN Models with LLMs

Michał Jurzak

A tool for analysing and improving BPMN process models with a large language model. BPMN is the standard notation for drawing business processes, and the models drift out of shape easily, so this pairs a graph view of the process with an LLM that reads it, flags what looks wrong, and proposes fixes through an interactive web interface.

What it does

You hand it a process model and it draws the diagram, parses the structure, and runs the model over it to find the kinds of slips that are easy to miss: a missing end event, a gateway that never closes, a path that goes nowhere. Each suggested fix comes back drawn on top of the original, so the change is something you can see rather than read about, and you accept or reject it one at a time. Input is flexible too: a diagram can be written out as text or uploaded as a picture and reconstructed into a model the tool can work with.

How it is built

Processing leans on pm4py for BPMN handling and networkx for the underlying graph operations, with langchain orchestrating the LLM calls. The front end is a Streamlit application embedding a BPMN viewer. A command-line path also exists: the analyser and the fix-applier can be run as modules to batch results into a spreadsheet for evaluation.

Source

Code and usage notes are in the source repository.