The Flow Debugger

The flow debugger allows you to interactively debug flow programs by setting breakpoints, stepping through execution, and inspecting runtime state.

The debugger uses a two-process architecture: the flow runner (flowrcli) hosts the debug server, and flowrdb is a standalone debug client that connects from a separate terminal. This keeps the debugger's I/O separate from the flow's stdin/stdout.

Compiling with Debug Symbols

Flows compiled by flowc using the -d or --debug option will have extra human-readable content included in the compiled manifest (names of processes, source locations, etc.) and be more convenient to debug.

Note: flowrcli must be compiled with the "debugger" feature enabled (it is by default).

Starting a Debug Session from the Command Line

Terminal 1 — Start the flow with debugging enabled:

flowrcli --debugger --native my-flow/manifest.json
# Debug server listening on port 12345. Connect with: flowrdb --address localhost:12345

Terminal 2 — Connect the debugger:

flowrdb --address localhost:12345

Or let mDNS discover the debug server automatically:

flowrdb

The debugger will display a prompt where you can enter commands before execution begins.

Starting a Debug Session from flowrgui

flowrgui supports three debugging modes:

1. Debug locally with the GUI debugger (-d)

flowrgui -d --native my-flow/manifest.json

This auto-submits the flow in debug mode and connects the built-in GUI debugger. A debug control row appears with buttons for Continue, Step, Reset, Exit, breakpoints, and inspect commands. A Debug tab shows debug events and command output. Click Stop to exit the debugger at any time.

You can also start this mode interactively by clicking the Debug button (instead of Play) in the UI.

2. Debug a remote server (-d <host:port>)

flowrgui -d localhost:12345 --native my-flow/manifest.json

This connects the GUI debugger to a debug server running elsewhere (e.g., a flowrcli --debugger session on another machine). The same debug controls and Debug tab are available, but the flow runs on the remote server.

3. Let an external debugger connect (--external-debugger)

flowrgui --external-debugger --native my-flow/manifest.json

This starts the debug server inside flowrgui and waits for an external debug client (such as flowrdb) to connect from a separate terminal. The status bar shows the flowrdb command to use. Flow output appears in flowrgui's tabs while debug commands are entered in flowrdb.

Debugging Workflow

  1. The debugger starts paused before flow execution
  2. Use inspect to examine the initial state
  3. Set breakpoints with breakpoint on specific functions, inputs, or outputs
  4. Use continue to run until a breakpoint, or step to advance one job at a time
  5. When a breakpoint triggers, examine state with inspect and functions
  6. Use continue or step to resume
  7. After the flow completes, you can reset to re-run or exit to quit

Debugger Commands

CommandShortDescription
helph, ?Display help on available commands
step [n]sStep over the next n jobs (default 1) then break
continuecContinue execution until next breakpoint or end
breakpoint {spec}bSet a breakpoint (see specs below)
delete {spec}dDelete a breakpoint matching the spec, or * for all
listlList all breakpoints currently set
functionsfShow all functions in the flow
processespShow flows and functions in a hierarchical tree
inspect [spec]iInspect overall state, or a specific function/input/output
validatevRun checks to validate the current flow state
modify name=valuemModify a runtime variable (e.g. max_parallel_jobs=2)
run / resetrReset the flow state and re-run from the beginning
exit / quite, qStop execution and exit the debugger

Breakpoint Specs

Breakpoints can be set on different aspects of flow execution:

SpecExampleDescription
function_idb 3Break when function #3 is about to execute
function_id+b 3+Break when function #3 completes a job
source_id/routeb 3/resultBreak when function #3 sends on output /result
dest_id:inputb 5:0Break when input #0 of function #5 receives a value
src->destb 1->2Break when a block is created between functions #1 and #2
/routeb /my-flow/addBreak on function at that route path
*d *Delete all breakpoints

Inspect Specs

The inspect command accepts the following spec formats to examine specific parts of the flow:

CommandDescription
iShow overall flow state with all functions
i 3Show state of function #3
i 5:0Show state of input #0 on function #5
i 3/resultShow output connections from function #3's /result route
i 1->2Show blocks between functions #1 and #2
i readyShow functions currently in Ready state
i waitingShow functions in Waiting state
i runningShow functions in Running state with job IDs
i completedShow functions that have completed
i blockedShow functions blocked on output, and what blocks them
i /my-flow/addInspect function or flow at that route path