Workflow builder

A React block (a whole screen) in Beamline's Research & design app.

Automation rules for a SaaS without code: a trigger, conditions built with the query builder that branch into Yes and No, actions and waits, drawn as a flow you edit step by step; test it on sample records and watch each step decide, read past runs with what every step did, pause it with a reason everyone sees, and publish the draft only after reading what changed against the live version.

Use it for

  • Automation rules people set up themselves: route tickets, alert sales, nudge trials, escalate what waits too long.
  • Any rule that runs on an event, decides on the record's fields and acts, where people need to test it, see what it did and change it safely.

Not for

  • Showing a fixed flow an agent will run, read-only (flowchart on its own).
  • Segments and saved filters with no actions (query-builder).
  • Watching agent runs and their traces (agent-runs).

Anatomy

  • app shell: your navigation with the workspace's automations as a group, each with its state in words (Live, Paused, Draft)
  • header: the workflow's name (rename in place), its version and state (v3 live · 2 changes in draft), the on/off switch, Test run and Publish (the page's primary action)
  • paused notice: who paused it, when and why, and Turn on
  • tabs: Build · Runs (count) · Changes (count)
  • flow: the flowchart of the draft (Build), of the live version painted with a run's or a test's step results (Runs, Test run); the chosen step carries the ring
  • step editor (Build): the trigger's event; a condition's rules (query builder with the matching count) and its Yes and No paths; an action's kind and settings; a wait's length; add a step after this one; remove the step
  • test run: a sample record (and its fields), Run test, then each step's outcome in words; nothing is sent
  • runs: the last runs as a strip of status blocks, the runs as a table, and the chosen run's steps with what each did and how long it took; a failed run says why with Run again
  • changes: the live version against the draft as one tree (added, removed, changed old → new), Publish and Discard draft

States

  • a new rule: only the trigger, never published (Publish makes v1 live; the switch waits for it)
  • draft matches the live version; draft with changes (counted on the tab and in the header)
  • a step unfinished (a rule with no value, an action with no queue): said on the step, Publish disabled and the reason beside it with Show
  • publishing, published, refused (the current draft stays as built; a later pause survives the refusal; Try again publishes the current valid draft)
  • on; asking why (the switch stays on until a reason is given); paused with its reason; turning on; a refused switch goes back and says why
  • test run: choosing a sample, running (steps decide one at a time), done (each step's outcome), a condition that does not hold (its path skipped)
  • runs: loading, none yet, completed, waiting at a wait step (resumes at), failed at a step (the reason, Run again)

Keyboard

  • Tab: name, switch, Test run, Publish, the tabs, the flow, then the step editor
  • The flow is one tab stop walked with the arrows (the flowchart's own); Enter opens a step in the editor
  • Every control in the editor is the system's own field
  • Escape closes the pause question with the workflow still on

Motion

The ring travels from step to step (the flowchart's own). In a test run each step turns Running and then decides, one after another, and the path not taken turns Skipped; the run settles and nothing moves after. The matching count in a condition rolls as rules change. The tab counts roll. Reduced motion: the test still goes step by step (it carries information), with no travel.

Props

PropTypeDefaultDescription
workflow / defaultWorkflow / onWorkflowChangeWorkflow—{ id, name, draft, published, version, enabled, paused? }: what is edited (draft) and what runs (published, null before the first publish).
events (required)WorkflowEvent[]—What can start a workflow, each with the fields its conditions can test: { id, label, description?, fields: QueryField[], noun? }.
actions (required)WorkflowActionType[]—What a step can do: { id, label, icon?, params: { id, label, options?, placeholder? }[], describe(params) }.
samplesWorkflowSample[]—Records for a test run; without them there is no Test run.
runsWorkflowRun[] | null—Past runs, newest first; null while loading.
countMatches(eventId, query) => number | null—How many recent records a condition matches; null while counting.
countNoun[string, string]—What countMatches counts. Default the event's noun.
onPublish(workflow: Workflow) => Promise<void> | void—Shows Publish; a rejection keeps the draft and says why.
onEnabledChange(enabled: boolean, reason: string | null) => Promise<void> | void—Turning off asks for a reason first; a rejection puts the switch back and says why.
onRetryRun(runId: string) => void | Promise<void>—
pauseReasonsstring[]—Reasons offered when turning it off; Other (with a note) always follows.
userstring"You"Who is signed in, for the pause record.
tab / defaultTab / onTabChange"build" | "runs" | "changes"—
workflows / onOpenWorkflow{ id, name, state: "live" | "paused" | "draft" }[] / (id) => void—The automations listed in the navigation.
workspace / nav / defaultSidebarOpenstring / AppShellNavGroup[] / boolean—
className / style / refstring / CSSProperties / Ref<HTMLDivElement>—className: Classes on the documented visual root; no override by default. style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented native target or imperative handle; omitted by default.
workflowWorkflow—
defaultWorkflowWorkflow—
onWorkflowChange((workflow: Workflow) => void)—
tabWorkflowTab—
defaultTabWorkflowTab—
onTabChange((tab: WorkflowTab) => void)—
selectedstring | null—The step in the editor.
defaultSelectedstring | null—
onSelectedChange((id: string | null) => void)—
workflows{ id: string; name: string; state: "live" | "draft" | "paused"; }[]—
onOpenWorkflow((id: string) => void)—
workspacestring—
navSidebarNavGroup[]—
defaultSidebarOpenboolean—
classNamestring—Classes on the documented visual root; no override by default.
styleCSSProperties—Inline styles on the documented visual root; no overrides by default.
refRef<HTMLDivElement>—Receives the documented native target or imperative handle; omitted by default.
runsListListProps—Shared list vocabulary for run history; editor-node selected remains separate.

Built from

Dependencies

lucide-react

Import

import { WorkflowBuilder } from "@beamline/workflow-builder";

Get it

Workflow builder is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in Research & design

  • Research synthesis: A research study turned into evidence in one place. Transcripts: passages marked as accepted highlights or as the assistant's suggestions (dashed)…
  • Study setup: Set up an unmoderated test and its screener. Test: what's tested (a website, a prototype by its share link, an app by its store page), who takes it…
  • Study flow: A study's blocks in order, each with where people go next. A block that routes by its answer (multiple choice, scale, open question, prototype task) has…
  • Participant review: One participant's session, answer by answer, beside the list of everyone who took the study. The list filters (finished, left early, with a recording)…
  • Click heatmap: One screen of a usability task as it looked (your prototype's frame or a page built from your parts, scaled into a phone) with where people clicked over…
  • Tree test: A tree test: build a navigation tree and read where people went. Build: pages added at the top or under any page, indented under the page above or moved…
  • Prototype task: A prototype task in a study. The linked prototype refreshes from the design keeping the task and paths (a start screen gone from the new version said, a…
  • Task results: A usability task's results, from headline outcomes down to paths and screens. Outcomes (direct success, indirect success, gave up) say their share and…
  • Matrix question: A matrix question and the participant's side of it, side by side. Rows (up to ten) share one set of choices (two to seven); Enter adds a row, several…
  • Prototype review: Reviewing a design file's clickable prototype. Present: the board on a stage with its wireframe, the flow chosen (an unavailable one can't be), Back…
  • Report builder: Build a chart from your metrics without code: choose metrics, how to group them over time, an optional breakdown, filters, the range and the chart, see…
  • Report library: A business's reports in one place. The directory: reports by topic and group with search, each with what it answers; one this person can't open says why…
  • Review page builder: Building the page reviewers use to go through records one by one. The queue of records (one with no title shows its id instead of a blank); the record as…
  • Database builder: What a database does for the people who use it, built in one place. Templates: starting values per property (a relation default points at an existing…
  • Workflow library: The automation library: every automation as a row (what starts it, whether it's live, a draft or paused, who owns it, when it last ran, and its runs this…
  • Drawing board: A whiteboard a team already knows how to use, like FigJam: tools in a floating bar at the bottom (Select V, Hand H, Sticky note S, Shape R/O/D, Connector…
  • Model workbench: A CAD model's workbench around a large isometric scene of its bodies, each shaded from its material's appearance with a soft ground shadow and an axis…
  • Component properties: A design system component from three sides. Its variants as a matrix on two chosen properties, the others filtering it, each cell drawing the variant; a…
  • Slot editor: Slots in a design system component, from making to filling. The main component's layer tree with a checkbox per layer: a nested frame converts to a slot…

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.