Loading component…
Loading component…
This component has not been implemented locally yet.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import WorkflowBuilder from ./workflow-builder.
import { WorkflowBuilderScreen } from "@/components/ui/workflow-builder";
export default function Page() {
return <WorkflowBuilderScreen workspace="Northwind" project="Customer onboarding" onNavigate={(label) => router.push(routes[label])} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| onNavigate | (label: string) => void | Called with the label of a sidebar item | |
| workspace | string | "Northwind" | Organisation in the path and the sidebar's workspace |
| project | string | "Customer onboarding" | Project in the path |
| user | { name: string; avatar?: string } | { name: "Alex Morgan" } | Account at the bottom of the sidebar |
| loading | boolean | false | A saved workflow is being opened: gray cards where the nodes sit and neutral curves, Run off – the palette, path bar and toolbar stay real |
| empty | boolean | false | A new workflow: an empty canvas with one centered “Add a trigger” and an Add trigger button; the palette, path bar and toolbar stay real and the run panel shows its own empty states |
| className | string | Extra class on the root | |
| nodes | { id; type; title; sub?; x; y; config? }[] | The nodes – type is one of the palette's types, x and y in canvas pixels; config holds what the settings panel edits (a trigger without source shows as not configured) | |
| edges | { id; from; port: "out" \| "yes" \| "no"; to }[] | The curves between them – port is the output they leave from; a branch has Yes and No | |
| branch | string | "Main" | Branch in the path – Main shows as Production |
| comments | { id; x; y; text; author? }[] | Comments already on the canvas (posted, shown as pins) | |
| stepResults | Record<nodeId, { ms?; credits?; error? }> | What each node returns in a test run – an error fails that step and stops the run | |
| labels | { publish?: string } | Labels, e.g. for a translation | |
| palette | { id; label; items: { type; label; kind; icon; sub; description }[] }[] | The palette's groups – kind is trigger, agent, tool, logic or action |
Fills its container – give it the full viewport height in your app
The flow runs from top to bottom and opens at 100% (never below 90% on a desktop canvas); Fit to view never zooms past 100%
Pan by dragging the background, with Space + drag or two fingers; zoom with the toolbar, ⌘/Ctrl + wheel or a pinch. A plain wheel pans right away when the canvas fills a page that doesn't scroll; in a longer page, once you've clicked into it
Below 640px the palette becomes a sheet behind Add node, the settings a sheet from the bottom, the path bar moves past the sidebar button and the run panel keeps the figures that matter; touch targets grow to 36px and fields use 16px text
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"; colors are CSS variables on .ui-as