# WorkflowGraph

See a workflow’s branches, loops and joins as a graph, a list or an outline.

- **Use it for**: Inspecting branches, loops and joins of a workflow.
- **Not for**: A simple linear list of stages. Try [AgentSteps](https://unseenui.com/components/agent-steps/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { WorkflowGraph } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

<WorkflowGraph variant="graph" nodes={nodes} edges={edges} selection={selection} onSelect={inspectNode} onEdgeSelect={inspectConnection} source={source} version={version} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` | Added to the root element, after the component's own classes. |
| `detail` | `DetailLevel` |  |
| `edges` (required) | `readonly GraphEdge[]` |  |
| `error` | `string` |  |
| `nodes` (required) | `readonly GraphNode[]` |  |
| `onEdgeSelect` | `((edge: GraphEdge) => void)` |  |
| `onSelect` | `((node: GraphNode) => void)` |  |
| `selectedId` | `string` | Legacy controlled node selection; do not combine with selection. |
| `selection` | `GraphSelection` |  |
| `source` | `string` |  |
| `state` | `"unknown" \| "ready" \| "loading" \| "denied" \| "unavailable" \| "error" \| "stale" \| "streaming"` |  |
| `title` | `string` |  |
| `variant` | `"list" \| "compact" \| "graph"` |  |
| `version` | `string` |  |

## Keyboard

Tab reaches controls; Enter or Space activates buttons. Accordions use arrow keys, Home and End. Select menus support arrows and typeahead; Escape closes menus and dialogs and restores focus.

## Works with

[RunBoard](https://unseenui.com/components/run-board/), [AgentLanes](https://unseenui.com/components/agent-lanes/), [SubagentTree](https://unseenui.com/components/subagent-tree/), [ExecutionTimeline](https://unseenui.com/components/execution-timeline/), [AttentionQueue](https://unseenui.com/components/attention-queue/), [RunCompare](https://unseenui.com/components/run-compare/), [ContextBar](https://unseenui.com/components/context-bar/), [Plan](https://unseenui.com/components/plan/), [AgentSteering](https://unseenui.com/components/agent-steering/), [CostLedger](https://unseenui.com/components/cost-ledger/), [ContextWindowMeter](https://unseenui.com/components/context-window-meter/), [MemoryPanel](https://unseenui.com/components/memory-panel/)

Page: https://unseenui.com/components/workflow-graph/
