Workflow Builder
A node canvas for agent workflows that refuses broken wiring as you draw it.
PROGet Workflow Builder and 168 other Pro components with pro lifetime — Get Pro
- Category
- AI Agent
- Access
- ProPro · unlocked
- Source
- 629 lines · one file
- States
- 6 drawn
- Added
- 2 Nov 2026
The decision inside it
The canvas checks as you connect
A flow that fails at step five because of a wrong wire wastes a run. Ports of different types and loops refuse to join and say why. Steps missing a required setting are marked, and Run stays off with a problem count that takes you to each one.
When to use it
Use Workflow Builder when people design agent or automation flows themselves: steps on a canvas, typed ports, settings per step and a Run button. To show a finished run as a graph use Agent Execution Graph.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Liro's Workflow Builder for this.
Install it: npx shadcn@latest add @liro/workflow-builder
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/workflow-builder.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.
Usage
import { WorkflowBuilder, type WorkflowGraph, type WorkflowNodeType } from "@/components/ui/workflow-builder";
const types: Record<string, WorkflowNodeType> = {
trigger: { label: "New ticket", tag: "trigger", outputs: [{ id: "ticket", label: "Ticket", kind: "json" }] },
reply: {
label: "Draft a reply",
tag: "agent",
inputs: [{ id: "ticket", label: "Ticket", kind: "json", required: true }],
outputs: [{ id: "draft", label: "Draft", kind: "text" }],
fields: [{ key: "model", label: "Model", required: true }],
},
};
export function WorkflowEditor({ saved, api }: {
saved: WorkflowGraph;
api: { save: (g: WorkflowGraph) => void; run: (g: WorkflowGraph) => Promise<void> };
}) {
return <WorkflowBuilder nodeTypes={types} defaultNodes={saved.nodes} defaultEdges={saved.edges} onChange={api.save} onRun={api.run} />;
}API reference
“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Type | Notes | ||
|---|---|---|---|
nodeTypes | Record<string, WorkflowNodeType> | Yes | – |
defaultNodes | WorkflowNode[] | No | – |
defaultEdges | WorkflowEdge[] | No | – |
onChange | (graph: WorkflowGraph) => void | No | Every edit, with the whole graph. |
onRun | (graph: WorkflowGraph) => void | Promise<void> | No | Starts a run. May return a promise. |
runState | Record<string, NodeRunState> | No | Live status per node while a run is going. |
title | string | No | – |
look | Look | No | – |
Dependencies
npm packages
clsxframer-motionlucide-reacttailwind-mergeLiro foundations, installed alongside it
liro-themebuttonStates
All of them are drawn by the component. None is left for you to design.
- Ready
- Invalid wire
- Missing settings
- Running
- Run failed
- Empty
Accessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances