hop export
hop export writes the diagram of a pipeline or a workflow to a file, in SVG or Mermaid format.
It exports one file, or every pipeline and workflow in a folder.
It uses the same exporters as File > Export diagram in Hop Gui, so you can create the diagrams from a script or a build.
The installation also has hop-export.sh and hop-export.bat, which run the same command.
# One file
hop export -f pipelines/load-orders.hpl -o diagrams/load-orders.svg
# One file as Mermaid
hop export -f workflows/main.hwf --format mermaid -o diagrams/main.mmd
# Generate positions for an SVG diagram
hop export -f pipelines/load-orders.hpl -o diagrams/load-orders.svg --layout-policy ALWAYS --layout-algorithm LAYERED
# Every pipeline and workflow in a folder and its subfolders
hop export -s /path/to/project -t /path/to/diagrams --recursive
# The formats this installation can write
hop export --list-exporters
Options
| Option | Description |
|---|---|
|
The pipeline ( |
|
The file to write, for |
|
|
|
The folder to export every pipeline and workflow from. |
|
The folder to write the diagrams to, for |
|
With |
|
Scale an SVG diagram, for example |
|
Automatic layout for SVG: |
|
|
|
Notes are included by default. Use |
|
List the exporters in this installation, with their format and file extension. |
|
Enable a project first, so that variables such as |
|
Enable an environment, and its project, first. |
The project options are the same as for hop run:
hop export -j my-project -f '${PROJECT_HOME}/pipelines/load-orders.hpl' -o /tmp/load-orders.svg
Run hop export --help for the full list, which also has -pl, --environments and the other options of the hop command.
Formats
Hop has SVG and Mermaid exporters for both pipelines and workflows.
Plugins can add more; --list-exporters shows what your installation has.
$ ./hop export --list-exporters
Available Diagram Exporters (4):
ID: pipeline-mermaid
Name: Pipeline Mermaid Exporter
Format: MERMAID
Extension: .mmd
Description: Exports a pipeline diagram to Mermaid flowchart (.mmd)
ID: pipeline-svg
Name: Pipeline SVG Exporter
...
-
SVG draws the diagram as it looks in Hop Gui, with the transform and action icons and the notes.
-
Mermaid writes a text flowchart (
.mmd) with a node per transform or action and an arrow per hop. You can keep it next to the project in version control, or paste it into a page that renders Mermaid.
Automatic layout
SVG exports can generate positions instead of relying on the saved diagram coordinates. The same options apply to single-file and batch exports, and are available in File > Export diagram in Hop Gui. Use the uppercase enum codes shown below on the command line.
| Policy | Behavior |
|---|---|
|
Keep saved positions; do not generate a layout. This is the default, preserving existing export behavior. |
|
Generate a layout regardless of saved positions. |
|
Lay out the whole graph when any node lacks valid explicit coordinates; otherwise keep saved positions. An explicitly saved |
LAYERED, the default algorithm, arranges nodes in layers following the graph connections.
GRID arranges nodes in a grid.
Both algorithms are deterministic for the same ordered input and options; changing the input order can change the generated positions.
Export uses a detached drawing model when changes are needed and does not change the original pipeline or workflow.
SVG layout accounts for measured node labels, decorations, and note sizes including their text and borders.
GRID packs included notes after the executable nodes in the same grid.
LAYERED repacks included notes in a separate annotation band above the execution graph.
Saved note positions do not affect generated layouts, and missing note positions alone do not trigger ON_MISSING.
Hops are not routed around obstacles.
Font availability can affect measured footprints, so output is not guaranteed to be identical across machines.
The algorithm is ignored with policy NONE, and the GUI disables its selector until another policy is selected.
Mermaid uses its own renderer for layout and does not use these options.
Exporting a folder
With -s, hop export exports every .hpl and .hwf file in the folder, and with -r in its subfolders too.
Each diagram is written under -t with the same relative path, for example pipelines/load-orders.hpl becomes pipelines/load-orders.svg.
-
-tmust be an existing folder. With-r, its subfolders must exist as well. -
The export stops at the first file it can’t export, for example a diagram whose folder is missing under
-t, or a file that is not valid XML. The diagrams written before it stay. -
A file that no exporter for the format supports is skipped and logged, for example a workflow when only pipelines have an exporter for that format. The other files are still exported.
-
A pipeline and a workflow with the same name in the same folder are written to the same file, so only the last one is kept.
At the end, the command logs how many diagrams it exported and how many it skipped.
Exit codes
hop export ends with 0 when the export is done, and with 1 when it fails, for example when the source folder doesn’t exist, no exporter writes the format, or a diagram can’t be written.
The hop-export.sh and hop-export.bat scripts end with other codes:
| Code | Meaning |
|---|---|
|
The export is done. |
|
The help was shown, with |
|
The export failed, for example when the source folder doesn’t exist or a file is not a valid pipeline or workflow. |
|
An option is not valid. |