Leveraging Custom GPTs to Generate Business Analysis Diagrams Using Mermaid
Out of the box, AI tools can generate many common business analysis diagrams based on a business scenario provided to the AI tool. However, these are typically static images, and you may need long exchanges with an AI tool to produce the result you desire. A better approach is to have the tool generate diagram code, which can then be imported into a tool and manipulated. Mermaid is a free and powerful graphical tool suitable for this use, and ChatGPT’s custom GPT capacities provide a means of storing instructions on how to create diagrams within a reusable framework. (Please note, the creation of custom GPTs requires a ChatGPT Plus license.) Once created, you can provide different business scenarios to the custom GPT to have it generate diagrams. The diagrams may not be perfect, but since they can be imported into the Mermaid interface, they can be easily edited visually.
The steps to follow to create a custom GPT are:
- Log in to ChatGPT at this location: https://chatgpt.com/gpts. If there’s any risk of exposing proprietary information, please be sure to use a company-supported instance of ChatGPT, one that does not feed your entries back into ChatGPT. If you have any uncertainty about this, confirm your approach with an AI administrator at your firm before proceeding.
- In the upper right corner of the https://chatgpt.com/gpts screen, you’ll see a “Create” button.
Click on it:
- You come to a screen with two tabs on the left, “Create” and “Configure”. In the “Create” tab, you can provide a prompt that will create whatever persona you want the GPT to take. One possible prompt might be “Create a business analyst agent that generates business analysis diagrams when given a description of a business process.”.
- In the “Configure” tab, you can alter the appearance of the custom GPT and go into more detail. The options are:
- Name - The name that appears when someone opens the custom GPT
- Description - A description of the purpose the custom GPT is designed for.
- Instructions – Specific instructions for how the GPT should operate.
- Conversation Starters - These are suggested prompts, to guide the user of a custom GPT on how to ask for diagrams. Some representative starters I used are:
- I would like to create a high-level data flow diagram from a business process description I'll provide
- I would like to create use cases from a business process description I'll provide
- I would like to create a swimlane chart in Mermaid code format for a business process description I'll provide
- Knowledge – In this section, you can provide documents that can inform the custom GPT. In my case, I provided a generic example of a life insurance claims process, which I asked ChatGPT to generate for me, and then an example of an intermediate file, which I found to be a better way to generate diagrams. (More on that later.)
- The instructions I finally settled on for this process are long but are the result of a process of querying ChatGPT and working through issues with its initial results. You should anticipate some back and forth with ChatGPT, to improve on your initial attempts.
“This GPT acts as a business analyst skilled in transforming verbal descriptions of business processes into clear, structured business diagrams. It listens attentively to user input, extracts relevant details about entities, workflows, data flows, and decision points, and uses that information to create diagrams such as process flowcharts, swimlane diagrams, and high level data flow diagrams. It explains its logic when needed, asks clarifying questions if details are missing or ambiguous, and aims for clarity and professionalism in all outputs. This GPT may use visual tools, where appropriate to aid communication and provide draft visuals for refinement. The default format for diagrammatic output is Mermaid code.
It takes a professional tone, with concise, clear language and diagrams suited for business use cases like stakeholder meetings, planning sessions, and documentation. If the user is vague, the GPT politely asks for details to ensure accuracy.
Before generating a diagram, the GPT must first read and internalize the sample business-process document "Life Claim Process – AI Generated.docx and then read and internalize the example “Intermediate Format” file. These demonstrate how the initial file, describing a business process, can be restructured into a different form, the "Intermediate Format" file, which serves as a better basis for generating a diagram. When presented with a new business scenario, the GPT must first create an intermediate file for the new process, and must then base creation of any diagrams or use cases on the intermediate file.”
Any lanes generated in Draw.io code will have a height of 140, and all the nodes of the process will fit within their respective lanes.
Any bodies of code generated must come with a "Copy" link.”
You might notice that I reference an intermediate format in the instructions. I found I got better results by having ChatGPT first render the process into tasks, events, and gateways, and then premising the diagrams on this representation of the process. To do this, I provided the custom GPT with two documents in the Knowledge section of the Configuration tab:
- A sample scenario
- A representation of that process in tasks-events-gateways format
To create these example documents for your ChatGPT, provide ChatGPT a business scenario relevant to your industry, and ask ChatGPT to render that scenario in BPMN tasks-events-gateway format, then drag and drop your scenario document and the tasks-events-gateways format document into the “Knowledge section of “Configuration”. (In my case I also had ChatGPT generate the example business process.)
When done, save your results with the “Update” button in the upper right-hand corner of the screen, and then try a different scenario. You might need to repeat the process a few times to get your desired results, in which case you might want to alter the “Instructions” to address those shortcomings.
The results you get are unlikely to be perfect, but the beauty of this approach is that after you’ve dropped the generated code into Mermaid the diagram usually can be easily corrected just by dragging and dropping the diagram elements. To view and edit your diagram in Mermaid:
- Go to https://www.mermaidchart.com
- Select the “Playground” option on the top of the screen,
- You’ll come to a page with example code on the left side of the Replace the code example in the upper left-hand corner of the page with the code from the diagram you generated.
- If the code doesn’t render and you get an error message, return to ChatGPT and ask it to render the code again, this time without that error. You might need to iterate with ChatGPT a few times.
- Do any cleanup needed manually. On the right side of the Mermaid screen, you’ll see the visual representation, which can be manipulated by dragging and dropping data elements.
You may need to converse repeatedly with your custom GPT to resolve any issues that arise, but once you’ve resolved those issues and have updated the instructions accordingly, your custom GPT will be a diagramming engine, and should save you considerable time in the future.
Example of Generated Mermaid Code:
%% Level 0 Data Flow Diagram - Life Insurance Claim Process
flowchart TD
%% External Entities
Beneficiary[/"Beneficiary/Policyholder"/]
Agent[/"Agent/Broker"/]
ThirdParty[/"Third Parties\n(Medical, Investigators)"/]
StateDept[/"State Insurance Dept"/]
%% System
subgraph System["Life Insurance Claim System"]
Process[("Process Life Insurance Claim")]
end
%% Data Stores
D1[(Claim Management\nSystem)]
D2[(Document Repository)]
%% Flows from External Entities
Beneficiary -->|FNOL & Documents| Process
Agent -->|FNOL Submission| Process
ThirdParty -->|Medical Info / Investigation Data| Process
StateDept -->|Appeal or Complaint Info| Process
%% Flows to External Entities
Process -->|Acknowledgment / Requests / Decisions| Beneficiary
Process -->|Updates| Agent
Process -->|Inquiry Responses| StateDept
%% Internal Flows to Data Stores
Process --> D1
Process --> D2
D1 --> Process
D2 --> Process
Example Mermaid Diagram:

You May Also Like
These Related Stories

How to leverage ChatGPT as a Digital marketing analyst

How To Leverage ChatGPT as a Financial Business Analyst



No Comments Yet
Let us know what you think