n8n Workflow Diagram - turn a workflow export into a Mermaid diagram and client-ready HTML
Turn an exported n8n workflow into a Mermaid diagram and a standalone HTML page you can send to a client.
Clients do not read JSON. They read a picture with the steps in order. This generates that picture from the export, so the diagram matches reality instead of being drawn by hand from memory.
WHAT YOU GET
1. n8nwf_diagram.py - Mermaid output to stdout, a self-contained HTML page, or a raw .mmd file for docs.
2. A real example: a 14-node inbound-triage workflow rendered as a diagram, with the workflow's sticky notes listed underneath.
3. Sensible shapes: triggers as stadiums, IF/Switch as diamonds, code nodes as subroutines, HTTP calls as database shapes, disabled nodes labelled on the shape.
USAGE
python n8nwf_diagram.py workflow.json # Mermaid to stdout
python n8nwf_diagram.py workflow.json -o diagram.html # full page
python n8nwf_diagram.py workflow.json --mmd-out g.mmd # raw Mermaid for a README
python n8nwf_diagram.py workflow.json --direction LR
Sticky notes on the canvas are collected and shown under the diagram as "Notes from the workflow", so assumptions someone wrote down do not get lost when the diagram is exported.
WHO IT IS FOR
Anyone who hands automation work to someone else: handover documents, client updates, onboarding, or a README that needs a picture.
REQUIREMENTS
Python 3.8+. No dependencies. MIT licence. The HTML page loads Mermaid from a CDN, so the diagram renders when opened with internet access.
If a node shape renders badly for your workflow, email me the type and I will map it: abd315222@gmail.com