GenAI can help you with BPMN!
Flows for APEX uses the industry standard process modelling notation, BPMN 2.0, to graphically model business processes. Steps in those processes that require user input or processing can then be rapidly developed using Oracle APEX, and Flows for APEX will then execute and manage instances of those processes. So how can GenAI help us with that?
Business Process Model and Notation (BPMN) representations of a business process appear to the user as a process diagram, showing tasks, events, and gateways that control the process direction. Optionally these diagrams can contain swim lanes showing who (person or organisation) is responsible for each process step, and can show how a process interacts with other processes and/or other organizations.
Under the covers, these BPMN diagrams are stored as an XML document, containing two main sections - one defining the process logic, and a second defining the diagram layout.
Current Gen AI models are good at understanding XML documents, have been trained on material including the BPMN standard, the many books written about BPMN, and the countless number of conference papers written by business consultants over the last two decades. The good news is that you don’t have to stay awake reading all of them - Gen AI has already read them and can help us!
What can Gen AI do with a BPMN Diagram?
Explaining Diagrams
The first thing that GenAI can do is to explain the diagram to us in business English. Or any other language, but I’ll come back to that later!
The AI models are good at converting the structure and text contained in the BPMN model to a good, well-structured explanation of the process in a diagram. They seem to be good at inferring background purpose and concepts in a model, and describing them - at a high level, or in as much detail as you want.
Let’s take an example. I have a contrived business process built for a demo that conducts annual employment verification checks for staff. The process is started by HR, and then carried out by HR and line managers. Here’s the top level diagram …
This diagram uses a subprocess for the ‘review department’ task. If I click on the blue arrow icon underneath ‘review department’, I can see the detail of this subprocess…
And so I can see that the process for each department is to identify staff needing a review, that conduct that review — the details of which are contained in a sub process, which again I can see by clicking on the blue arrow below ‘review staff’.
Now I can see that the process conducts a government employability check and then a salary review by the line manager.
What can AI do? If I click the ‘Ask Flo’ button, we send a subset of the diagram to the AI service, ask ask for a brief summary of the business process. Here’s the response.
This looks like a good summary of the process. For those who aren’t familiar with the intricacies of BPMN, whether APEX developers new to BPMN or business managers new to process modelling, this should be useful.
The AI service is able to answer more detailed questions about the business process or the mechanics of the BPMN diagram. Here is an arbitrary example where we’ve asked for more details on the staff review part of the process using a free text question from the user…
Suggesting Process Model Improvements
The next capability that AI can help us with is suggesting improvements to our model, whether these are technical / process modelling improvements or actual business process improvements.
Our experience is that the suggestions provided by AI also range from the simple / trivial to more complex, less obvious ideas. It’s not always easy to get relevant suggestions from simplified demo processes like our staff review process — but you can see that some of the ideas are good and generally helpful.
Model Error Checking
The next capability is to detect and explain model errors. In the Flows for APEX Process Modeler, we have already included a BPMN linting capability that detects various syntactic errors in your model. Additionally, the AI engine is capable of finding another set of potential errors from its existent knowledge of BPMN and from our training prompt.
Here’s an error check on our demo model… which appears to be in good order.
We have a class of typical user errors that come from starting parallel sections in a model, which have to all end at the same merging gateway or go to their own end points. When errors in these. rules occur, our experience is that AI is very good at finding the problem, explaining what the problem is, and suggesting ways to change the model to fix the problem. Certainly better than the typical ‘rule X is broken’ style error message!
Describing Message Flow
One of the capabilities of Flows for APEX Enterprise Edition v24.1 is the ability for one process to collaborate with another process, which might be in the same APEX instance or via-REST at a supplier or customer, by sending and receiving messages. This collaboration can start a remote process, subscribe and wait for an incoming message, interrupt a process when a message arrives, or emit a message when a process or sub-process completes. This is process collaboration via BPMN Message Flow.
One of the key design tasks in setting up process collaboration is to design the message definitions to be used in this structured messaging environment. (I’ll write a blog post about this soon). Again AI can help us to describe the messaging defined in a model, pulling information from all of the places where message structure is defined.
Our demo model doesn’t have any messaging in it, so I’ve taken another example here, and given screen shots here of the overall message process and the AI-generated documentation on the message structures.
Here’s a summary of the model for those of you not sure about the BPMN here. (it’s easy to generate this, so why not give it to you….)
Asking AI for a description of the message structures gives us this output…
Language Translation
All of our business process diagrams have been in English so far, but what happens when the diagram is in a language you can’t understand? How can AI help the business manager trying to understand why the business process in the Japanese office isn’t working as they expect? Or how can a support analyst help solve a process problem when it’s 2AM in Tokyo and support has rolled over to the help desk in London?
Well, the current LLMs are all good at language translation, and we can give AI a model in one language and ask for an explanation in another language.
Here’s a model that most of us can’t read (…with apologies to those of you who can read Japanese!)…Where to start? Let’s Ask Flo…
So now we know what the business process is, and how it works! Note that AI gives us the original task names in Japanese, the pronunciation in Romanji (Japanese using Roman characters), and an English translation.
This capability works well in all of the languages that we have had native speakers review output.
Showing off, one of our Flows for APEX users has a requirement to be able to provide output in Welsh language to Welsh users. The AI service can do that** (**to the best of my knowledge, but I can’t read Welsh!)
AI Services
The results above are all created using the OpenAI gpt-4o
model. Other models, including the Cohere and OCI AI Service models can understand BPMN to a limited degree, but provide output that is much less full and less reliable than these examples. But as with everything AI, the situation is changing rapidly and other models may be capable of producing this quality of interaction soon.
How Do I Use This?
The Ask Flo GenAI Assistant is a feature in Flows for APEX Enterprise Edition v24.1, which is now available on a supported, annual subscription basis from Flowquest. (www.flowquest.net).
The Ask Flo AI feature requires APEX 24.1 and a OpenAI API key with pre-paid balance. (Don’t be deterred by the cost of using the AI service - our work to optimise the parts of the BPMN diagram that is sent to BPMN reduces the number of token used, and so the AI running costs of this are not expensive for the benefit provided. My token usage today to create all of the examples in this blog, along with a several other discarded queries, cost under US$0.02).
Subscribe to my newsletter
Read articles from Richard Allen directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Richard Allen
Richard Allen
Richard became at Oracle user back in 1984 with Oracle V4.1, then joined Oracle as a Consultant working on defence and health projects. Moving to California just in time for the 1989 Loma Prieta earthquake, he was the Product Manager for database security and then Director of the Secure Systems team, and moved to Singapore to do public sector marketing. After leaving Oracle in 1997 and attending London Business School as a Sloan Fellow, he then spent ~20 years on various startup activities in Asia - helping to start 2 low-cost airlines and co-founding regional retail distribution businesses for Crocs and Totes. In 2018, back in the UK, Richard picked up Oracle again, and specifically Oracle APEX. Needing some workflow components for a project and finding that there was nothing available off-the-shelf, Richard started contributing to the Flows for APEX project when it was first announced in April 2020. Since then, he has been the main architect and developer of the Flows for APEX engine. In 2022-23, he worked on Flows for APEX and APEX Workflow as a member of the APEX Development Team at Oracle.In 2024, he has developed and launched the Flows for APEX Enterprise Edition as a paid option for Flows customers needing support, and as a way to make Flows for APEX a sustainable and well supported BPMN-based workflow solution for APEX. Richard currently slits his time between London and Singapore.