Skip to content
PlanningWorkflowMenu

Workflow

A node graph of an agent workflow with live status, rounded SVG edges and keyboard-focusable nodes. No dependencies.

An issue-to-pull-request workflow runs; the active edge flows toward the running node.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/workflow.json

Usage

tsx
import { Workflow } from "@/components/ui/chatcn/workflow"

<Workflow
  nodes={[
    { id: "triage", label: "Triage", detail: "claude-haiku-4-5", status: "done" },
    { id: "fix", label: "Write the fix", status: "in-progress" },
    { id: "pr", label: "Open pull request", status: "pending" },
  ]}
  edges={[
    { from: "triage", to: "fix" },
    { from: "fix", to: "pr" },
  ]}
/>

Without positions, nodes are laid out left to right: each node's column is its longest path from a source, and short columns center against the tallest. Pass x and y on every node to place them yourself.

Examples

Pan, zoom and select

Drag to pan, pinch to zoom, click or use the arrow keys to move between nodes.

Props

PropTypeNotes
nodesWorkflowNode[]{ id, label, detail?, status, meta?, x?, y? }
edgesWorkflowEdge[]{ from, to, label? }
runningbooleanAnimates the active edge; defaults to any node in progress
selectedId, onSelectSelection; nodes become toggle buttons
interactivebooleanPan, zoom and the zoom controls
heightnumberViewport height when interactive
nodeWidth, nodeHeightnumberDefault 184 by 52
labelstringAccessible name of the graph

Keyboard

KeyAction
TabEnter the graph on the running node, then leave it
ArrowRight, ArrowLeftFollow an edge forward or back
ArrowUp, ArrowDownMove within a column
Home, EndFirst or last node
Enter, SpaceSelect the node

Accessibility

  • Nodes are real buttons on one roving tab stop, each named with its label, status and detail.
  • Keyboard focus pans an interactive graph so the focused node stays in view.
  • Edges are decorative; the structure is spoken through arrow-key navigation along them.

Motion

  • The edge into a running node carries a dashed overlay whose dash offset flows toward the target, only while the workflow runs. It uses the Web Animations API and stops the moment the run stops.
  • Under reduced motion the active edge is a static solid line.