Skip to content

Process Dependency Graph

Process Compose provides a powerful way to visualize your process dependencies through multiple interfaces.

TUI Graph View

You can access an interactive dependency tree directly within the TUI.

  • Shortcut: Ctrl+Q
  • Features:
  • Interactive expansion/collapse of nodes (use Enter or Mouse Click).
  • Status-colored nodes:
    • Green: Running
    • Yellow: Pending, Launching
    • Blue: Completed
    • Red: Error, Failed
    • White: Other statuses
  • Indication of dependency conditions (e.g., <process_healthy>).

CLI Graph Command

The graph command allows you to export or view the dependency tree in various formats.

# Display a beautiful ASCII tree (default)
process-compose graph

# Export to Mermaid flowchart format
process-compose graph --format mermaid

# Get the raw graph data in JSON or YAML
process-compose graph --format json
process-compose graph --format yaml

Examples

ASCII Output

Dependency Graph
└── frontend [Pending]
    └── api-server [Running] <process_healthy>
        ├── postgres [Running] <process_healthy>
        └── redis [Running] <process_healthy>

Mermaid Integration

You can pipe the mermaid output directly to a file or a viewer:

process-compose graph -f mermaid > graph.mmd

REST API

The dependency graph is also available via the REST API, providing a recursive JSON structure of all processes and their dependencies.

  • Endpoint: GET /graph
  • Response: A JSON object containing a nodes map where each entry represents a "leaf" (process that no other process depends on) and its full recursive dependency tree.
curl localhost:8080/graph