Skip to content
EspañolEnglish
All components (244)

Agent workflow

AI · AgentWorkflowEditor · .amset-flow

What it is and when to use it

The workflow editor of an AI agent: the workflow editor with the steps of an agent already in place and translated.

When to use it

  • Designing how an agent works: what it does with the message, when it uses a tool, when it asks a person for permission and what it replies.
  • It brings six steps: user message, model, tool, condition (with "Yes" and "No"), human approval (with "Approved" and "Rejected") and reply. extraTypes adds your own.
  • It allows loops by default, because an agent goes back to the model after using a tool.
  • The rest is like WorkflowBuilder: value, onChange, runState to follow a run and readOnly.

When not to

  • A workflow that is not an agent's: WorkflowBuilder with your types.
  • It does not run the agent: it hands out the workflow; running it is the server's job.

Keyboard: that of the workflow editor, with the connections panel as the path without a mouse.

Accessibility: that of the workflow editor; the names of the steps and their outputs come out in the user's language.

Fine appearance: the --amset-flow-* variables of the workflow editor.

What it looks like

User messageWhere it starts: what the person writes
ModelA language model answers or decides
ToolCalls a tool with the data it receives
ConditionGoes down one path or the other
Human approvalWaits for a person to approve it
ReplyWhat is returned to the person
Drag a node or move it with the arrows. Press an output and then an input to connect them. Delete removes the chosen node.

<AgentWorkflowEditor
  label="Order assistant flow"
  value={flujo}
  onChange={setFlujo}
  height="26rem"
/>

Props

Import it with import { AgentWorkflowEditor } from '@amset/ui'. Required props are marked.

PropTypeWhat it does
labelrequiredstringWhich workflow it is («Customer onboarding»). Required.
onChangerequired(value: Workflow) => void—
valuerequiredWorkflow—
acyclicbooleanDo not allow closing loops. Off by default: an agent goes back to the model after using a tool.
classNamestringMerged with the library classes; it does not replace them.
extraTypesreadonly WorkflowNodeType[]Own node types added to an agent's (a specific tool, a subagent).
heightstringThe height of the canvas. 32 rem by default.
readOnlybooleanIt can be seen and moved through, but it does not change.
runStateReadonly<Record<string, NodeRunState>>The state of each node in a run (running, done, with an error), to follow it on the canvas.

It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.

CSS variables

These CSS variables are how you adapt it. Declare them on the component's selector, not on :root: the stylesheet redeclares them in the rule itself, and a declaration on the same element always wins.

VariableDefault
--amset-flow-dotvar(--amset-border)
--amset-flow-linevar(--amset-ink-2)

How to change it

.amset-flow {
  --amset-flow-dot: ...;
  --amset-flow-line: ...;
}

In the test bench

Every state and variant, to try one at a time, on its page at ui.amset.tech: