Command line

CommandWhat it does
workflow-render export <file.json> -o <out.svg|out.png> [--scale N]Render a workflow or an execution to SVG or PNG
workflow-render view <file.json> [--port N]Open the file in the browser viewer
workflow-render --versionPrint the version
workflow-render --helpPrint usage

export

workflow-render export workflow.json -o workflow.svg
workflow-render export workflow.json -o workflow.png --scale 3

Export every workflow in CI

for f in workflows/*.json; do
  npx workflow-render export "$f" -o "renders/$(basename "${f%.json}").png"
done

view

workflow-render view workflow.json
workflow-render view execution.json --port 4777

Expected output:

workflow-render viewing execution.json
  http://127.0.0.1:4777/
Press Ctrl+C to stop.

Executions

Give view or export an execution instead of a workflow and the canvas shows the run.

An execution in the viewer: status pill, check marks, item counts and a loop-back edge

Exit codes and warnings

Exit codeMeaning
0The file was written, or the viewer stopped normally
1The input could not be read, or is not a workflow or execution
2Usage error, such as an unknown flag

Warnings go to stderr, prefixed warning:. The file is still written.

workflow-render export dangling.json -o dangling.svg

Expected output:

wrote dangling.svg
warning: connection to unknown node "Ghost" dropped

Getting the JSON out of n8n

WhatHow
A workflowIn the editor, open the menu and choose Download, or call GET /api/v1/workflows/:id
An executionSave the response of GET /api/v1/executions/:id?includeData=true