Visualization: CLI-first, config-driven β
This guide explains how to generate and maintain workflow diagrams for your agents using the CLI. Runtime builders and in-process diagram generation have been removed from public APIs. Diagrams are produced from your configuration (agentflow.toml) and saved as Markdown with Mermaid blocks.
Key points:
- Source of truth is your configuration (agentflow.toml)
- The CLI reads config and produces diagrams (no runtime builders)
- Diagrams cover route, sequential, collaborative, loop, and mixed modes
- Include the generated Markdown in docs and READMEs
What gets visualized β
- Agents registered by name and referenced by orchestration
- Orchestration mode and flow between agents
- Optional metadata (timeouts, error strategy) when available
Typical workflow β
- Define orchestration in agentflow.toml (mode, agents, routes)
- Ensure required plugins are blank-imported in your app (runner, orchestrators, llm providers)
- Use the CLI to generate visualization artifacts from config
- Commit the resulting Markdown files to your docs
Note: Because diagrams are CLI-generated, thereβs no Go API like NewComposition(), CanVisualize(), or SaveDiagramAsMarkdown() in the public surface. Prefer config + CLI.
Example diagram (Mermaid) β
Troubleshooting β
- If the CLI warns that a plugin is missing, add the appropriate blank import (runner/orchestrator/llm/MCP) to your main program.
- If a diagram is missing agents, check that their names match the ones in your orchestration config.
- For large systems, consider generating multiple diagrams per subsystem for readability.
Migration note β
- Older docs referenced builder-based visualization and runtime helpers. Those are no longer part of the public API. Use NewRunnerFromConfig and the CLI to manage orchestration and diagrams.