Blacknode can export a visual workflow to readable Python or LangGraph, import that generated file back into the editor, and stream external Python execution state into run replay.
Editor:
- Start Blacknode.
- Open or build a workflow with an
Outputnode. - Use the top-bar
Exportmenu. - Choose
Plain PythonorPython Class.
CLI:
blacknode export-python templates\text-pipeline.json --output workflow.py
blacknode export-python templates\text-pipeline.json --style class --output workflow.class.pyFramework exporter:
blacknode export-framework templates\text-pipeline.json --target python --output workflow.python.py
blacknode export-framework templates\text-pipeline.json --target python-class --output workflow.class.pyThe exported script keeps stable node IDs, clear variable names, step comments, typed node params, visual edges, and the workflow entrypoint.
python workflow.pyExpected result for the starter workflow:
Hello World
Editor:
- Click
Importin the top bar. - Pick a Blacknode workflow JSON, Python export, or LangGraph export.
- The editor opens it as a new workflow tab.
You can also drag a .json workflow or .py export directly onto the editor
canvas.
CLI:
blacknode import-python workflow.py --output imported.workflow.json
blacknode import-python workflow.langgraph.py --output imported-langgraph.workflow.json
blacknode validate imported.workflow.jsonHTTP:
$code = Get-Content .\workflow.py -Raw
Invoke-RestMethod `
-Method Post `
-Uri http://127.0.0.1:7777/import/python `
-ContentType application/json `
-Body (@{ code = $code; name = "Imported Workflow" } | ConvertTo-Json)Live sync lets a Python script push run events back into the editor.
- Start Blacknode with
start.bat. - Export a workflow to Python.
- Run the script with
BLACKNODE_SYNC_URLpointing at the editor backend.
PowerShell:
$env:BLACKNODE_SYNC_URL="http://127.0.0.1:7777"
python workflow.pyWhen live sync is enabled, the editor opens the workflow tab and shows node
execution through run replay. If BLACKNODE_SYNC_URL is not set, the exported
script runs normally without contacting the editor.
Live-sync endpoints:
| Endpoint | Purpose |
|---|---|
POST /sync/runs |
Start an external Python run. |
POST /sync/events |
Append run replay events. |
POST /sync/runs/{run_id}/finish |
Mark the run success or error. |
GET /sync/runs/{run_id} |
Read a running or finished run snapshot. |