Diagramming Incident Notification Flow Branches with Mermaid

プログラミング・Web開発カテゴリを表すパンダのイラスト Programming / Web Development

About This Article
This article was created using an automated generation flow powered by generative AI. We cross-referenced official Mermaid 11.12.2 documentation with implementations from existing training materials to organize operational examples and professional best practices.

Verification Status: 📘 Official information and training code verified. Real-browser operation of the demo version has not been verified.

When an incident occurs, searching through procedural documentation for contact information takes time. Using Mermaid to map out severity branches makes the path to the correct contact visible.

Open Live Demo

Key Terms to Know First

  • A flowchartis a diagram that uses arrows to indicate steps and branches.

  • A nodeis a box in the diagram that represents a task or a decision.

Thinking in Flowcharts

Diamonds represent decisions. The contact destination changes based on "Yes" and "No" answers.

flowchart TD
    A["障害受付"] --> B{"重大?"}
    B -- "はい" --> C["責任者へ連絡"]
    B -- "いいえ" --> D["担当へ連絡"]

Live Demo Operations

Change "Contact person in charge" in the diagram to different text. Add a minor incident branch as well.

How to Read the Results

Changing the inputs redraws the notification routes.

Place the individuals to be contacted inside boxes. Write decision outcomes on the arrows. Keep severity criteria and contact details in the main text.

Code Highlights

Draw two arrows from the severity node using flowchart TD and add labels.

The implementation can be verified under Implementation Code on the demo screen.

When Using in Professional Environments

Write at a level of granularity where the on-call staff can look at the diagram and determine the contact details.

First, inspect the two paths in the diagram.

When opening the demo, an incident reception flowchart starting with flowchart TD is present in the input field. Clicking Run and re-rendering is expected to show two paths extending from Incident Reception to Major?: one pointing to Contact Manager if Yes, and one pointing to Contact Staff if No. Focus on the relationship between the decision outcome and the contact destination, rather than the number of boxes displayed on the screen.

Next, change Contact Staff to Contact On-call Staff and run it again. Unless other boxes or arrows are modified, only the contact destination for the No branch should change. Without changing the source identifier D, edit the text inside the brackets. Because the diagram does not need to be manually redrawn every time, it is easier to manage diagram revisions alongside the procedure documentation's change history.

Consider Nodes and Arrows Separately

A, B, C, and D are IDs identifying nodes in the diagram. IDs and display names can be managed separately. Square brackets are used for process boxes, and curly brackets are used for diamond-shaped conditional branch boxes. Labeling arrows with Yes and No helps readers understand which decision result leads to which task. TD is the setting to arrange items from top to bottom. If you want to align them horizontally, try changing it to LR. Changing the direction does not alter the dependency relationships themselves.

Mermaid 11.12.2 is used for rendering the diagram. The common JavaScript loads the rendering module and initializes it with startOnLoad set to false and securityLevel set to strict. It passes the input string to render and displays the returned SVG. This is an instructional tool to observe the correspondence between the modified text and the displayed diagram, and no actual notification-sending process is implemented. We should avoid the misconception that notifications are automatically sent simply by creating the diagram.

Approach for Increasing Branches

For instance, if you want to add a third state such as Impact Unknown, it is difficult to express using only the Yes and No of a decision box. First, place a separate decision like Impact Scope Determined?, and if undetermined, proceed to information collection. Proceeding to the existing severity decision only when determined reduces the risk of misjudging a lack of information as minor. When adding branches, verify that there is a path to proceed next regardless of the input state.

Severity criteria are not defined by this demo. In actual practice, use conditions approved by your organization, such as the scope of service outage, number of users, operational deadlines, and data impact. There is also no general rule that high severity must always result in direct contact with specific individuals. The diagram shows the relationship between roles and decisions, while references to actual contact trees and on-call schedules are managed in organizational operational documentation.

When Rendering Fails

First, revert to the initial values and click Run. If the initial values render correctly but the modified diagram does not appear, check the syntax of brackets, quotation marks, and arrows, and ensure that the same ID is not unintentionally redefined. For example, enclose display names containing Japanese characters in half-width quotation marks. Building small diagrams and adding branches one by one while verifying whether they render immediately after addition makes it easier to track where failures occur.

If the initial values cannot be rendered, check the Network and Console tabs in the developer tools to inspect dependency module retrieval and rendering errors. Responses differ depending on whether the source contains an error or if Mermaid cannot be fetched due to network restrictions. Even if diagram rendering is unavailable, ensure that contact conditions can be understood through the procedural text. In this environment, connections to the actual browser were refused, and successful Mermaid rendering was not verified.

Incorporating into Operational Procedures

When reviewing changes to incident response procedures, assume about three typical incidents and trace the arrows sequentially from the entrance of the diagram. Verify whether the contact destinations and next actions are correct for major incidents, minor incidents, and incidents where the status is still unknown. Because mismatched versions of the diagram, main text, and on-call schedule can lead to incorrect contacts, verify reference consistency during updates.

Enter only fictitious role names in public demos. Do not input actual staff names, phone numbers, internal network configurations, or undisclosed incident information. While utilizing technology to convert Mermaid text into diagrams, actual operational decisions must follow the organization's approved procedures.

Verification Scope

Statically verify the official flowchart notation, the individual HTML settings diagrams, and the common daily.js. Execution of the local Mermaid module halts because window is undefined. Successful rendering and parser execution remain unconfirmed.

References

GitHub Samples

Implementation and Experimental Procedures

Document information

Article title
Diagramming Incident Notification Flow Branches with Mermaid
Published
Updated
Source
https://papanda925.com/?p=19003&lang=en

License: Text and original figures for which this site holds the relevant rights are available under CC BY 4.0 , unless otherwise noted. This article may include content created or edited with generative AI. If code has a separate license notice or a linked GitHub repository license, that license takes precedence for the code. Quotations, third-party materials, images, and trademarks are excluded from this license. Usage policy

Copied title and URL