Apache NiFi → Markdown + Mermaid

nifi2md

Parses an Apache NiFi flow definition JSON file and generates Markdown documentation, one file per process group, each with a Mermaid diagram, all cross-linked from a main index.md. Processors are annotated with the Enterprise Integration Patterns vocabulary, so the pages describe what role each processor plays, not only which class it is.

JDK 17+ build Gradle 8 CLI picocli output Markdown + Mermaid license GPL-3.0-or-later
01 / overview

Features#

Everything the generator emits, in one pass over the flow file.

02 / setup

Build#

Requires JDK 17+ and Gradle (no wrapper checked in; use a local Gradle 8.x).

gradle build          # compiles, runs tests, builds build/libs/nifi2md-<version>-all.jar
gradle fatJar         # just the executable uber-jar
gradle run --args="path/to/ACME.json"
03 / cli

Usage#

java -jar build/libs/nifi2md-0.1.0-all.jar test/ACME.json

Default output: a <input name>-docs/ directory next to the input file.

test/ACME-docs/
├── index.md                      # summary, parameter contexts, services, group index
└── process-groups/
    ├── acme.md                   # root group: diagram + processors + connections
    ├── acme-service-1.md
    └── ...
04 / reference

Options#

OptionDefaultDescription
-o, --output <dir><input name>-docsOutput directory
-t, --title <title>root process group nameDocumentation title
-d, --direction <dir>LRMermaid layout: LR, RL, TB, TD, BT
--no-diagramsoffSkip Mermaid diagrams
--no-propertiesoffSkip component property tables
--max-property-length <n>200Truncate property values (0 = no truncation)
-q, --quietoffDo not print written files
-h, --helpHelp
-V, --versionVersion
05 / artifacts

Generated documentation#

Files cross-reference each other with relative links, so the output works on a documentation site, in a Markdown viewer, or on GitHub as-is.

index.md

Flow summary (counts of groups, processors, connections, ports, services), process group index tree, parameter contexts with masked sensitive values, controller services with configuration.

process-groups/<group>.md

Breadcrumb links, mermaid flowchart, processor table with mapped integration pattern, connections, ports, child group links, services, remote groups, funnels and canvas labels.

06 / rendering

Diagram conventions#

NodeMeaning
([ name ]) stadiumEndpoint processor, or process group port
{ name } rhombusMessage router
{{ name }} hexagonSplitter / aggregator / recipient list
[/ name /] trapezoidMessage translator
( name ) roundProcessor without a mapped pattern
[[ name ]] subroutineNested process group (opens its own page)

Connections pointing at a port of a child group are drawn against that child group node, so each level stays readable.

mermaid · flowchart
flowchart LR
    fetch([Fetch orders]) -->|success| route{Route by type}
    route -->|order| split{{Split lines}}
    route -->|invoice| billing[[Billing]]
    split --> persist([Persist])
Example of the Mermaid flowchart the generator emits for a group.
07 / internals

Project layout#

src/main/java/fr/giwi/nifi2md/
├── Main.java                    # picocli CLI
├── model/                       # Jackson-mapped NiFi flow model + FlowParser
├── eip/                         # EipPattern, EipCatalog (NiFi type -> EIP pattern)
└── render/                      # MermaidRenderer, MarkdownGenerator, Texts
08 / legal

License#

GNU General Public License v3.0, see LICENSE. Every source file carries SPDX-License-Identifier: GPL-3.0.