affectUI › Screens › App screens

AI Chat / Workflow Builder

A chat that builds your automation on a canvas beside it – it tests each step with sample rows, fixes what breaks and asks before it touches real data.

Part of affectUI Pro. Install: npx shadcn@latest add https://www.affectui.com/r/ai-chat-workflow.json · Import from @/components/ui/ai-chat-workflow

When to use

  • An assistant that builds automations for you – you watch the workflow take shape and see every test run, not only a summary at the end
  • Workflows that read and write real data: test on sample rows first, show what each step got and gave, and ask before anything real is touched
  • Workflows that branch – ideas without a brief go to their own follow-up step, a check sends posts down a passed or a failed path; a path nothing took shows dashed as skipped. Each group is a coloured tag, on the canvas and in the logs

When not to use

  • A builder where people place and wire nodes by hand – use Workflow Builder
  • A team of agents working on one prompt – use AI Chat / Agent Run

Usage

import { AiChatWorkflowScreen } from "@/components/ui/ai-chat-workflow";

export default function Page() {
  return (
    <AiChatWorkflowScreen
      onPrompt={(prompt) => builder.start(prompt)}
      onRun={(mode) => builder.test(mode)}
      onResolve={(block, action) => builder.answer(block, action)}
      onPublish={() => builder.publish()}
      onNavigate={(label) => router.push(routes[label])}
    />
  );
}

Props

NameTypeDefaultDescription
promptstring"Every Monday, turn the ideas…"The prompt the screen opens with – the sample build plays it; empty starts without a workflow
onPrompt(prompt: string) => voidCalled when a prompt is sent – build your workflow here and feed its steps, runs and messages into your copy of the screen
onRun(mode: "sample" | "live") => voidCalled when a test run starts – from the assistant or from Test workflow on the canvas. Sample runs use made-up rows, live runs touch real data
onResolve(block: string, action: string) => voidCalled when a question in the chat is answered – the answer replaces its buttons
onPublish() => voidCalled when Publish is pressed
chatsShellChat[]The chats in the sidebar
loadingbooleanGray lines in the chat, gray steps on the canvas and in the logs
emptybooleanNo workflow yet – the canvas waits and the assistant offers a first prompt
workspacestring"Northwind"The workspace in the sidebar
onNavigate(label: string) => voidCalled with the label of a sidebar item
classNamestringExtra class on the root

Keyboard

  • Tab: Into the steps – one Tab stop
  • ← / → / ↑ / ↓: To the nearest step in that direction, as it's drawn – along the flow and down into a branch; a step out of sight glides into view
  • Home / End: To the first and the last step
  • Enter: Show the step's data in the logs
  • Esc: Close the open sheet
  • ← / → / ↑ / ↓: On a pane's edge: make the chat, the logs or the steps list bigger or smaller (Shift for bigger steps)
  • Home / End: On a pane's edge: smallest or largest size

Accessibility

  • Each step is named with its state and how long it took; the logs list is a set of toggle buttons, Input and Output are tabs, the step's data is a named region you can scroll by keyboard
  • Names, tasks and cells take their direction from their text (dir="auto"), so Arabic or Hebrew reads right to left; anything cut short shows in full on hover
  • The thread is a live region – new messages and questions are read out
  • The sheet card in the chat and the sheet's name in the logs open it as a dialog over the canvas – focus goes to Close, Esc closes it and focus returns to what opened it
  • Rings show for the keyboard only – never on the composer

Responsive

  • The sidebar starts folded; the chat keeps 380px (330 on narrower screens), the canvas and the docked logs the rest – Logs folds down to its header
  • Drag the edges like the sidebar's: the chat 300–560px (the canvas keeps 360), the logs from 120px until the canvas keeps 180, the steps list 180–360px – a double click goes back to the default, the canvas refits as you drag
  • The canvas keeps the cards readable – never bigger than the chat's text, about three in view (the whole workflow when it fits) – and glides to each card that appears or starts running; zoom yourself and it only pans, Fit to view shows it all. The follow button beside the zoom (blue while on) switches between following the run and moving freely – dragging the canvas lets go of it
  • In a narrow work area the steps stack top to bottom and the logs list runs along the top of the table
  • On phones Chat and Workflow switch at the top – Chat gets an amber dot when a question waits
  • Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"

Requirements

  • React 19
  • @hugeicons/react
  • @hugeicons/core-free-icons
  • App Shell, Assistant Home and Chat Composer (installed with it)

Related

  • AI Chat / Agent Run – A narrow chat beside the agents working on your prompt – watch each one's steps on a dot grid; when one gets stuck it says so in the chat and you answer right there
  • Workflow Builder – Nodes on a canvas joined by curves – drag them in from a palette, set each one up, then run the workflow and watch every step light up
  • Agent / Orchestration – A live multi-agent run as a tree on a canvas – watch work flow to the running agents, follow every call in the trace below and open an agent for its tasks, context and cost
  • Agent / Run Detail – One agent run, step by step – thinking, tool calls, sub-agents and failures as bars on one time axis, with time, cost and tokens on top and what went in and out of each step